Hi,
I am following tutorial Temperature and Humidity from Am2302 sensor using Thingworx Edge java SKD for Raspberry Pi. Following is the link of the tutorial
I am able to successfully bulid the jar using Maven. I have generated app key as well but we are not sure on the Url that I need to pass.
Following is the URL that I am using for composer
http://ge2-5016.cloud.thingworx.com/Thingworx/Composer/index.html
AND
Following are the different URL's that I tried to give as a parameter in my program for connection.
ws://ge2-5016.cloud.thingworx.com/Thingworx/Composer:443/ws
wss://ge2-5016.cloud.thingworx.com/Thingworx/Composer:443/ws
http://ge2-5016.cloud.thingworx.com/Thingworx/Composer/index.html
None of the above worked and I kept getting the following error:
Following is the log:
13:51:27.827 [main] DEBUG c.p.tempthing.BaseEdgeServer - EDGE SERVER STARTING....
13:51:27.915 [main] INFO c.t.c.c.p.ClientMessageProcessor - Created new ClientMessageProcessor [minPoolSize: 4, maxPoolSize: 10, maxThreadLife: 10000, maxQueueSize: 1000]
13:51:27.960 [main] DEBUG com.ptcmanaged.tempthing.Main - Connecting to ws://ge2-5016.cloud.thingworx.com/Thingworx/WS using key 73b6d3a4-f889-4bb8-8810-aec95b16f959
13:51:27.969 [main] DEBUG i.n.u.i.l.InternalLoggerFactory - Using SLF4J as the default logging framework
13:51:27.972 [main] DEBUG i.n.c.MultithreadEventLoopGroup - -Dio.netty.eventLoopThreads: 8
13:51:27.985 [main] DEBUG i.n.util.internal.PlatformDependent0 - sun.nio.ch.DirectBuffer.cleaner(): available
13:51:27.986 [main] DEBUG i.n.util.internal.PlatformDependent0 - java.nio.Buffer.address: available
13:51:27.986 [main] DEBUG i.n.util.internal.PlatformDependent0 - sun.misc.Unsafe.theUnsafe: available
13:51:27.986 [main] DEBUG i.n.util.internal.PlatformDependent0 - sun.misc.Unsafe.copyMemory: available
13:51:27.987 [main] DEBUG i.n.util.internal.PlatformDependent0 - java.nio.Bits.unaligned: true
13:51:28.048 [main] DEBUG i.n.util.internal.PlatformDependent - UID: 1000
13:51:28.048 [main] DEBUG i.n.util.internal.PlatformDependent - Java version: 8
13:51:28.048 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.noUnsafe: false
13:51:28.049 [main] DEBUG i.n.util.internal.PlatformDependent - sun.misc.Unsafe: available
13:51:28.049 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.noJavassist: false
13:51:28.050 [main] DEBUG i.n.util.internal.PlatformDependent - Javassist: unavailable
13:51:28.050 [main] DEBUG i.n.util.internal.PlatformDependent - You don't have Javassist in your class path or you don't have enough permission to load dynamically generated classes. Please check the configuration for better performance.
13:51:28.050 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.tmpdir: /tmp (java.io.tmpdir)
13:51:28.050 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.bitMode: 64 (sun.arch.data.model)
13:51:28.050 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.noPreferDirect: false
13:51:28.064 [main] DEBUG io.netty.channel.nio.NioEventLoop - -Dio.netty.noKeySetOptimization: false
13:51:28.064 [main] DEBUG io.netty.channel.nio.NioEventLoop - -Dio.netty.selectorAutoRebuildThreshold: 512
13:51:28.079 [main] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numHeapArenas: 4
13:51:28.079 [main] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numDirectArenas: 4
13:51:28.079 [main] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.pageSize: 8192
13:51:28.079 [main] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxOrder: 11
13:51:28.080 [main] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.chunkSize: 16777216
13:51:28.080 [main] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.tinyCacheSize: 512
13:51:28.080 [main] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.smallCacheSize: 256
13:51:28.080 [main] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.normalCacheSize: 64
13:51:28.080 [main] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxCachedBufferCapacity: 32768
13:51:28.080 [main] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.cacheTrimInterval: 8192
13:51:28.080 [main] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.cacheCleanupInterval: 5000 ms
13:51:28.085 [main] DEBUG c.t.c.c.e.m.CommunicationEndpointMonitorTask - Initializing CommunicationEndpoint Connection Monitor...
13:51:28.085 [Client-EndpointMonitor-1] DEBUG c.t.c.c.e.m.CommunicationEndpointMonitorTask - CommunicationEndpoint Monitor - checking for disconnected endpoints
13:51:28.085 [Client-EndpointMonitor-1] INFO c.t.c.c.e.m.CommunicationEndpointMonitorTask - Endpoint not connected [name: EP_0, id: 0]. Attempting [re]connect...
13:51:28.085 [Client-EndpointMonitor-1] DEBUG c.t.c.c.e.ClientCommunicationEndpoint - Clearing endpoint authentication data [id: 0]
13:51:28.086 [Client-EndpointMonitor-1] INFO c.t.c.c.e.ClientCommunicationEndpoint - Needed to refill connections on client endpoint [id: 0] : [active: 0, max: 1]
13:51:28.093 [Client-EndpointMonitor-1] ERROR c.t.c.c.e.ClientCommunicationEndpoint - Refilling connections on [endpoint 0, uri: ws://ge2-5016.cloud.thingworx.com/Thingworx/WS] failed : null
13:51:28.093 [Client-EndpointMonitor-1] INFO c.t.c.c.e.m.CommunicationEndpointMonitorTask - Endpoint reconnection was unsuccessful [name: EP_0, id: 0]
Please help in resolving this problem.
Thanks,
Dimple
Dimple, is your platform setup for ssl at 443? Can you access your platform at https://ge2-5016.cloud.thingworx.com:443/Thingworx? If so, try this Uri: wss://ge2-5016.cloud.thingworx.com:443/Thingworx/WS
If you don't have ssl setup, use this Uri (assuming it's at port 80): ws://ge2-5016.cloud.thingworx.com:80/Thingworx/WS
perfect!!!
Hi Dimple,
Please use this command to run the jar file on your RPI :
java -jar ./temperature-thing-jar-with-dependencies.jar ws://ge2-5016.cloud.thingworx.com:80/Thingworx/WS <your app key>
Veronica
Thank you Aanjan and Veronica its working now. Earlier, I was missing on port 80 in the URL keeping in mind its a default port and is not required explicitly. After using URL with port 80, it connects. Regards, Dimple |