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

ERROR Connecting WS EMS on Raspberry Pi

Level 5

ERROR Connecting WS EMS on Raspberry Pi

Hi, I have problems when executing wsems, any help will be appreciated.

my config.json file is below

{
"ws_servers": [{ "host": "192.168.1.241", "port": 443 }], "http_server": { "host": "127.0.0.1", "port": 8080,
"ssl": false,
"authenticate": false }, "appKey": "96d6b33a-33c7-41c9-bda2-53416afa9876", "logger": { "level": "DEBUG" }, "auto_bind": [{ "name": "PiThing", "gateway": false }], "certificates": { "validate": false, "allow_self_signed":true }, "ws_connection": { "encryption": "ssl", "verbose": true, "msg_timeout": 1000 } }

 

this is the error i received

[FORCE] 2019-01-10 13:35:19,976 ./wsems: Initializing EMS ....
[FORCE] 2019-01-10 13:35:19,976 main: Using config file /home/pi/microserver/etc/config.json
[INFO ] 2019-01-10 13:35:19,976 ./wsems: Creating the WsEms proxy.
[INFO ] 2019-01-10 13:35:19,977 ./wsems: Starting HTTP Server.
[INFO ] 2019-01-10 13:35:19,977 Main: Using custom certificate and private key for HTTP Server
[WARN ] 2019-01-10 13:35:19,977 Main: Encryption is disabled on HTTP Server.
[WARN ] 2019-01-10 13:35:19,977 Main: Authentication is disabled on the HTTP Server.
[FORCE] 2019-01-10 13:35:19,977 httpServer: starting http server port=8080
[INFO ] 2019-01-10 13:35:19,977 ./wsems: Initializing the ThingWorx REST interface.
[INFO ] 2019-01-10 13:35:19,978 wsEmsProxy::initialize: FIPS is disabled.
[DEBUG] 2019-01-10 13:35:19,978 httpServer: http server bound to port=8080.
[INFO ] 2019-01-10 13:35:19,978 wsEmsProxy::initialize: Encryption is enabled on Web Socket connection.
[WARN ] 2019-01-10 13:35:19,979 SDK: SDK Version: 2.0.4
[WARN ] 2019-01-10 13:35:19,980 SDK: TLS Library: OpenSSL
[WARN ] 2019-01-10 13:35:19,980 SDK: TLS Library Version: 1.0.2l
[WARN ] 2019-01-10 13:35:19,980 SDK: FIPS Capable
[DEBUG] 2019-01-10 13:35:19,980 SDK: twWs_Create: Initializing Websocket Client for 192.168.1.241:443//Thingworx/WS
[DEBUG] 2019-01-10 13:35:19,980 SDK: twTlsClient_Create: Initializing TLS Client
[DEBUG] 2019-01-10 13:35:19,995 SDK: twApi_Initialize: Websocket Established after 0 tries
[DEBUG] 2019-01-10 13:35:19,995 SDK: subscribedPropsMgr_Initialize: Initializing subscribed properties manager
[INFO ] 2019-01-10 13:35:19,995 WsProxy::initialize: EMS Version 5.4.0.114
[INFO ] 2019-01-10 13:35:19,995 WsProxy::initialize: twApi singleton initialized
[WARN ] 2019-01-10 13:35:19,995 WsProxy::initialize: Certificate validation is disabled.
[WARN ] 2019-01-10 13:35:19,995 WsProxy::initialize: Self signed certificates are enabled.
[DEBUG] 2019-01-10 13:35:19,995 jsonConfigurator::getJsonEntity: Key validation_criteria not found
[DEBUG] 2019-01-10 13:35:19,996 jsonConfigurator::getJsonEntity: Parent file not found
[DEBUG] 2019-01-10 13:35:19,997 SDK: twTunnelManager_Create: Tunnel Manager singleton already exists
[ERROR] 2019-01-10 13:35:19,997 SDK: twMap_Add: parse function returned null.
[DEBUG] 2019-01-10 13:35:19,997 WsEmsProxy::bindThing: Host specified as 'localhost'. Testing IPV6/IPV4 connectivity
[WARN ] 2019-01-10 13:35:20,0 WsEmsProxy::bindThing: Exception connecting to localhost:8001. Err: Connection refused [localhost:8001]
[WARN ] 2019-01-10 13:35:20,1 WsEmsProxy::bindThing: Changing host from 'localhost' to '127.0.0.1'
[DEBUG] 2019-01-10 13:35:20,1 SDK: added PiThing to boundList
[DEBUG] 2019-01-10 13:35:20,1 SDK: twApi_BindThings: not currently connected, only binding things to api
[DEBUG] 2019-01-10 13:35:20,1 SDK: twMessage_Delete: Deleting BIND Message: 1
[DEBUG] 2019-01-10 13:35:20,1 jsonConfigurator::getJsonEntity: Parent file not found
[INFO ] 2019-01-10 13:35:20,1 wsEmsProxy::initialize: Initialization complete!
[INFO ] 2019-01-10 13:35:20,3 ./wsems: Starting the connection.

192.168.1.241:443-->[DEBUG] 2019-01-10 13:35:20,6 SDK: twTlsClient_Reconnect: Re-establishing SSL context
[DEBUG] 2019-01-10 13:35:20,6 SDK: twTlsClient_Connect: Connecting to server
[DEBUG] 2019-01-10 13:35:20,50 SDK: twTlsClient_Connect: TLS connection established
[ERROR] 2019-01-10 13:35:20,57 SDK: twWs_Connect: Error initializing web socket. Response code: 404
[DEBUG] 2019-01-10 13:35:25,57 SDK: twTlsClient_Reconnect: Re-establishing SSL context
[DEBUG] 2019-01-10 13:35:25,58 SDK: twTlsClient_Connect: Connecting to server
[DEBUG] 2019-01-10 13:35:25,143 SDK: twTlsClient_Connect: TLS connection established
[ERROR] 2019-01-10 13:35:25,157 SDK: twWs_Connect: Error initializing web socket. Response code: 404
[DEBUG] 2019-01-10 13:35:30,158 SDK: twTlsClient_Reconnect: Re-establishing SSL context
[DEBUG] 2019-01-10 13:35:30,158 SDK: twTlsClient_Connect: Connecting to server
[DEBUG] 2019-01-10 13:35:30,242 SDK: twTlsClient_Connect: TLS connection established
[ERROR] 2019-01-10 13:35:30,256 SDK: twWs_Connect: Error initializing web socket. Response code: 404

3 REPLIES

Re: ERROR Connecting WS EMS on Raspberry Pi

Couple of things to check -

1.) Check the validity of the Application Key - if expiration is a future date

2.) Check is the user associated with the Application key is the default 'Administrator' user

 

 

Re: ERROR Connecting WS EMS on Raspberry Pi

changed the user to Administrator , still did not work though.

Re: ERROR Connecting WS EMS on Raspberry Pi

Hi @dw22.

 

After making the change, are you still getting the same error?

 

Regards.

 

--Sharon