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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Errors while trying to connect raspberrypi to thingworx cloud

mkk
1-Visitor
1-Visitor

Errors while trying to connect raspberrypi to thingworx cloud

am a beginner to thingworx cloud, i followed the quick start step by step guide to connect raspberrypi ,when i executed

sudo ./wsems

[INFO ] 2016-11-23 12:17:49,846 ./wsems: Using config file: /home/pi/microserver/etc/config.json

[FORCE] 2016-11-23 12:17:49,846 ./wsems: Starting up ....

[FORCE] 2016-11-23 12:17:49,846 ./wsems: Initializing EMS ....

[FORCE] 2016-11-23 12:17:49,846 main: Using config file /home/pi/microserver/etc/config.json

[INFO ] 2016-11-23 12:17:49,846 ./wsems: Creating the WsEms proxy.

[INFO ] 2016-11-23 12:17:49,846 ./wsems: Starting HTTP Server.

[INFO ] 2016-11-23 12:17:49,847 ./wsems: Initializing the ThingWorx REST interface.

[FORCE] 2016-11-23 12:17:49,847 httpServer: starting http server port=8080

[DEBUG] 2016-11-23 12:17:49,847 SDK: Server socket error: Address already in use [127.0.0.1:8080]

[ERROR] 2016-11-23 12:17:49,847 httpserver: Server socket error: Address already in use [127.0.0.1:8080]

[DEBUG] 2016-11-23 12:17:49,848 SDK: twTlsClient_Create: Initializing TL8080, trying next port.

[ERROR] 2016-11-23 12:17:49,848 httpServer: twTlsClient_Create: Initializing TL8080, trying next port.

[ERROR] 2016-11-23 12:17:49,848 httpserver: Server socket error: Address already in use [127.0.0.1:8081]

[ERROR] 2016-11-23 12:17:49,848 httpServer: unable to bind http server to port=8081, trying next port.

[ERROR] 2016-11-23 12:17:49,848 httpserver: Server socket error: Address already in use [127.0.0.1:8082]

[ERROR] 2016-11-23 12:17:49,848 httpServer: unable to bind http server to port=8082, trying next port.

[DEBUG] 2016-11-23 12:17:49,848 SDK: twApi_Initialize: Websocket Established after 0 tries

[ERROR] 2016-11-23 12:17:49,848 httpserver: Server socket error: Address already in use [127.0.0.1:8083]

[ERROR] 2016-11-23 12:17:49,848 httpServer: unable to bind http server to port=8083, trying next port.

[DEBUG] 2016-11-23 12:17:49,849 SDK: subscribedPropsMgr_Initialize: Initializing subscribed properties manager

[ERROR] 2016-11-23 12:17:49,849 httpserver: Server socket error: Address already in use [127.0.0.1:8084]

[ERROR] 2016-11-23 12:17:49,849 httpServer: unable to bind http server to port=8084, trying next port.

[DEBUG] 2016-11-23 12:17:49,849 jsonConfigurator::getJsonEntity:

[ERROR] 2016-11-23 12:17:49,849 httpserver: Server socket error: Address already in use [127.0.0.1:8085]

[ERROR] 2016-11-23 12:17:49,850 httpServer: unable to bind http ser not found

[DEBUG] 2016-11-23 12:17:49,850 jsonConfigurator::getJsonEntity: unable to bind http ser not found

52.199.115.146:80-->[ERROR] 2016-11-23 12:17:49,850 httpserver: Server socket error: Address already in use [127.0.0.1:8086]

[ERROR] 2016-11-23 12:17:49,850 httpServer: unable to bind http server to port=8086, trying next port.

[ERROR] 2016-11-23 12:17:49,850 httpserver: Server socket error: Address already in use [127.0.0.1:8087]

[ERROR] 2016-11-23 12:17:49,851 httpServer: unable to bind http server to port=8087, trying next port.

[ERROR] 2016-11-23 12:17:49,851 httpserver: Server socket error: Address already in use [127.0.0.1:8088]

[ERROR] 2016-11-23 12:17:49,851 httpServer: unable to bind http server to port=8088, trying next port.

[DEBUG] 2016-11-23 12:17:49,851 httpServer: http server bound to port=8089.

[DEBUG] 2016-11-23 12:17:49,851 jsonConfigurator::getJsonEntity: Parent file not found

[DEBUG] 2016-11-23 12:17:49,852 jsonConfigurator::getJsonEntity: Parent file not found

[INFO ] 2016-11-23 12:17:49,852 wsEmsProxy::initialize: Initialization complete!

[INFO ] 2016-11-23 12:17:49,852 ./wsems: Starting the connection.

[DEBUG] 2016-11-23 12:17:49,852 SDK: twTlsClient_Reconnect: Re-establishing SSL context

[DEBUG] 2016-11-23 12:17:49,852 SDK: twTlsClient_Connect: Connecting to server

[DEBUG] 2016-11-23 12:17:50,103 SDK: ws_on_headers_complete: Websocket connected!

[AUDIT] 2016-11-23 12:17:50,103 SDK: twWs_Connect: Websocket connected!

[DEBUG] 2016-11-23 12:17:50,103 SDK: twWs_SendMessage: Sent 60 bytes using 1 frames.

[DEBUG] 2016-11-23 12:17:50,395 SDK: twMessage_Delete:  Deleting RESPONSE Message: 1

[DEBUG] 2016-11-23 12:17:50,395 SDK: twMessage_Delete:  Deleting AUTH Message: 1

[DEBUG] 2016-11-23 12:17:50,395 SDK: twWs_SendMessage: Sent 26 bytes using 1 frames.

[DEBUG] 2016-11-23 12:17:50,400 SDK: sendCtlFrame: >>>>> Sending Ping. Msg: 06:47:50

[INFO ] 2016-11-23 12:17:50,401 Main: Succesfully connected.  Saving .booted config file

[DEBUG] 2016-11-23 12:17:50,697 SDK: twMessage_Delete:  Deleting RESPONSE Message: 2

[DEBUG] 2016-11-23 12:17:50,697 SDK: twMessage_Delete:  Deleting BIND Message: 2

[DEBUG] 2016-11-23 12:18:45,416 SDK: sendCtlFrame: >>>>> Sending Ping. Msg: 06:48:45

Here i get the proper output as websocket created and successfully connected as requested in the guide

but after following further steps and executing luaScriptResource i get error while creating new handler as follows

pi@rooman:~/microserver $ sudo ./luaScriptResource

[INFO ] 2016-11-23 12:18:20,139 ./luaScriptResource: Using config file: /home/pi/microserver/etc/config.lua

[FORCE] 2016-11-23 12:18:20,140 ./luaScriptResource: Starting up ....

[INFO ] 2016-11-23 12:18:20,145 ./luaScriptResource: New path is /home/pi/microserver/etc/thingworx/clibs:/home/pi/microserver/etc/custom/clibs:/home/pi/microserver/etc/community/clibs:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

[FORCE] 2016-11-23 12:18:20,184 httpServer: starting http server port=8001

[ERROR] 2016-11-23 12:18:20,194 httpserver: Server socket error: Address already in use [*:8001]

[ERROR] 2016-11-23 12:18:20,194 httpServer: unable to bind http server to port=8001, trying next port.

[ERROR] 2016-11-23 12:18:20,195 httpServer: unable to bind http server to any port from 8001 to 8001.

[INFO ] 2016-11-23 12:18:20,265 thingworx.shape: Creating a new shape.

[INFO ] 2016-11-23 12:18:20,266 PiThing: -- Configuration -------------------------------

[INFO ] 2016-11-23 12:18:20,267 PiThing: scanRate: 60000

[INFO ] 2016-11-23 12:18:20,267 PiThing: scanRateResolution: 500

[INFO ] 2016-11-23 12:18:20,268 PiThing: taskRate: 15000

[INFO ] 2016-11-23 12:18:20,268 PiThing: keepAliveRate: 60000

[INFO ] 2016-11-23 12:18:20,269 PiThing: requestTimeout: 15000

[INFO ] 2016-11-23 12:18:20,269 PiThing: registerRate: 43200000

[INFO ] 2016-11-23 12:18:20,270 PiThing: register: true

[INFO ] 2016-11-23 12:18:20,270 PiThing: getPropertySubscriptionOnReconnect: false

[INFO ] 2016-11-23 12:18:20,271 PiThing: maxConcurrentPropertyUpdates: 100

[INFO ] 2016-11-23 12:18:20,272 PiThing: defaultPushType: VALUE

[INFO ] 2016-11-23 12:18:20,272 PiThing: useShapes: true

[INFO ] 2016-11-23 12:18:20,273 PiThing: identifier: Not Specififed

[INFO ] 2016-11-23 12:18:20,273 PiThing: ------------------------------------------------

[INFO ] 2016-11-23 12:18:20,283 thingworx.template: Adding shape 'shapes.metadata' to template 'thingworx.template'

[INFO ] 2016-11-23 12:18:20,283 thingworx.template: Adding shape 'shapes.propsubscribe' to template 'thingworx.template'

[INFO ] 2016-11-23 12:18:20,283 thingworx.template: Creating new templates.PiTemplate named 'PiThing'

[INFO ] 2016-11-23 12:18:20,283 PiThing: -- Initializing properties ---------------------

[INFO ] 2016-11-23 12:18:20,283 PiThing: Initialized property upToDate [baseType: BOOLEAN, pushType: NEVER, handler: nil, value: true]

[INFO ] 2016-11-23 12:18:20,283 PiThing: Initialized property cpu_volt [baseType: NUMBER, pushType: ALWAYS, handler: nil, value: 0]

[INFO ] 2016-11-23 12:18:20,283 PiThing: Initialized property cpu_temperature [baseType: NUMBER, pushType: ALWAYS, handler: nil, value: 0]

[INFO ] 2016-11-23 12:18:20,284 PiThing: Initialized property cpu_freq [baseType: NUMBER, pushType: ALWAYS, handler: nil, value: 0]

[INFO ] 2016-11-23 12:18:20,284 PiThing: ------------------------------------------------

[INFO ] 2016-11-23 12:18:22,251 PiThing: -- Starting script --------------------------

[INFO ] 2016-11-23 12:18:22,251 PiThing: Registering core callback handler

[INFO ] 2016-11-23 12:18:22,251 PiThing: Starting main loop

[INFO ] 2016-11-23 12:18:22,251 PiThing: Calling lifecycle start listeners.

[INFO ] 2016-11-23 12:18:22,251 shapes.propsubscribe: Initialized

[INFO ] 2016-11-23 12:18:22,253 thingworx.handler: Creating a new handler.

[ERROR] 2016-11-23 12:18:52,259 HttpClient::processReq: Timeout while waiting for response from 127.0.0.1.

[ERROR] 2016-11-23 12:18:52,259 luaBindings::httpPost: Error POSTing to HTTP Server at 127.0.0.1/Thingworx/Things/LocalEms/Services/AddEdgeThing

[INFO ] 2016-11-23 12:18:52,260 PiThing: Error occured while accessing EMS. Checking isConnected.

[ERROR] 2016-11-23 12:19:22,265 HttpClient::processReq: Timeout while waiting for response from 127.0.0.1.

[ERROR] 2016-11-23 12:19:22,265 luaBindings::httpGet: Error GETing from HTTP server at 127.0.0.1/Thingworx/Things/LocalEms/Properties/isConnected

[INFO ] 2016-11-23 12:19:22,265 PiThing: EMS is available: false, online: false

[ERROR] 2016-11-23 12:19:52,791 HttpClient::processReq: Timeout while waiting for response from 127.0.0.1.

[ERROR] 2016-11-23 12:19:52,791 luaBindings::httpPost: Error POSTing to HTTP Server at 127.0.0.1/Thingworx/Things/LocalEms/Services/AddEdgeThing

[INFO ] 2016-11-23 12:19:52,791 PiThing: Error occured while accessing EMS. Checking isConnected.

[ERROR] 2016-11-23 12:20:22,796 HttpClient::processReq: Timeout while waiting for response from 127.0.0.1.

[ERROR] 2016-11-23 12:20:22,796 luaBindings::httpGet: Error GETing from HTTP server at 127.0.0.1/Thingworx/Things/LocalEms/Properties/isConnected

[INFO ] 2016-11-23 12:20:22,796 PiThing: EMS is available: false, online: false

kindly help me to rectify this issue

ACCEPTED SOLUTION

Accepted Solutions
ttielebein
14-Alexandrite
(To:mkk)

[ERROR] 2016-11-23 12:17:49,849 httpserver: Server socket error: Address already in use [127.0.0.1:8085]


Looks like you need to change the port your EMS is running on... something else on localhost is running on port 8085, according to the above error.

View solution in original post

7 REPLIES 7
ttielebein
14-Alexandrite
(To:mkk)

[ERROR] 2016-11-23 12:17:49,849 httpserver: Server socket error: Address already in use [127.0.0.1:8085]


Looks like you need to change the port your EMS is running on... something else on localhost is running on port 8085, according to the above error.

mkk
1-Visitor
1-Visitor
(To:ttielebein)

Thank you for your time.

I changed the port and tried and it worked,Thank you

Now i can see my device is connected in  composer.but when i bind the thing properties on manage bindings its not loading the properties.its shows

"Error browsing properties. Be sure the remote device/server is connected and configured properly"

But in properties i can see

Isconnected value as true and lastconnection value as  time

can you kindly help me on this too?


ttielebein
14-Alexandrite
(To:mkk)

Are you using the LSR? Is this running on localhost also? Is it configured properly?

mkk
1-Visitor
1-Visitor
(To:ttielebein)

Yes am using LSR,it was not running on local host,but after changing port as u suggested it got connected to the composer and even it shows the time of connection but in binding properties it doesn't show the properties list.

"Error browsing properties. Be sure the remote device/server is connected and configured properly"

ttielebein
14-Alexandrite
(To:mkk)

If the EMS and LSR are on different hosts, then you need to configure the rap_host and rap_port in the http_server header. See this blog post​​ and let me know if you have any further questions.

mkk
1-Visitor
1-Visitor
(To:ttielebein)

But actually am using same host for both EMS and LSR

Host:127.0.0.5

port:8088

and i get connection successful.

ttielebein
14-Alexandrite
(To:mkk)

Are there any errors appearing in the output from the LSR?

Announcements


Top Tags