5 Replies Latest reply on May 31, 2017 9:25 AM by aricci Branched to a new discussion. RSS
    emericboyu Explorer

    Connecting Raspberry Pi to a private Thingworx Server

    Hello everyone,

    I'm trying to connect my Raspberry Pi to a private server of Thingworx. The server's address starts with http and continues with the IP adress of the server (ex: http://192.xxx.xx.xx/Thingworx/Composer/index.html). I followed Raspberry Pi Quickstart guide (https://developer.thingworx.com/resources/guides/thingworx-raspberry-pi-quickstart) and I managed to build a connection between my RasPi and academic cloud of Thingworx by establishing and configuring the Edge Micro Server (EMS). When I tried to adapt this solution to my case I got the ERROR: Error initializing socket connection. Er = 113.  I'm not sure if i defined port and protocol wrong. I also use static IP for my RasPi since the Wifi I use is private and doesn't allow access to internet.

    Thank you for your attention,

    Emre

      • Re: Connecting Raspberry Pi to a private Thingworx Server
        aricci Newbie

        I am having a similar issue however I am able to connect unsecured just fine.  I am trying to enable SSL via port 8443 and have been having issues.  I have tried other devices (browser, etc) and can connect to composer in a secured fashion using 8443 however no luck with the PI.

         

        I have tried a number of different options for the certificates.  My end goal is to have the pi use client authenticataion via 8443 but I need to be able to connect via 8443 first.

         

        This is my config.json:

         

        {
        "ws_servers": [{
           "host": "XX.XX.XX.XX",
           "port": 8443
          }],
         
        "appKey": "XXXXXXXXX",

         

        "certificates": {

          "cert_chain": [ "/home/pi/keystore/CARoot.cer" ],

                        "allow_self_signed": true

        },


        "http_server":  {
          "host": "127.0.0.1",
          "port": 9080
        },
             "logger":   {
                 "level":    "TRACE"
             },
             "auto_bind":    [{
                     "name": "RedPi",
                     "gateway":  false
                 }],
             "certificates": {
                 "validate": false,
                 "allow_self_signed":    true
             },
             "ws_connection":    {
                 "encryption":   "none",
                 "verbose":  true,
                 "msg_timeout":  1000
              }
        }

          • Re: Connecting Raspberry Pi to a private Thingworx Server
            billrei Creator

            Lets start by eliminating a cipher suite mismatch. Add the following to your tomcat configuration:

             

            Add the following cipher suites in server.xml and restart the tomcat.

            <Connector port="8443"
                       protocol="org.apache.coyote.http11.Http11NioProtocol"
                       acceptorThreadCount="2"
                       maxThreads="1000"
                       socket.txBufSize="24576"
                       scheme="https"
                       secure="true"
                       SSLEnabled="true"
                       keystoreFile="keystore.jks"
                       keystorePass="password"
                       clientAuth= "false"
                       sslProtocols = "TLSv1,TLSv1.1,TLSv1.2"
                       ciphers="TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA256,TLS_RSA_WITH_AES_256_CBC_SHA,SSL_RSA_WITH_RC4_128_SHA"  />

             

            Then let me know if you can connect.

              • Re: Connecting Raspberry Pi to a private Thingworx Server
                aricci Newbie

                Hey Bill,

                 

                I tried your suggestion. however still having an issue.  I disabled port 8080

                 

                (1) Raspberry Pi config:

                 

                {

                "ws_servers": [{
                   "host": "192.168.20.37",
                   "port": 8443
                  }],
                 
                "appKey": "f109ecb5-9e2b-4215-8d3f-6479d5d6b9c1",

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

                "http_server":  {
                  "host": "127.0.0.1",
                  "port": 9080
                },
                     "logger":   {
                         "level":    "TRACE"
                     },
                     "auto_bind":    [{
                             "name": "RedPi",
                             "gateway":  false
                         }],
                     "certificates": {
                         "validate": false,
                         "allow_self_signed":    true
                     },
                     "ws_connection":    {
                         "encryption":   "none",
                         "verbose":  true,
                         "msg_timeout":  1000
                      }
                }

                 

                (2) Server.xml based on your suggestion:

                 

                  

                   <Connector port="8443"

                           protocol="org.apache.coyote.http11.Http11NioProtocol"

                           acceptorThreadCount="2"

                           maxThreads="1000"

                           socket.txBufSize="24576"

                           scheme="https"

                           secure="true"

                           SSLEnabled="true"

                           keystoreFile="conf/tomcat.keystore"

                           keystorePass="XXXXXXX"

                           clientAuth= "false"

                           sslProtocols = "TLSv1,TLSv1.1,TLSv1.2"

                           ciphers="TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA256,TLS_RSA_WITH_AES_256_CBC_SHA,SSL_RSA_WITH_RC4_128_SHA"  />

                 

                Log from PI:

                 

                pi@piRed:~/ems/microserver $ sudo ./wsems
                [INFO ] 2017-05-30 15:30:32,346 ./wsems: Using config file: /home/pi/ems/microserver                                /etc/config.json
                [FORCE] 2017-05-30 15:30:32,347 ./wsems: Starting up ....
                [FORCE] 2017-05-30 15:30:32,348 ./wsems: Initializing EMS ....
                [FORCE] 2017-05-30 15:30:32,348 main: Using config file /home/pi/ems/microserver/etc                                /config.json
                [INFO ] 2017-05-30 15:30:32,348 ./wsems: Creating the WsEms proxy.
                [INFO ] 2017-05-30 15:30:32,348 ./wsems: Starting HTTP Server.
                [INFO ] 2017-05-30 15:30:32,348 ./wsems: Initializing the ThingWorx REST interface.
                [FORCE] 2017-05-30 15:30:32,348 httpServer: starting http server port=9080
                [ERROR] 2017-05-30 15:30:32,349 httpserver: Server socket error: Address already in                                 use [127.0.0.1:9080]
                [ERROR] 2017-05-30 15:30:32,349 httpServer: unable to bind http server to port=9080,                                 trying next port.
                [DEBUG] 2017-05-30 15:30:32,350 SDK: twWs_Create: Initializing Websocket Client for                                 192.168.20.37:8443//Thingworx/WS
                [DEBUG] 2017-05-30 15:30:32,350 SDK: twTlsClient_Create: Initializing TLS Client
                [ERROR] 2017-05-30 15:30:32,350 httpserver: Server socket error: Address already in                                 use [127.0.0.1:9081]
                [ERROR] 2017-05-30 15:30:32,351 httpServer: unable to bind http server to port=9081,                                 trying next port.
                [DEBUG] 2017-05-30 15:30:32,351 SDK: twApi_Initialize: Websocket Established after 0                                 tries
                [DEBUG] 2017-05-30 15:30:32,351 SDK: subscribedPropsMgr_Initialize: Initializing sub                                scribed properties manager
                [DEBUG] 2017-05-30 15:30:32,352 httpServer: http server bound to port=9082.
                [DEBUG] 2017-05-30 15:30:32,357 jsonConfigurator::getJsonEntity: Key validation_crit                                eria not found
                [DEBUG] 2017-05-30 15:30:32,358 jsonConfigurator::getJsonEntity: Parent file not fou                                nd
                [DEBUG] 2017-05-30 15:30:32,358 jsonConfigurator::getJsonEntity: Parent file not fou                                nd
                [INFO ] 2017-05-30 15:30:32,358 wsEmsProxy::initialize: Initialization complete!

                192.168.20.37:8443-->[INFO ] 2017-05-30 15:30:32,359 ./wsems: Starting the connectio                                n.
                [DEBUG] 2017-05-30 15:30:32,361 SDK: twTlsClient_Reconnect: Re-establishing SSL cont                                ext
                [DEBUG] 2017-05-30 15:30:32,361 SDK: twTlsClient_Connect: Connecting to server
                [ERROR] 2017-05-30 15:30:42,362 SDK: twWs_Connect: Error trying to connect
                [DEBUG] 2017-05-30 15:30:42,362 SDK: twTlsClient_Reconnect: Re-establishing SSL cont                                ext
                [DEBUG] 2017-05-30 15:30:42,363 SDK: twTlsClient_Connect: Connecting to server
                [DEBUG] 2017-05-30 15:30:47,363 SDK: twTlsClient_Reconnect: Re-establishing SSL cont                                ext
                [DEBUG] 2017-05-30 15:30:47,364 SDK: twTlsClient_Connect: Connecting to server
                [ERROR] 2017-05-30 15:30:57,364 SDK: twWs_Connect: Error trying to connect
                [DEBUG] 2017-05-30 15:30:57,365 SDK: twTlsClient_Reconnect: Re-establishing SSL cont                                ext
                [DEBUG] 2017-05-30 15:30:57,365 SDK: twTlsClient_Connect: Connecting to server
                [DEBUG] 2017-05-30 15:31:02,365 SDK: twTlsClient_Reconnect: Re-establishing SSL cont                                ext
                [DEBUG] 2017-05-30 15:31:02,366 SDK: twTlsClient_Connect: Connecting to server
                [ERROR] 2017-05-30 15:31:12,366 SDK: twWs_Connect: Error trying to connect
                [DEBUG] 2017-05-30 15:31:12,367 SDK: twTlsClient_Reconnect: Re-establishing SSL cont                                ext
                [DEBUG] 2017-05-30 15:31:12,367 SDK: twTlsClient_Connect: Connecting to server
                [DEBUG] 2017-05-30 15:31:17,369 SDK: twTlsClient_Reconnect: Re-establishing SSL cont                                ext
                [DEBUG] 2017-05-30 15:31:17,369 SDK: twTlsClient_Connect: Connecting to server
                [ERROR] 2017-05-30 15:31:27,369 SDK: twWs_Connect: Error trying to connect
                [DEBUG] 2017-05-30 15:31:27,370 SDK: twTlsClient_Reconnect: Re-establishing SSL cont                                ext
                [DEBUG] 2017-05-30 15:31:27,370 SDK: twTlsClient_Connect: Connecting to server
                [WARN ] 2017-05-30 15:31:32,364 Main: Unable to connect to server.  Trying .booted c                                onfig file
                [WARN ] 2017-05-30 15:31:32,371 WsEmsProxy::execute() : Server connection failed.  E                                rror Code: 201
                [FORCE] 2017-05-30 15:31:32,475 Main: Shutdown signal received. Restarting ....
                [DEBUG] 2017-05-30 15:31:32,475 SDK: twMessage_Send: Not authenticated yet
                [ERROR] 2017-05-30 15:31:32,475 SDK: twMessage_Send: Error sending Message with Requ                                estId 1
                [ERROR] 2017-05-30 15:31:32,476 SDK: twApi_UnbindThing: Error creating sending Unbin                                d message
                terminate called without an active exception
                pi@piRed:~/ems/microserver $ sudo ./wsems
                [INFO ] 2017-05-30 15:35:51,285 ./wsems: Using config file: /home/pi/ems/microserver                                /etc/config.json
                [FORCE] 2017-05-30 15:35:51,286 ./wsems: Starting up ....
                [FORCE] 2017-05-30 15:35:51,286 ./wsems: Initializing EMS ....
                [FORCE] 2017-05-30 15:35:51,286 main: Using config file /home/pi/ems/microserver/etc                                /config.json
                [INFO ] 2017-05-30 15:35:51,286 ./wsems: Creating the WsEms proxy.
                [INFO ] 2017-05-30 15:35:51,286 ./wsems: Starting HTTP Server.
                [INFO ] 2017-05-30 15:35:51,288 ./wsems: starting http server port=9080
                [FORCE] 2017-05-30 15:35:51,289 httpServer: starting http server port=9080
                [ERROR] 2017-05-30 15:35:51,289 httpserver: Server socket error: Address already in                                 use [127.0.0.1:9080]
                [ERROR] 2017-05-30 15:35:51,289 httpServer: unable to bind http server to port=9080,                                 trying next port.
                [DEBUG] 2017-05-30 15:35:51,289 SDK: twWs_Create: Initializing Websocket Client for                                 192.168.20.37:8080//Thingworx/WS
                [DEBUG] 2017-05-30 15:35:51,289 SDK: twTlsClient_Create: Initializing TLS Client
                [ERROR] 2017-05-30 15:35:51,289 httpserver: Server socket error: Address already in                                 use [127.0.0.1:9081]
                [ERROR] 2017-05-30 15:35:51,290 httpServer: unable to bind http server to port=9081,                                 trying next port.
                [DEBUG] 2017-05-30 15:35:51,290 httpServer: http server bound to port=9082.
                [DEBUG] 2017-05-30 15:35:51,290 SDK: twApi_Initialize: Websocket Established after 0                                 tries
                [DEBUG] 2017-05-30 15:35:51,290 SDK: subscribedPropsMgr_Initialize: Initializing sub                                scribed properties manager
                [DEBUG] 2017-05-30 15:35:51,291 jsonConfigurator::getJsonEntity: Key cert_chain not                                 found
                [DEBUG] 2017-05-30 15:35:51,291 jsonConfigurator::getJsonEntity: Key validation_crit                                eria not found
                [DEBUG] 2017-05-30 15:35:51,292 jsonConfigurator::getJsonEntity: Parent file not fou                                nd
                [DEBUG] 2017-05-30 15:35:51,293 jsonConfigurator::getJsonEntity: Parent file not fou                                nd
                [INFO ] 2017-05-30 15:35:51,293 wsEmsProxy::initialize: Initialization complete!
                [INFO ] 2017-05-30 15:35:51,294 ./wsems: Starting the connection.

                192.168.20.37:8080-->[DEBUG] 2017-05-30 15:35:51,296 SDK: twTlsClient_Reconnect: Re-                                establishing SSL context
                [DEBUG] 2017-05-30 15:35:51,297 SDK: twTlsClient_Connect: Connecting to server
                [ERROR] 2017-05-30 15:35:51,298 SDK: Error intializing socket connection.  Err = 111
                [ERROR] 2017-05-30 15:35:51,298 SDK: twWs_Connect: Error restarting socket.  Error 1                                11
                [DEBUG] 2017-05-30 15:35:56,299 SDK: twTlsClient_Reconnect: Re-establishing SSL cont                                ext
                [DEBUG] 2017-05-30 15:35:56,299 SDK: twTlsClient_Connect: Connecting to server
                [ERROR] 2017-05-30 15:35:56,300 SDK: Error intializing socket connection.  Err = 111
                [ERROR] 2017-05-30 15:35:56,300 SDK: twWs_Connect: Error restarting socket.  Error 1                                11
                [DEBUG] 2017-05-30 15:36:01,300 SDK: twTlsClient_Reconnect: Re-establishing SSL cont                                ext
                [DEBUG] 2017-05-30 15:36:01,301 SDK: twTlsClient_Connect: Connecting to server
                [ERROR] 2017-05-30 15:36:01,301 SDK: Error intializing socket connection.  Err = 111
                [ERROR] 2017-05-30 15:36:01,301 SDK: twWs_Connect: Error restarting socket.  Error 1                                11
                [DEBUG] 2017-05-30 15:36:06,302 SDK: twTlsClient_Reconnect: Re-establishing SSL cont                                ext
                [DEBUG] 2017-05-30 15:36:06,302 SDK: twTlsClient_Connect: Connecting to server
                [ERROR] 2017-05-30 15:36:06,303 SDK: Error intializing socket connection.  Err = 111
                [ERROR] 2017-05-30 15:36:06,303 SDK: twWs_Connect: Error restarting socket.  Error 1                                11
                [DEBUG] 2017-05-30 15:36:11,303 SDK: twTlsClient_Reconnect: Re-establishing SSL cont                                ext
                [DEBUG] 2017-05-30 15:36:11,303 SDK: twTlsClient_Connect: Connecting to server
                [ERROR] 2017-05-30 15:36:11,304 SDK: Error intializing socket connection.  Err = 111
                [ERROR] 2017-05-30 15:36:11,304 SDK: twWs_Connect: Error restarting socket.  Error 1                                11
                [DEBUG] 2017-05-30 15:36:16,305 SDK: twTlsClient_Reconnect: Re-establishing SSL cont                                ext
                [DEBUG] 2017-05-30 15:36:16,305 SDK: twTlsClient_Connect: Connecting to server
                [ERROR] 2017-05-30 15:36:16,305 SDK: Error intializing socket connection.  Err = 111
                [ERROR] 2017-05-30 15:36:16,306 SDK: twWs_Connect: Error restarting socket.  Error 1                                11
                [DEBUG] 2017-05-30 15:36:21,306 SDK: twTlsClient_Reconnect: Re-establishing SSL cont                                ext
                [DEBUG] 2017-05-30 15:36:21,307 SDK: twTlsClient_Connect: Connecting to server
                [ERROR] 2017-05-30 15:36:21,307 SDK: Error intializing socket connection.  Err = 111
                [ERROR] 2017-05-30 15:36:21,308 SDK: twWs_Connect: Error restarting socket.  Error 1                                11
                [DEBUG] 2017-05-30 15:36:26,308 SDK: twTlsClient_Reconnect: Re-establishing SSL cont                                ext
                [DEBUG] 2017-05-30 15:36:26,308 SDK: twTlsClient_Connect: Connecting to server
                [ERROR] 2017-05-30 15:36:26,309 SDK: Error intializing socket connection.  Err = 111
                [ERROR] 2017-05-30 15:36:26,309 SDK: twWs_Connect: Error restarting socket.  Error 1                                11
                [DEBUG] 2017-05-30 15:36:31,310 SDK: twTlsClient_Reconnect: Re-establishing SSL cont                                ext
                [DEBUG] 2017-05-30 15:36:31,310 SDK: twTlsClient_Connect: Connecting to server
                [ERROR] 2017-05-30 15:36:31,311 SDK: Error intializing socket connection.  Err = 111
                [ERROR] 2017-05-30 15:36:31,311 SDK: twWs_Connect: Error restarting socket.  Error 1                                11
                [DEBUG] 2017-05-30 15:36:36,311 SDK: twTlsClient_Reconnect: Re-establishing SSL cont                                ext
                [DEBUG] 2017-05-30 15:36:36,311 SDK: twTlsClient_Connect: Connecting to server
                [ERROR] 2017-05-30 15:36:36,312 SDK: Error intializing socket connection.  Err = 111
                [ERROR] 2017-05-30 15:36:36,312 SDK: twWs_Connect: Error restarting socket.  Error 1                                11
                [DEBUG] 2017-05-30 15:36:41,313 SDK: twTlsClient_Reconnect: Re-establishing SSL cont                                ext
                [DEBUG] 2017-05-30 15:36:41,313 SDK: twTlsClient_Connect: Connecting to server
                [ERROR] 2017-05-30 15:36:41,314 SDK: Error intializing socket connection.  Err = 111
                [ERROR] 2017-05-30 15:36:41,314 SDK: twWs_Connect: Error restarting socket.  Error 1                                11
                [DEBUG] 2017-05-30 15:36:46,315 SDK: twTlsClient_Reconnect: Re-establishing SSL cont                                ext
                [DEBUG] 2017-05-30 15:36:46,315 SDK: twTlsClient_Connect: Connecting to server
                [ERROR] 2017-05-30 15:36:46,316 SDK: Error intializing socket connection.  Err = 111
                [ERROR] 2017-05-30 15:36:46,316 SDK: twWs_Connect: Error restarting socket.  Error 1                                11
                [DEBUG] 2017-05-30 15:36:51,316 SDK: twTlsClient_Reconnect: Re-establishing SSL cont                                ext
                [DEBUG] 2017-05-30 15:36:51,317 SDK: twTlsClient_Connect: Connecting to server
                [ERROR] 2017-05-30 15:36:51,317 SDK: Error intializing socket connection.  Err = 111
                [ERROR] 2017-05-30 15:36:51,317 SDK: twWs_Connect: Error restarting socket.  Error 1                                11
                [WARN ] 2017-05-30 15:36:51,324 Main: Unable to connect to server.  Trying .booted c                                onfig file
                [WARN ] 2017-05-30 15:36:56,318 WsEmsProxy::execute() : Server connection failed.  E                                rror Code: 1001
                [FORCE] 2017-05-30 15:36:56,420 Main: Shutdown signal received. Restarting ....
                [DEBUG] 2017-05-30 15:36:56,421 SDK: twMessage_Send: Not authenticated yet
                [ERROR] 2017-05-30 15:36:56,421 SDK: twMessage_Send: Error sending Message with Requ                                estId 1
                [ERROR] 2017-05-30 15:36:56,421 SDK: twApi_UnbindThing: Error creating sending Unbin                                d message
                [DEBUG] 2017-05-30 15:36:56,421 SDK: twMessage_Delete:  Deleting BIND Message: 1
                terminate called without an active exception
                pi@piRed:~/ems/microserver $ sudo ./wsems
                [INFO ] 2017-05-30 15:44:42,861 ./wsems: Using config file: /home/pi/ems/microserver                                /etc/config.json
                [FORCE] 2017-05-30 15:44:42,862 ./wsems: Starting up ....
                [TRACE] 2017-05-30 15:44:42,862 jsonConfigurator::getString: Key = audit_target, Par                                ent = logger
                [TRACE] 2017-05-30 15:44:42,862 jsonConfigurator::getValueByType: Key audit_target n                                ot found
                [TRACE] 2017-05-30 15:44:42,863 jsonConfigurator::getString: Key = publish_directory                                , Parent = logger
                [TRACE] 2017-05-30 15:44:42,863 jsonConfigurator::getValueByType: Key publish_direct                                ory not found
                [TRACE] 2017-05-30 15:44:42,863 jsonConfigurator::getUnsignedInteger: Key = max_file                                _storage, Parent = logger
                [TRACE] 2017-05-30 15:44:42,864 jsonConfigurator::getValueByType: Key max_file_stora                                ge not found
                [TRACE] 2017-05-30 15:44:42,864 jsonConfigurator::getString: Key = publish_level, Pa                                rent = logger
                [TRACE] 2017-05-30 15:44:42,864 jsonConfigurator::getValueByType: Key publish_level                                 not found
                [TRACE] 2017-05-30 15:44:42,864 jsonConfigurator::getBoolean: Key = auto_flush, Pare                                nt = logger
                [TRACE] 2017-05-30 15:44:42,864 jsonConfigurator::getValueByType: Key auto_flush not                                 found
                [FORCE] 2017-05-30 15:44:42,865 ./wsems: Initializing EMS ....
                [FORCE] 2017-05-30 15:44:42,865 main: Using config file /home/pi/ems/microserver/etc                                /config.json
                [INFO ] 2017-05-30 15:44:42,865 ./wsems: Creating the WsEms proxy.
                [TRACE] 2017-05-30 15:44:42,865 wsEmsProxy::wsEmsProxy: Constructor called
                [INFO ] 2017-05-30 15:44:42,865 ./wsems: Starting HTTP Server.
                [TRACE] 2017-05-30 15:44:42,866 jsonConfigurator::getInteger: Key = port, Parent = h                                ttp_server
                [TRACE] 2017-05-30 15:44:42,866 jsonConfigurator::getString: Key = host, Parent = ht                                tp_server
                [TRACE] 2017-05-30 15:44:42,866 jsonConfigurator::getBoolean: Key = ssl, Parent = ht                                tp_server
                [TRACE] 2017-05-30 15:44:42,866 jsonConfigurator::getValueByType: Key ssl not found
                [TRACE] 2017-05-30 15:44:42,867 jsonConfigurator::getString: Key = certificate, Pare                                nt = http_server
                [TRACE] 2017-05-30 15:44:42,867 jsonConfigurator::getValueByType: Key certificate no                                t found
                [TRACE] 2017-05-30 15:44:42,867 jsonConfigurator::getBoolean: Key = authenticate, Pa                                rent = http_server

                192.168.20.37:8443-->[TRACE] 2017-05-30 15:44:42,867 jsonConfigurator::getValueByTyp                                e: Key authenticate not found
                [TRACE] 2017-05-30 15:44:42,868 jsonConfigurator::getInteger: Key = content_read_tim                                eout, Parent = http_server
                [TRACE] 2017-05-30 15:44:42,868 jsonConfigurator::getValueByType: Key content_read_t                                imeout not found
                [INFO ] 2017-05-30 15:44:42,869 ./wsems: Initializing the ThingWorx REST interface.
                [TRACE] 2017-05-30 15:44:42,869 wsEmsProxy::initialize: Method entered
                [FORCE] 2017-05-30 15:44:42,870 httpServer: Method entered
                [TRACE] 2017-05-30 15:44:42,870 jsonConfigurator::getString: Key = level, Parent = l                                ogger
                [TRACE] 2017-05-30 15:44:42,870 jsonConfigurator::getBoolean: Key = verbose, Parent                                 = ws_connection
                [TRACE] 2017-05-30 15:44:42,871 jsonConfigurator::getString: Key = encryption, Paren                                t = ws_connection
                [TRACE] 2017-05-30 15:44:42,871 jsonConfigurator::getString: Key = user, Parent =
                [TRACE] 2017-05-30 15:44:42,871 jsonConfigurator::getValueByType: Key user not found
                [TRACE] 2017-05-30 15:44:42,871 jsonConfigurator::getString: Key = password, Parent                                 =
                [TRACE] 2017-05-30 15:44:42,871 jsonConfigurator::getValueByType: Key password not f                                ound
                [TRACE] 2017-05-30 15:44:42,872 jsonConfigurator::getString: Key = appkey, Parent =
                [TRACE] 2017-05-30 15:44:42,872 jsonConfigurator::getString: Key = resource, Parent                                 =
                [TRACE] 2017-05-30 15:44:42,872 jsonConfigurator::getValueByType: Key resource not f                                ound
                [TRACE] 2017-05-30 15:44:42,872 jsonConfigurator::getInteger: Key = port, Parent = p                                roxy
                [TRACE] 2017-05-30 15:44:42,872 jsonConfigurator::getValueByType: Parent proxy not f                                ound
                [TRACE] 2017-05-30 15:44:42,873 jsonConfigurator::getString: Key = host, Parent = pr                                oxy
                [TRACE] 2017-05-30 15:44:42,873 jsonConfigurator::getValueByType: Parent proxy not f                                ound
                [TRACE] 2017-05-30 15:44:42,873 jsonConfigurator::getString: Key = user, Parent = pr                                oxy
                [TRACE] 2017-05-30 15:44:42,873 jsonConfigurator::getValueByType: Parent proxy not f                                ound
                [TRACE] 2017-05-30 15:44:42,873 jsonConfigurator::getString: Key = password, Parent                                 = proxy
                [TRACE] 2017-05-30 15:44:42,874 jsonConfigurator::getValueByType: Parent proxy not f                                ound
                [TRACE] 2017-05-30 15:44:42,874 jsonConfigurator::getUnsignedInteger: Key = socket_r                                ead_timeout, Parent = ws_connection
                [TRACE] 2017-05-30 15:44:42,874 jsonConfigurator::getValueByType: Key socket_read_ti                                meout not found
                [TRACE] 2017-05-30 15:44:42,874 jsonConfigurator::getUnsignedInteger: Server socket                                 error: Address already in use [127.0.0.1:9080]
                [ERROR] 2017-05-30 15:44:42,874 httpserver: Server socket error: Address already in                                 use [127.0.0.1:9080]
                [TRACE] 2017-05-30 15:44:42,875 jsonConfigurator::getValueByType:
                [ERROR] 2017-05-30 15:44:42,875 httpServer:
                [TRACE] 2017-05-30 15:44:42,875 jsonConfigurator::getUnsignedInteger: Key = ssl_read                                _timeout, Parent = ws_connection
                [TRACE] 2017-05-30 15:44:42,875 jsonConfigurator::getValueByType: Key ssl_read_timeo                                ut not found
                [TRACE] 2017-05-30 15:44:42,875 jsonConfigurator::getUnsignedInteger: Key = msg_time                                out, Parent = ws_connection
                [TRACE] 2017-05-30 15:44:42,876 jsonConfigurator::getUnsignedInteger: Key = ping_rat                                e, Parent = ws_connection
                [TRACE] 2017-05-30 15:44:42,876 jsonConfigurator::getValueByType: Key ping_rate not                                 found
                [TRACE] 2017-05-30 15:44:42,876 jsonConfigurator::getUnsignedInteger: Key = pingpong                                _timeout, Parent = ws_connection
                [TRACE] 2017-05-30 15:44:42,876 jsonConfigurator::getValueByType: Key pingpong_timeo                                ut not found
                [TRACE] 2017-05-30 15:44:42,876 jsonConfigurator::getUnsignedInteger: Key = max_thre                                ads, Parent = ws_connection
                [TRACE] 2017-05-30 15:44:42,876 jsonConfigurator::getValueByType: Key max_threads no                                t found
                [TRACE] 2017-05-30 15:44:42,876 jsonConfigurator::getUnsignedInteger: Key = max_msg_                                size, Parent = ws_connection
                [TRACE] 2017-05-30 15:44:42,877 jsonConfigurator::getValueByType: Key max_msg_size n                                ot found
                [TRACE] 2017-05-30 15:44:42,877 jsonConfigurator::getUnsignedInteger: Key = max_mess                                ages, Parent = ws_connection
                [TRACE] 2017-05-30 15:44:42,877 jsonConfigurator::getValueByType: Key max_messages n                                ot found
                [TRACE] 2017-05-30 15:44:42,877 jsonConfigurator::getBoolean: Key = verbose, Parent                                 = ws_connection
                [TRACE] 2017-05-30 15:44:42,877 jsonConfigurator::getBoolean: Key = connect_on_deman                                d, Parent = ws_connection
                [TRACE] 2017-05-30 15:44:42,877 jsonConfigurator::getValueByType: Key connect_on_dem                                and not found
                [TRACE] 2017-05-30 15:44:42,877 jsonConfigurator::getUnsignedInteger: Key = max_conn                                ect_delay, Parent = ws_connection
                [TRACE] 2017-05-30 15:44:42,877 jsonConfigurator::getValueByType: Key max_connect_de                                lay not found
                [TRACE] 2017-05-30 15:44:42,878 jsonConfigurator::getUnsignedInteger: Key = connect_                                period, Parent = ws_connection
                [TRACE] 2017-05-30 15:44:42,878 jsonConfigurator::getValueByType: Key connect_period                                 not found
                [TRACE] 2017-05-30 15:44:42,878 jsonConfigurator::getUnsignedInteger: Key = duty_cyc                                le, Parent = ws_connection
                [ERROR] 2017-05-30 15:44:42,878 httpserver: Server socket error: Address already in                                 use [127.0.0.1:9081]
                [TRACE] 2017-05-30 15:44:42,878 jsonConfigurator::getValueByType: Server socket erro                                r: Address already in use [127.0.0.1:9081]
                [ERROR] 2017-05-30 15:44:42,878 httpServer: unable to bind http server to port=9081,                                 trying next port.
                [TRACE] 2017-05-30 15:44:42,878 jsonConfigurator::getUnsignedInteger: Key = message_                                idle_time, Parent = ws_connection
                [TRACE] 2017-05-30 15:44:42,878 jsonConfigurator::getValueByType: Key message_idle_t                                ime not found
                [TRACE] 2017-05-30 15:44:42,878 jsonConfigurator::getUnsignedInteger: Key = connect_                                timeout, Parent = ws_connection
                [TRACE] 2017-05-30 15:44:42,878 jsonConfigurator::getValueByType: Key connect_timeou                                t not found
                [TRACE] 2017-05-30 15:44:42,878 jsonConfigurator::getUnsignedInteger: Key = connect_                                retry_interval, Parent = ws_connection
                [TRACE] 2017-05-30 15:44:42,878 jsonConfigurator::getValueByType: Key connect_retry_                                interval not found
                [TRACE] 2017-05-30 15:44:42,879 jsonConfigurator::getInteger: Key = connect_retries,                                 Parent = ws_connection
                [TRACE] 2017-05-30 15:44:42,879 jsonConfigurator::getValueByType: Key connect_retrie                                s not found
                [TRACE] 2017-05-30 15:44:42,879 jsonConfigurator::getBoolean: Key = enabled, Parent                                 = offline_msg_store
                [TRACE] 2017-05-30 15:44:42,879 jsonConfigurator::getValueByType: Parent offline_msg                                _store not found
                [TRACE] 2017-05-30 15:44:42,880 jsonConfigurator::getString: Key = directory, Parent                                 = offline_msg_store
                [TRACE] 2017-05-30 15:44:42,880 jsonConfigurator::getValueByType: Parent offline_msg                                _store not found
                [TRACE] 2017-05-30 15:44:42,880 jsonConfigurator::getUnsignedInteger: Key = max_size                                , Parent = offline_msg_store
                [TRACE] 2017-05-30 15:44:42,880 jsonConfigurator::getValueByType: http server bound                                 to port=9082.
                [DEBUG] 2017-05-30 15:44:42,880 httpServer: http server bound to port=9082.
                [TRACE] 2017-05-30 15:44:42,880 jsonConfigurator::getUnsignedInteger: Key = message_                                chunk_size, Parent = ws_connection
                [TRACE] 2017-05-30 15:44:42,880 jsonConfigurator::getValueByType: Key message_chunk_                                size not found
                [DEBUG] 2017-05-30 15:44:42,881 SDK: twWs_Create: Initializing Websocket Client for                                 192.168.20.37:8443//Thingworx/WS
                [DEBUG] 2017-05-30 15:44:42,881 SDK: twTlsClient_Create: Initializing TLS Client
                [DEBUG] 2017-05-30 15:44:42,881 SDK: twApi_Initialize: Websocket Established after 0                                 tries
                [DEBUG] 2017-05-30 15:44:42,881 SDK: subscribedPropsMgr_Initialize: Initializing sub                                scribed properties manager
                [TRACE] 2017-05-30 15:44:42,881 jsonConfigurator::getBoolean: Key = validate, Parent                                 = certificates
                [TRACE] 2017-05-30 15:44:42,881 jsonConfigurator::getBoolean: Key = deny_self_signed                                , Parent = certificates
                [TRACE] 2017-05-30 15:44:42,882 jsonConfigurator::getValueByType: Key deny_self_sign                                ed not found
                [TRACE] 2017-05-30 15:44:42,882 jsonConfigurator::getBoolean: Key = allow_self_signe                                d, Parent = certificates
                [TRACE] 2017-05-30 15:44:42,882 jsonConfigurator::getString: Key = client_cert, Pare                                nt = certificates
                [TRACE] 2017-05-30 15:44:42,882 jsonConfigurator::getValueByType: Key client_cert no                                t found
                [TRACE] 2017-05-30 15:44:42,882 jsonConfigurator::getString: Key = key_file, Parent                                 = certificates
                [TRACE] 2017-05-30 15:44:42,882 jsonConfigurator::getValueByType: Key key_file not f                                ound
                [TRACE] 2017-05-30 15:44:42,883 jsonConfigurator::getString: Key = key_passphrase, P                                arent = certificates
                [TRACE] 2017-05-30 15:44:42,883 jsonConfigurator::getValueByType: Key key_passphrase                                 not found
                [DEBUG] 2017-05-30 15:44:42,883 jsonConfigurator::getJsonEntity: Key cert_chain not                                 found
                [DEBUG] 2017-05-30 15:44:42,883 jsonConfigurator::getJsonEntity: Key validation_crit                                eria not found
                [TRACE] 2017-05-30 15:44:42,883 jsonConfigurator::getString: Key = staging_dir, Pare                                nt = file
                [TRACE] 2017-05-30 15:44:42,884 jsonConfigurator::getValueByType: Parent file not fo                                und
                [TRACE] 2017-05-30 15:44:42,884 jsonConfigurator::getUnsignedInteger: Key = buffer_s                                ize, Parent = file
                [TRACE] 2017-05-30 15:44:42,884 jsonConfigurator::getValueByType: Parent file not fo                                und
                [TRACE] 2017-05-30 15:44:42,884 jsonConfigurator::getDouble: Key = max_file_size, Pa                                rent = file
                [TRACE] 2017-05-30 15:44:42,884 jsonConfigurator::getValueByType: Parent file not fo                                und
                [DEBUG] 2017-05-30 15:44:42,884 jsonConfigurator::getJsonEntity: Parent file not fou                                nd
                [TRACE] 2017-05-30 15:44:42,885 SDK: twFileManager_AddVirtualDir: Adding __staging__                                 to vdir list
                [TRACE] 2017-05-30 15:44:42,885 WsEmsProxy::bindThing: Adding Thing RedPi to binding                                 list
                [DEBUG] 2017-05-30 15:44:42,885 jsonConfigurator::getJsonEntity: Parent file not fou                                nd
                [INFO ] 2017-05-30 15:44:42,886 wsEmsProxy::initialize: Initialization complete!
                [INFO ] 2017-05-30 15:44:42,886 ./wsems: Starting the connection.
                [TRACE] 2017-05-30 15:44:42,886 jsonConfigurator::getInteger: Key = connect_retry_in                                terval, Parent = ws_connection
                [TRACE] 2017-05-30 15:44:42,886 jsonConfigurator::getValueByType: Key connect_retry_                                interval not found
                [TRACE] 2017-05-30 15:44:42,886 jsonConfigurator::getInteger: Key = max_connect_dela                                y, Parent = ws_connection
                [TRACE] 2017-05-30 15:44:42,886 jsonConfigurator::getValueByType: Key max_connect_de                                lay not found
                [TRACE] 2017-05-30 15:44:42,887 SDK: twApi_Connect: Delaying 0 milliseconds before c                                onnecting
                [DEBUG] 2017-05-30 15:44:42,887 SDK: twTlsClient_Reconnect: Re-establishing SSL cont                                ext
                [DEBUG] 2017-05-30 15:44:42,887 SDK: twTlsClient_Connect: Connecting to server
                [TRACE] 2017-05-30 15:44:42,887 SDK: twWs_Connect: Connected to 192.168.20.37:8443
                [TRACE] 2017-05-30 15:44:42,887 SDK: twWs_Connect: Sent request:
                GET /Thingworx/WS HTTP/1.1
                User-Agent: ThingWorx C SDK
                Upgrade: websocket
                Connection: Upgrade
                Host: 192.168.20.37
                Sec-WebSocket-Version: 13
                Sec-WebSocket-Key: K2wSDrgRu5z6f1o/qirv4g==
                Max-Frame-Size: 8192
                appKey: f109ecb5-9e2b-4215-8d3f-6479d5d6b9c1


                [ERROR] 2017-05-30 15:44:52,869 SDK: twWs_Connect: Error trying to connect
                [DEBUG] 2017-05-30 15:44:52,869 SDK: twTlsClient_Reconnect: Re-establishing SSL context
                [DEBUG] 2017-05-30 15:44:52,870 SDK: twTlsClient_Connect: Connecting to server
                [DEBUG] 2017-05-30 15:44:57,871 SDK: twTlsClient_Reconnect: Re-establishing SSL context
                [DEBUG] 2017-05-30 15:44:57,872 SDK: twTlsClient_Connect: Connecting to server
                [TRACE] 2017-05-30 15:44:57,873 SDK: twWs_Connect: Connected to 192.168.20.37:8443
                [TRACE] 2017-05-30 15:44:57,873 SDK: twWs_Connect: Sent request:
                GET /Thingworx/WS HTTP/1.1
                User-Agent: ThingWorx C SDK
                Upgrade: websocket
                Connection: Upgrade
                Host: 192.168.20.37
                Sec-WebSocket-Version: 13
                Sec-WebSocket-Key: Vsg3bgTpTfPat+g++S1gWA==
                Max-Frame-Size: 8192
                appKey: f109ecb5-9e2b-4215-8d3f-6479d5d6b9c1


                [ERROR] 2017-05-30 15:45:07,872 SDK: twWs_Connect: Error trying to connect
                [DEBUG] 2017-05-30 15:45:07,872 SDK: twTlsClient_Reconnect: Re-establishing SSL context
                [DEBUG] 2017-05-30 15:45:07,873 SDK: twTlsClient_Connect: Connecting to server
                [DEBUG] 2017-05-30 15:45:12,873 SDK: twTlsClient_Reconnect: Re-establishing SSL context
                [DEBUG] 2017-05-30 15:45:12,874 SDK: twTlsClient_Connect: Connecting to server
                [TRACE] 2017-05-30 15:45:12,875 SDK: twWs_Connect: Connected to 192.168.20.37:8443
                [TRACE] 2017-05-30 15:45:12,875 SDK: twWs_Connect: Sent request:
                GET /Thingworx/WS HTTP/1.1
                User-Agent: ThingWorx C SDK
                Upgrade: websocket
                Connection: Upgrade
                Host: 192.168.20.37
                Sec-WebSocket-Version: 13
                Sec-WebSocket-Key: 4c60G//iroTJJ/xUrbO4cQ==
                Max-Frame-Size: 8192
                appKey: f109ecb5-9e2b-4215-8d3f-6479d5d6b9c1


                [ERROR] 2017-05-30 15:45:22,875 SDK: twWs_Connect: Error trying to connect
                [DEBUG] 2017-05-30 15:45:22,876 SDK: twTlsClient_Reconnect: Re-establishing SSL context
                [DEBUG] 2017-05-30 15:45:22,876 SDK: twTlsClient_Connect: Connecting to server
                [DEBUG] 2017-05-30 15:45:27,877 SDK: twTlsClient_Reconnect: Re-establishing SSL context
                [DEBUG] 2017-05-30 15:45:27,877 SDK: twTlsClient_Connect: Connecting to server
                [TRACE] 2017-05-30 15:45:27,878 SDK: twWs_Connect: Connected to 192.168.20.37:8443
                [TRACE] 2017-05-30 15:45:27,878 SDK: twWs_Connect: Sent request:
                GET /Thingworx/WS HTTP/1.1
                User-Agent: ThingWorx C SDK
                Upgrade: websocket
                Connection: Upgrade
                Host: 192.168.20.37
                Sec-WebSocket-Version: 13
                Sec-WebSocket-Key: b3FYTKV+0GgloJgR2ykkHQ==
                Max-Frame-Size: 8192
                appKey: f109ecb5-9e2b-4215-8d3f-6479d5d6b9c1


                [ERROR] 2017-05-30 15:45:37,878 SDK: twWs_Connect: Error trying to connect
                [DEBUG] 2017-05-30 15:45:37,878 SDK: twTlsClient_Reconnect: Re-establishing SSL context
                [DEBUG] 2017-05-30 15:45:37,879 SDK: twTlsClient_Connect: Connecting to server
                [DEBUG] 2017-05-30 15:45:42,882 SDK: twTlsClient_Reconnect: Re-establishing SSL context
                [DEBUG] 2017-05-30 15:45:42,883 SDK: twTlsClient_Connect: Connecting to server
                [TRACE] 2017-05-30 15:45:42,885 SDK: twWs_Connect: Connected to 192.168.20.37:8443
                [TRACE] 2017-05-30 15:45:42,885 SDK: twWs_Connect: Sent request:
                GET /Thingworx/WS HTTP/1.1
                User-Agent: ThingWorx C SDK
                Upgrade: websocket
                Connection: Upgrade
                Host: 192.168.20.37
                Sec-WebSocket-Version: 13
                Sec-WebSocket-Key: TT6oGnLX5utZrbaC9YS7bw==
                Max-Frame-Size: 8192
                appKey: f109ecb5-9e2b-4215-8d3f-6479d5d6b9c1


                [WARN ] 2017-05-30 15:45:42,901 Main: Unable to connect to server.  Trying .booted config file
                [ERROR] 2017-05-30 15:45:52,885 SDK: twWs_Connect: Error trying to connect
                [DEBUG] 2017-05-30 15:45:52,886 SDK: twTlsClient_Reconnect: Re-establishing SSL context
                [DEBUG] 2017-05-30 15:45:52,886 SDK: twTlsClient_Connect: Connecting to server
                [WARN ] 2017-05-30 15:45:57,887 WsEmsProxy::execute() : Server connection failed.  Error Code: 201
                [FORCE] 2017-05-30 15:45:57,988 Main: Shutdown signal received. Restarting ....
                [TRACE] 2017-05-30 15:45:57,989 wsEmsProxy::~wsEmsProxy: Destructor called
                [TRACE] 2017-05-30 15:45:57,989 WsProxy::~WsProxy: Deleting Thing binding list
                [TRACE] 2017-05-30 15:45:57,989 SDK: Sending Msg >>>>>>>>>
                Message Details:
                Version: 1
                Method/Code: 0xb (UNBIND)
                RequestID: 1
                EndpointID:0
                SessionID: 0
                Multipart: 0
                Count: 1
                Name: RedPi

                [DEBUG] 2017-05-30 15:45:57,990 SDK: twMessage_Send: Not authenticated yet
                [ERROR] 2017-05-30 15:45:57,990 SDK: twMessage_Send: Error sending Message with RequestId 1
                [ERROR] 2017-05-30 15:45:57,990 SDK: twApi_UnbindThing: Error creating sending Unbind message
                [DEBUG] 2017-05-30 15:45:57,990 SDK: twMessage_Delete:  Deleting BIND Message: 1
                terminate called without an active exception
                pi@piRed:~/ems/microserver $ sudo ./wsems
                [INFO ] 2017-05-30 17:06:25,368 ./wsems: Using config file: /home/pi/ems/microserver/etc/config.json
                [FORCE] 2017-05-30 17:06:25,368 ./wsems: Starting up ....
                [TRACE] 2017-05-30 17:06:25,368 jsonConfigurator::getString: Key = audit_target, Parent = logger
                [TRACE] 2017-05-30 17:06:25,368 jsonConfigurator::getValueByType: Key audit_target not found
                [TRACE] 2017-05-30 17:06:25,368 jsonConfigurator::getString: Key = publish_directory, Parent = logger
                [TRACE] 2017-05-30 17:06:25,369 jsonConfigurator::getValueByType: Key publish_directory not found
                [TRACE] 2017-05-30 17:06:25,369 jsonConfigurator::getUnsignedInteger: Key = max_file_storage, Parent = logger
                [TRACE] 2017-05-30 17:06:25,369 jsonConfigurator::getValueByType: Key max_file_storage not found
                [TRACE] 2017-05-30 17:06:25,369 jsonConfigurator::getString: Key = publish_level, Parent = logger
                [TRACE] 2017-05-30 17:06:25,369 jsonConfigurator::getValueByType: Key publish_level not found
                [TRACE] 2017-05-30 17:06:25,369 jsonConfigurator::getBoolean: Key = auto_flush, Parent = logger
                [TRACE] 2017-05-30 17:06:25,369 jsonConfigurator::getValueByType: Key auto_flush not found
                [FORCE] 2017-05-30 17:06:25,369 ./wsems: Initializing EMS ....
                [FORCE] 2017-05-30 17:06:25,369 main: Using config file /home/pi/ems/microserver/etc/config.json
                [INFO ] 2017-05-30 17:06:25,369 ./wsems: Creating the WsEms proxy.
                [TRACE] 2017-05-30 17:06:25,369 wsEmsProxy::wsEmsProxy: Constructor called
                [INFO ] 2017-05-30 17:06:25,370 ./wsems: Starting HTTP Server.
                [TRACE] 2017-05-30 17:06:25,370 jsonConfigurator::getInteger: Key = port, Parent = http_server
                [TRACE] 2017-05-30 17:06:25,370 jsonConfigurator::getString: Key = host, Parent = http_server
                [TRACE] 2017-05-30 17:06:25,370 jsonConfigurator::getBoolean: Key = ssl, Parent = http_server
                [TRACE] 2017-05-30 17:06:25,370 jsonConfigurator::getValueByType: Key ssl not found
                [TRACE] 2017-05-30 17:06:25,370 jsonConfigurator::getString: Key = certificate, Parent = http_server
                [TRACE] 2017-05-30 17:06:25,370 jsonConfigurator::getValueByType: Key certificate not found
                [TRACE] 2017-05-30 17:06:25,370 jsonConfigurator::getBoolean: Key = authenticate, Parent = http_server
                [TRACE] 2017-05-30 17:06:25,370 jsonConfigurator::getValueByType: Key authenticate not found
                [TRACE] 2017-05-30 17:06:25,370 jsonConfigurator::getInteger: Key = content_read_timeout, Parent = http_server
                [TRACE] 2017-05-30 17:06:25,370 jsonConfigurator::getValueByType: Key content_read_timeout not found
                [INFO ] 2017-05-30 17:06:25,371 ./wsems: Initializing the ThingWorx REST interface.
                [TRACE] 2017-05-30 17:06:25,371 wsEmsProxy::initialize: Method entered
                [TRACE] 2017-05-30 17:06:25,371 jsonConfigurator::getString: Key = level, Parent = logger
                [FORCE] 2017-05-30 17:06:25,371 httpServer: starting http server port=9080
                [TRACE] 2017-05-30 17:06:25,371 jsonConfigurator::getBoolean: Key = verbose, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,371 jsonConfigurator::getString: Key = encryption, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,371 jsonConfigurator::getString: Key = user, Parent =
                [TRACE] 2017-05-30 17:06:25,371 jsonConfigurator::getValueByType: Key user not found
                [TRACE] 2017-05-30 17:06:25,371 jsonConfigurator::getString: Key = password, Parent =
                [TRACE] 2017-05-30 17:06:25,371 jsonConfigurator::getValueByType: Key password not found
                [TRACE] 2017-05-30 17:06:25,371 jsonConfigurator::getString: Key = appkey, Parent =
                [TRACE] 2017-05-30 17:06:25,371 jsonConfigurator::getString: Key = resource, Parent =
                [TRACE] 2017-05-30 17:06:25,371 jsonConfigurator::getValueByType: Key resource not found
                [TRACE] 2017-05-30 17:06:25,371 jsonConfigurator::getInteger: Key = port, Parent = proxy
                [TRACE] 2017-05-30 17:06:25,371 jsonConfigurator::getValueByType: Parent proxy not found
                [TRACE] 2017-05-30 17:06:25,371 jsonConfigurator::getString: Key = host, Parent = proxy
                [TRACE] 2017-05-30 17:06:25,371 jsonConfigurator::getValueByType: Parent proxy not found
                [TRACE] 2017-05-30 17:06:25,371 jsonConfigurator::getString: Key = user, Parent = proxy
                [TRACE] 2017-05-30 17:06:25,371 jsonConfigurator::getValueByType: Parent proxy not found
                [TRACE] 2017-05-30 17:06:25,372 jsonConfigurator::getString: Key = password, Parent = proxy
                [TRACE] 2017-05-30 17:06:25,372 jsonConfigurator::getValueByType: Parent proxy not found
                [TRACE] 2017-05-30 17:06:25,372 jsonConfigurator::getUnsignedInteger: Key = socket_read_timeout, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,372 jsonConfigurator::getValueByType: Key socket_read_timeout not found
                [TRACE] 2017-05-30 17:06:25,372 jsonConfigurator::getUnsignedInteger: Key = frame_read_timeout, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,372 jsonConfigurator::getValueByType: Key frame_read_timeout not found
                [TRACE] 2017-05-30 17:06:25,372 jsonConfigurator::getUnsignedInteger: Key = ssl_read_timeout, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,372 jsonConfigurator::getValueByType: Key ssl_read_timeout not found
                [TRACE] 2017-05-30 17:06:25,372 jsonConfigurator::getUnsignedInteger: Key = msg_timeout, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,372 jsonConfigurator::getUnsignedInteger: Key = ping_rate, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,372 jsonConfigurator::getValueByType: Key ping_rate not found
                [TRACE] 2017-05-30 17:06:25,372 jsonConfigurator::getUnsignedInteger: Key = pingpong_timeout, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,372 jsonConfigurator::getValueByType: Key pingpong_timeout not found
                [TRACE] 2017-05-30 17:06:25,372 jsonConfigurator::getUnsignedInteger: Key = max_threads, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,372 jsonConfigurator::getValueByType: Key max_threads not found
                [TRACE] 2017-05-30 17:06:25,372 jsonConfigurator::getUnsignedInteger: Key = max_msg_size, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,373 jsonConfigurator::getValueByType: Key max_msg_size not found
                [TRACE] 2017-05-30 17:06:25,373 jsonConfigurator::getUnsignedInteger: Key = max_messages, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,373 jsonConfigurator::getValueByType: Key max_messages not found
                [TRACE] 2017-05-30 17:06:25,373 jsonConfigurator::getBoolean: Key = verbose, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,373 jsonConfigurator::getBoolean: Key = connect_on_demand, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,373 jsonConfigurator::getValueByType: Key connect_on_demand not found
                [TRACE] 2017-05-30 17:06:25,373 jsonConfigurator::getUnsignedInteger: Key = max_connect_delay, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,373 jsonConfigurator::getValueByType: Key max_connect_delay not found
                [TRACE] 2017-05-30 17:06:25,373 jsonConfigurator::getUnsignedInteger: Key = connect_period, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,373 jsonConfigurator::getValueByType: Key connect_period not found
                [TRACE] 2017-05-30 17:06:25,373 jsonConfigurator::getUnsignedInteger: Key = duty_cycle, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,373 jsonConfigurator::getValueByType: Key duty_cycle not found
                [ERROR] 2017-05-30 17:06:25,373 httpserver: Key = message_idle_time, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,373 jsonConfigurator::getUnsignedInteger: Key = message_idle_time, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,373 jsonConfigurator::getValueByType: Key message_idle_time not found
                [ERROR] 2017-05-30 17:06:25,373 httpServer: Key message_idle_time not found
                [TRACE] 2017-05-30 17:06:25,373 jsonConfigurator::getUnsignedInteger: Key = connect_timeout, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,373 jsonConfigurator::getValueByType: Key connect_timeout not found
                [TRACE] 2017-05-30 17:06:25,374 jsonConfigurator::getUnsignedInteger: Key = connect_retry_interval, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,374 jsonConfigurator::getValueByType: Key connect_retry_interval not found
                [TRACE] 2017-05-30 17:06:25,374 jsonConfigurator::getInteger: Key = connect_retries, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,374 jsonConfigurator::getValueByType: Key connect_retries not found
                [TRACE] 2017-05-30 17:06:25,374 jsonConfigurator::getBoolean: Key = enabled, Parent = offline_msg_store
                [TRACE] 2017-05-30 17:06:25,374 jsonConfigurator::getValueByType: Parent offline_msg_store not found
                [TRACE] 2017-05-30 17:06:25,374 jsonConfigurator::getString: Key = directory, Parent = offline_msg_store
                [TRACE] 2017-05-30 17:06:25,374 jsonConfigurator::getValueByType: Parent offline_msg_store not found
                [TRACE] 2017-05-30 17:06:25,374 jsonConfigurator::getUnsignedInteger: Key = max_size, Parent = offline_msg_store
                [TRACE] 2017-05-30 17:06:25,374 jsonConfigurator::getValueByType: Parent offline_msg_store not found
                [TRACE] 2017-05-30 17:06:25,374 jsonConfigurator::getUnsignedInteger: Key = message_chunk_size, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,374 jsonConfigurator::getValueByType: Key message_chunk_size not found
                [ERROR] 2017-05-30 17:06:25,374 httpserver: Server socket error: Address already in use [127.0.0.1:9081]
                [ERROR] 2017-05-30 17:06:25,374 httpServer: unable to bind http server to port=9081, trying next port.
                [DEBUG] 2017-05-30 17:06:25,374 SDK: twWs_Create: Initializing Websocket Client for 192.168.20.37:8443//Thingworx/WS
                [DEBUG] 2017-05-30 17:06:25,374 SDK: twTlsClient_Create: Initializing TLS Client
                [DEBUG] 2017-05-30 17:06:25,374 httpServer: http server bound to port=9082.
                [DEBUG] 2017-05-30 17:06:25,375 SDK: twApi_Initialize: Websocket Established after 0 tries
                [DEBUG] 2017-05-30 17:06:25,375 SDK: subscribedPropsMgr_Initialize: Initializing subscribed properties manager
                [TRACE] 2017-05-30 17:06:25,376 jsonConfigurator::getBoolean: Key = validate, Parent = certificates
                [TRACE] 2017-05-30 17:06:25,376 jsonConfigurator::getBoolean: Key = deny_self_signed, Parent = certificates
                [TRACE] 2017-05-30 17:06:25,376 jsonConfigurator::getValueByType: Key deny_self_signed not found
                [TRACE] 2017-05-30 17:06:25,376 jsonConfigurator::getBoolean: Key = allow_self_signed, Parent = certificates
                [TRACE] 2017-05-30 17:06:25,376 jsonConfigurator::getString: Key = client_cert, Parent = certificates
                [TRACE] 2017-05-30 17:06:25,376 jsonConfigurator::getValueByType: Key client_cert not found
                [TRACE] 2017-05-30 17:06:25,376 jsonConfigurator::getString: Key = key_file, Parent = certificates
                [TRACE] 2017-05-30 17:06:25,377 jsonConfigurator::getValueByType: Key key_file not found
                [TRACE] 2017-05-30 17:06:25,377 jsonConfigurator::getString: Key = key_passphrase, Parent = certificates
                [TRACE] 2017-05-30 17:06:25,377 jsonConfigurator::getValueByType: Key key_passphrase not found
                [DEBUG] 2017-05-30 17:06:25,377 jsonConfigurator::getJsonEntity: Key cert_chain not found
                [DEBUG] 2017-05-30 17:06:25,377 jsonConfigurator::getJsonEntity: Key validation_criteria not found
                [TRACE] 2017-05-30 17:06:25,378 jsonConfigurator::getString: Key = staging_dir, Parent = file
                [TRACE] 2017-05-30 17:06:25,378 jsonConfigurator::getValueByType: Parent file not found
                [TRACE] 2017-05-30 17:06:25,378 jsonConfigurator::getUnsignedInteger: Key = buffer_size, Parent = file
                [TRACE] 2017-05-30 17:06:25,378 jsonConfigurator::getValueByType: Parent file not found
                [TRACE] 2017-05-30 17:06:25,378 jsonConfigurator::getDouble: Key = max_file_size, Parent = file
                [TRACE] 2017-05-30 17:06:25,378 jsonConfigurator::getValueByType: Parent file not found
                [DEBUG] 2017-05-30 17:06:25,378 jsonConfigurator::getJsonEntity: Parent file not found
                [TRACE] 2017-05-30 17:06:25,378 SDK: twFileManager_AddVirtualDir: Adding __staging__ to vdir list
                [TRACE] 2017-05-30 17:06:25,379 WsEmsProxy::bindThing: Adding Thing RedPi to binding list
                [DEBUG] 2017-05-30 17:06:25,379 jsonConfigurator::getJsonEntity: Parent file not found
                [INFO ] 2017-05-30 17:06:25,379 wsEmsProxy::initialize: Initialization complete!
                [INFO ] 2017-05-30 17:06:25,380 ./wsems: Starting the connection.
                [TRACE] 2017-05-30 17:06:25,380 jsonConfigurator::getInteger: Key = connect_retry_interval, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,380 jsonConfigurator::getValueByType: Key connect_retry_interval not found
                [TRACE] 2017-05-30 17:06:25,380 jsonConfigurator::getInteger: Key = max_connect_delay, Parent = ws_connection
                [TRACE] 2017-05-30 17:06:25,380 jsonConfigurator::getValueByType: Key max_connect_delay not found

                192.168.20.37:8443-->[TRACE] 2017-05-30 17:06:25,381 SDK: twApi_Connect: Delaying 0 milliseconds before connecting
                [DEBUG] 2017-05-30 17:06:25,381 SDK: twTlsClient_Reconnect: Re-establishing SSL context
                [DEBUG] 2017-05-30 17:06:25,381 SDK: twTlsClient_Connect: Connecting to server
                [TRACE] 2017-05-30 17:06:25,383 SDK: twWs_Connect: Connected to 192.168.20.37:8443
                [TRACE] 2017-05-30 17:06:25,383 SDK: twWs_Connect: Sent request:
                GET /Thingworx/WS HTTP/1.1
                User-Agent: ThingWorx C SDK
                Upgrade: websocket
                Connection: Upgrade
                Host: 192.168.20.37
                Sec-WebSocket-Version: 13
                Sec-WebSocket-Key: dOMngeyYOntcrChQIIw6Cg==
                Max-Frame-Size: 8192
                appKey: f109ecb5-9e2b-4215-8d3f-6479d5d6b9c1


                [ERROR] 2017-05-30 17:06:35,382 SDK: twWs_Connect: Error trying to connect
                [DEBUG] 2017-05-30 17:06:35,382 SDK: twTlsClient_Reconnect: Re-establishing SSL context
                [DEBUG] 2017-05-30 17:06:35,383 SDK: twTlsClient_Connect: Connecting to server
                [DEBUG] 2017-05-30 17:06:40,384 SDK: twTlsClient_Reconnect: Re-establishing SSL context
                [DEBUG] 2017-05-30 17:06:40,384 SDK: twTlsClient_Connect: Connecting to server
                [TRACE] 2017-05-30 17:06:40,385 SDK: twWs_Connect: Connected to 192.168.20.37:8443
                [TRACE] 2017-05-30 17:06:40,385 SDK: twWs_Connect: Sent request:
                GET /Thingworx/WS HTTP/1.1
                User-Agent: ThingWorx C SDK
                Upgrade: websocket
                Connection: Upgrade
                Host: 192.168.20.37
                Sec-WebSocket-Version: 13
                Sec-WebSocket-Key: mNpsKXV+60P1BROktWYy6Q==
                Max-Frame-Size: 8192
                appKey: f109ecb5-9e2b-4215-8d3f-6479d5d6b9c1


                [ERROR] 2017-05-30 17:06:50,385 SDK: twWs_Connect: Error trying to connect
                [DEBUG] 2017-05-30 17:06:50,385 SDK: twTlsClient_Reconnect: Re-establishing SSL context
                [DEBUG] 2017-05-30 17:06:50,386 SDK: twTlsClient_Connect: Connecting to server
                [DEBUG] 2017-05-30 17:06:55,387 SDK: twTlsClient_Reconnect: Re-establishing SSL context
                [DEBUG] 2017-05-30 17:06:55,388 SDK: twTlsClient_Connect: Connecting to server
                [TRACE] 2017-05-30 17:06:55,389 SDK: twWs_Connect: Connected to 192.168.20.37:8443
                [TRACE] 2017-05-30 17:06:55,389 SDK: twWs_Connect: Sent request:
                GET /Thingworx/WS HTTP/1.1
                User-Agent: ThingWorx C SDK
                Upgrade: websocket
                Connection: Upgrade
                Host: 192.168.20.37
                Sec-WebSocket-Version: 13
                Sec-WebSocket-Key: iDBoFibySUAryVIP/KsWzA==
                Max-Frame-Size: 8192
                appKey: f109ecb5-9e2b-4215-8d3f-6479d5d6b9c1


                [ERROR] 2017-05-30 17:07:05,389 SDK: twWs_Connect: Error trying to connect
                [DEBUG] 2017-05-30 17:07:05,390 SDK: twTlsClient_Reconnect: Re-establishing SSL context
                [DEBUG] 2017-05-30 17:07:05,390 SDK: twTlsClient_Connect: Connecting to server
                [DEBUG] 2017-05-30 17:07:10,392 SDK: twTlsClient_Reconnect: Re-establishing SSL context
                [DEBUG] 2017-05-30 17:07:10,393 SDK: twTlsClient_Connect: Connecting to server
                [TRACE] 2017-05-30 17:07:10,394 SDK: twWs_Connect: Connected to 192.168.20.37:8443
                [TRACE] 2017-05-30 17:07:10,394 SDK: twWs_Connect: Sent request:
                GET /Thingworx/WS HTTP/1.1
                User-Agent: ThingWorx C SDK
                Upgrade: websocket
                Connection: Upgrade
                Host: 192.168.20.37
                Sec-WebSocket-Version: 13
                Sec-WebSocket-Key: PMnGd3t3hmREYmGiLDsI+g==
                Max-Frame-Size: 8192
                appKey: f109ecb5-9e2b-4215-8d3f-6479d5d6b9c1


                [ERROR] 2017-05-30 17:07:20,394 SDK: twWs_Connect: Error trying to connect
                [DEBUG] 2017-05-30 17:07:20,395 SDK: twTlsClient_Reconnect: Re-establishing SSL context
                [DEBUG] 2017-05-30 17:07:20,395 SDK: twTlsClient_Connect: Connecting to server
                [WARN ] 2017-05-30 17:07:25,389 Main: Unable to connect to server.  Trying .booted config file
                [WARN ] 2017-05-30 17:07:25,397 WsEmsProxy::execute() : Server connection failed.  Error Code: 201
                [FORCE] 2017-05-30 17:07:25,500 Main: Shutdown signal received. Restarting ....
                [TRACE] 2017-05-30 17:07:25,500 wsEmsProxy::~wsEmsProxy: Destructor called
                [TRACE] 2017-05-30 17:07:25,500 WsProxy::~WsProxy: Deleting Thing binding list
                [TRACE] 2017-05-30 17:07:25,500 SDK: Sending Msg >>>>>>>>>
                Message Details:
                Version: 1
                Method/Code: 0xb (UNBIND)
                RequestID: 1
                EndpointID:0
                SessionID: 0
                Multipart: 0
                Count: 1
                Name: RedPi

                [DEBUG] 2017-05-30 17:07:25,501 SDK: twMessage_Send: Not authenticated yet
                [ERROR] 2017-05-30 17:07:25,501 SDK: twMessage_Send: Error sending Message with RequestId 1
                [ERROR] 2017-05-30 17:07:25,501 SDK: twApi_UnbindThing: Error creating sending Unbind message
                [DEBUG] 2017-05-30 17:07:25,501 SDK: twMessage_Delete:  Deleting BIND Message: 1
                terminate called without an active exception
                pi@piRed:~/ems/microserver $

                • Re: Connecting Raspberry Pi to a private Thingworx Server
                  emericboyu Explorer

                  Hello Bill,

                  This my config.json:

                   


                  {

                  "ws_servers": [{
                     "host": "192.XXX.XX.XX",
                     "port": 443
                    }],

                   

                  "http_server":  {

                    "host": "192.XXX.XX.XX",     #Static IP address of Raspberry Pi

                    "port": 8080

                  },


                  "logger":   {

                    "level":    "DEBUG"

                  },


                  "auto_bind":    [{

                    "name": "PiThing2",

                    "gateway":  false

                  }],

                   

                  "certificates": {

                    "validate": false,

                    "allow_self_signed":    true

                  } ,


                  "ws_connection":    {

                  "encryption":   "none",

                  "verbose":  true,

                           "msg_timeout":  1000

                  },

                   

                  "appKey": "XXXXXXXXX"

                  }