cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Azure IoT Hub Connector Error

nnylund
1-Visitor

Azure IoT Hub Connector Error

Hello,

I have been trying to install the Azure IoT Hub Connector by following these instruction: PTC

I managed to get it to install the templates and shapes and then headed home for the day.

The next time I got to work I was not able to start the server..! It keeps giving me the following errors:

I tried doing it from a "fresh" computer to no avail, does anyone know what is the problem here ???

13:51:50.247 [main] INFO  c.t.f.i.AbstractManyPlatformWebSocketFabric - Many Platform WebSocket Fabric enabled without service discovery: endpoints=[ws://localhost:8080/Thingworx/WS]

13:51:50.264 [main] INFO  c.t.s.i.transport.MuxingBytesChannel - Subchannel ws://localhost:8080/Thingworx/WS-1 in channel ws://localhost:8080/Thingworx/WS was no longer valid - unregistering it

13:51:50.264 [main] INFO  c.t.s.i.transport.MuxingBytesChannel - Subchannel ws://localhost:8080/Thingworx/WS-2 in channel ws://localhost:8080/Thingworx/WS was no longer valid - unregistering it

13:51:50.264 [main] INFO  c.t.s.i.transport.MuxingBytesChannel - Subchannel ws://localhost:8080/Thingworx/WS-3 in channel ws://localhost:8080/Thingworx/WS was no longer valid - unregistering it

13:51:50.264 [main] INFO  c.t.s.i.transport.MuxingBytesChannel - Subchannel ws://localhost:8080/Thingworx/WS-4 in channel ws://localhost:8080/Thingworx/WS was no longer valid - unregistering it

13:51:50.264 [main] INFO  c.t.s.i.transport.MuxingBytesChannel - Subchannel ws://localhost:8080/Thingworx/WS-5 in channel ws://localhost:8080/Thingworx/WS was no longer valid - unregistering it

13:51:50.265 [main] INFO  c.t.s.i.transport.MuxingBytesChannel - Needed to reconnect subchannels on client endpoint [id: ws://localhost:8080/Thingworx/WS] : [active: 0, max: 5]

13:51:50.319 [main] INFO  c.t.connectionserver.PlatformImpl - Starting ConnectionServer: UUID= *removed*, Platform protocol=V1, Platform transport=WEBSOCKETS

13:51:50.319 [main] INFO  c.t.connectionserver.PlatformImpl - Waiting for connection to platform...

13:51:51.398 [NettyClient-NIO-5] ERROR c.t.s.i.t.netty.NettyBytesChannel - Error while establishing websocket connection on channel com.thingworx.sdk.impl.transport.netty.NettyBytesChannel$2@11b13f74.

java.net.ConnectException: Connection refused: no further information: localhost/127.0.0.1:8080

        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)

        at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)

        at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:224)

        at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:289)

        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:528)

        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)

        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)

        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)

        at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)

        at java.lang.Thread.run(Unknown Source)

3 REPLIES 3
sharmon
13-Aquamarine
(To:nnylund)

What's the URL to your ThingWorx instance?

Would you post the contents of your azure-iot.conf file, with keys deleted or obfuscated, please?

My hypothesis is that we need to look at the ThingWorx URL in your configuration file.

nnylund
1-Visitor
(To:sharmon)

In your opinion, what could be wrong with the URL ? Unfortunately I cannot share it..

Appreciate your help Stephen.

sharmon
13-Aquamarine
(To:nnylund)

I was going to provide some general advice about constructing web socket URLs, but this error jumped out at me:

13:51:51.398 [NettyClient-NIO-5] ERROR c.t.s.i.t.netty.NettyBytesChannel - Error while establishing

websocket connection on channel com.thingworx.sdk.impl.transport.netty.NettyBytesChannel$2@11b13f74.

java.net.ConnectException: Connection refused: no further information: localhost/127.0.0.1:8080

Your Azure IoT Hub Connector is making an attempt to connect to localhost. This can happen if the AZURE_IOT_OPTS environment variable is not set. When this happens, the Azure IoT Hub Connector uses default values, rather than the ones you specified in azure-iot.conf.

On Windows, you make AZURE_IOT_OPTS an environment variable, or SET it in your session. On Linux, you make it one of your exports. If I'm setting up a prod instance where things will be stable, I make it a permanent environment variable. On my local Windows machine, I create a cmd script that sets it right before running the hub:

set AZURE_IOT_OPTS=-Dconfig.file=C:\Thingworx-Azure-IoT-Hub-Connector-2.0.0.141\connector\conf\azure-iot.conf

  -Dlogback.configurationFile=C:\ThingWorx-Azure-IoT-Connector-2.0.0.141\connector\conf\logback.xml

azure-iot.bat

There's more information on setting the environment variable in ThingWorx Azure IoT Hub Connector Installation and Operations Guide v2.0. ​I hope this helps.

Announcements


Top Tags