Skip to main content
1-Visitor
September 5, 2018
Solved

ERROR Connecting WS EMS on Raspberry Pi

  • September 5, 2018
  • 1 reply
  • 2607 views

Hi,

i want to install the WS EMS on my Raspberry Pi.

 

When I execute wsems, following error occurs:

~/microserver % sudo ./wsems
[FORCE] 2018-09-05 08:51:01,119 ./wsems: Initializing EMS ....
[FORCE] 2018-09-05 08:51:01,119 main: Using config file /home/nexiles/microserver/etc/config.json
[WARN ] 2018-09-05 08:51:01,120 Main: Authentication is disabled on the HTTP Server.
[FORCE] 2018-09-05 08:51:01,120 httpServer: starting http server port=8000
[WARN ] 2018-09-05 08:51:01,123 SDK: SDK Version: 2.1.2
[WARN ] 2018-09-05 08:51:01,123 SDK: TLS Library: OpenSSL
[WARN ] 2018-09-05 08:51:01,123 SDK: TLS Library Version: 1.0.2l-fips
[WARN ] 2018-09-05 08:51:01,123 SDK: FIPS Capable
[WARN ] 2018-09-05 08:51:01,143 WsProxy::initialize: Certificate validation is disabled.
[WARN ] 2018-09-05 08:51:01,143 WsProxy::initialize: Self signed certificates are enabled.
[ERROR] 2018-09-05 08:51:01,146 SDK: twMap_Add: parse function returned null.

192.168.100.164:443-->[ERROR] 2018-09-05 08:51:01,150 SDK: twStream_Delete: NULL Pointer passed in
[ERROR] 2018-09-05 08:51:11,152 SDK: twWs_Connect: Error trying to connect
[ERROR] 2018-09-05 08:51:11,152 SDK: twStream_Delete: NULL Pointer passed in
[ERROR] 2018-09-05 08:51:16,154 SDK: twStream_Delete: NULL Pointer passed in
[ERROR] 2018-09-05 08:51:26,155 SDK: twWs_Connect: Error trying to connect
[ERROR] 2018-09-05 08:51:26,155 SDK: twStream_Delete: NULL Pointer passed in
[ERROR] 2018-09-05 08:51:31,156 SDK: twStream_Delete: NULL Pointer passed in
[ERROR] 2018-09-05 08:51:41,158 SDK: twWs_Connect: Error trying to connect
[ERROR] 2018-09-05 08:51:41,158 SDK: twStream_Delete: NULL Pointer passed in
[ERROR] 2018-09-05 08:51:46,160 SDK: twStream_Delete: NULL Pointer passed in
[ERROR] 2018-09-05 08:51:56,162 SDK: twWs_Connect: Error trying to connect
[ERROR] 2018-09-05 08:51:56,163 SDK: twStream_Delete: NULL Pointer passed in
[WARN ] 2018-09-05 08:52:01,166 Main: Unable to connect to server. Trying .booted config file
[WARN ] 2018-09-05 08:52:01,167 WsEmsProxy::execute() : Server connection failed. Error Code: 201
[FORCE] 2018-09-05 08:52:06,180 Main: Shutdown signal received. Restarting ....
[WARN ] 2018-09-05 08:52:16,209 SDK: sendCtlFrame: Not connected
[WARN ] 2018-09-05 08:52:16,210 SDK: msgHandlerOnClose: WEBSOCKET CLOSED
[WARN ] 2018-09-05 08:52:16,211 SDK: sendCtlFrame: Not connected
[FORCE] 2018-09-05 08:52:16,213 ./wsems: Initializing EMS ....
[FORCE] 2018-09-05 08:52:16,214 main: Using config file /home/nexiles/microserver/etc/config.json.booted
[WARN ] 2018-09-05 08:52:16,215 Main: Authentication is disabled on the HTTP Server.
[FORCE] 2018-09-05 08:52:16,216 httpServer: starting http server port=8000
[WARN ] 2018-09-05 08:52:16,219: SDK Version: 2.1.2
[WARN ] 2018-09-05 08:52:16,219: TLS Library: OpenSSL
[WARN ] 2018-09-05 08:52:16,219: TLS Library Version: 1.0.2l-fips
[WARN ] 2018-09-05 08:52:16,219: FIPS Capable
[WARN ] 2018-09-05 08:52:16,223 WsProxy::initialize: Certificate validation is disabled.
[WARN ] 2018-09-05 08:52:16,223 WsProxy::initialize: Self signed certificates are enabled.
[ERROR] 2018-09-05 08:52:16,225: twMap_Add: parse function returned null.

192.168.100.164:443-->[ERROR] 2018-09-05 08:52:16,228: twStream_Delete: NULL Pointer passed in

 

This is my config file:

{
 "ws_servers": [{
 "host": "192.168.100.164",
 "port": 443
 }],
 "appKey": "********-****-****-****-************",
 "http_server": {
 "use_default_certificate" : true,
 "ssl" : true,
 "authenticate" : false
 },

 "certificates": {
 "validate": false,
 "allow_self_signed": true
 },

 "ws_connection": {
 "encryption": "none",
 "verbose": false
 }
}

Does anyone know how i could fix this problem?

Thanks!

This topic has been closed for replies.
Best answer by Rick-Stanley

You are required to have a logger config section:

 

 "logger": {
"level":"DEBUG"
},

I was able to reproduce the :

[ERROR] 2018-09-05 13:08:40,458 SDK: twMap_Add: parse function returned null.


when I removed the logger configuration. You can set to INFO if you want less output

1 reply

5-Regular Member
September 5, 2018

The http_server section of the EMS config file is for the local server that the EMS starts - not the EMS connection to the ThingWorx Server.

 

The ws_connection section controls the EMS connection to the ThingWorx server. Try this:

 

"http_server": {

    "ssl": false,
    "authenticate": false
},

"ws_connection": {
    "encryption": "ssl"
}

 

Julien_1-VisitorAuthor
1-Visitor
September 5, 2018

Thanks for your reply.

Unfortunately I still get an error:

sudo ./wsems :( [FORCE] 2018-09-05 13:08:40,430 ./wsems: Initializing EMS ....
[FORCE] 2018-09-05 13:08:40,430 main: Using config file /home/nexiles/microserver/etc/config.json
[WARN ] 2018-09-05 13:08:40,431 Main: Encryption is disabled on HTTP Server.
[WARN ] 2018-09-05 13:08:40,431 Main: Authentication is disabled on the HTTP Server.
[FORCE] 2018-09-05 13:08:40,432 httpServer: starting http server port=8000
[WARN ] 2018-09-05 13:08:40,435 SDK: SDK Version: 2.1.2
[WARN ] 2018-09-05 13:08:40,435 SDK: TLS Library: OpenSSL
[WARN ] 2018-09-05 13:08:40,435 SDK: TLS Library Version: 1.0.2l-fips
[WARN ] 2018-09-05 13:08:40,435 SDK: FIPS Capable
[WARN ] 2018-09-05 13:08:40,455 WsProxy::initialize: Certificate validation is disabled.
[WARN ] 2018-09-05 13:08:40,456 WsProxy::initialize: Self signed certificates are enabled.
[ERROR] 2018-09-05 13:08:40,458 SDK: twMap_Add: parse function returned null.

192.168.100.164:443-->[ERROR] 2018-09-05 13:08:40,461 SDK: twStream_Delete: NULL Pointer passed in
[WARN ] 2018-09-05 13:08:40,561 SDK: api:sendMessageBlocking: AUTH Message 1 failed. Code:129
[WARN ] 2018-09-05 13:08:45,561 SDK: twWs_Connect: Already connected
[WARN ] 2018-09-05 13:08:45,562 SDK: twWs_Receive: Websocket closed!
[WARN ] 2018-09-05 13:08:45,562 SDK: msgHandlerOnClose: WEBSOCKET CLOSED
[WARN ] 2018-09-05 13:08:45,563 SDK: api:sendMessageBlocking: Receive failed.
[WARN ] 2018-09-05 13:08:45,563 SDK: api:sendMessageBlocking: Message 2 timed out
[ERROR] 2018-09-05 13:08:50,564 SDK: twStream_Delete: NULL Pointer passed in
[WARN ] 2018-09-05 13:08:50,673 SDK: api:sendMessageBlocking: AUTH Message 3 failed. Code:129

My config file:

{
 "ws_servers": [{
 "host": "192.168.100.164",
 "port": 443
 }],
 "appKey": "d9c999e1-c645-4e25-9f77-d3d49cfeb2c1",
 "http_server": {
 "ssl" : false,
 "authenticate" : false
 },

 "certificates": {
 "validate": false,
 "allow_self_signed": true
 },

 "ws_connection": {
 "encryption": "ssl"
 }
}

 What am I doing wrong?

5-Regular Member
September 5, 2018

You are required to have a logger config section:

 

 "logger": {
"level":"DEBUG"
},

I was able to reproduce the :

[ERROR] 2018-09-05 13:08:40,458 SDK: twMap_Add: parse function returned null.


when I removed the logger configuration. You can set to INFO if you want less output