Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Hi, i am trying for quite some time to get my raspberry pi connected to TW using kwyboard and mouse.
i am getting this errors
[DEBUG] 2019-06-02 23:16:40,32 SDK: twTlsClient_Connect: Connecting to server
[ERROR] 2019-06-02 23:16:40,43 SDK: TW_NEW_SSL_CLIENT: SSL handshake error. Error: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol.
[ERROR] 2019-06-02 23:16:40,43 SDK: Error intializing SSL connection
[ERROR] 2019-06-02 23:16:40,43 SDK: twWs_Connect: Error restarting socket. Error 0
[DEBUG] 2019-06-02 23:16:45,44 SDK: twTlsClient_Reconnect: Re-establishing SSL context
[DEBUG] 2019-06-02 23:16:45,44 SDK: twTlsClient_Connect: Connecting to server
[ERROR] 2019-06-02 23:16:45,57 SDK: TW_NEW_SSL_CLIENT: SSL handshake error. Error: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol.
and i am using this config.json file
{
"ws_servers": [{
"host": "192.168.1.206",
"port": 80
}],
"http_server": {
"host": "127.0.0.1",
"port": 8080,
"ssl": false,
"authenticate": false
},
"appKey": "a35939d3-4410-463b-aa7e-d4537c5d5e76",
"logger": {
"level": "DEBUG"
},
"certificates": {
"validate": false,
"allow_self_signed":true
},
"ws_connection": {
"encryption": "ssl",
"verbose": true,
"msg_timeout": 1000
}
}
i would like to mention that i can connect to the TW instance from the raspberry pi but i cannot get the EMS connected and i dont know ehy :(
Solved! Go to Solution.
Can you browse to your ThingWorx server with this URL? - note the S in https:
https://192.168.1.206:80/ThingWorx
Because port 80 is usually used for http connections, I would guess you are not able to connect.
To allow the EMS to connect to an unsecure server, change your config:
"ws_connection": { "encryption" : "none" },
Hello gabitudor,
the error indicates, that you have some troubles establishing an SSL connection. Looking at your config.json file, I'm not certain, that you want to have SSL or not.
Your ws_server is configured to port 80, which indicates non SSL.
However your ws_connection indicates a SSL connection.
Can you please first fix one of the 2 places, to either SSL or non-SSL and then post a new error message in case?
Best regards,
Sebastian
hi Sebastian, thanks for your replay.
i made 2 modifications, one at a time. changing the port to 88 and letting the rest of config.json unchanged and received this errors
[ERROR] 2019-06-03 15:37:40,469 SDK: Error intializing SSL connection
[ERROR] 2019-06-03 15:37:40,469 SDK: twWs_Connect: Error restarting socket. Error 0
[DEBUG] 2019-06-03 15:37:45,469 SDK: twTlsClient_Reconnect: Re-establishing SSL context
[DEBUG] 2019-06-03 15:37:45,469 SDK: twTlsClient_Connect: Connecting to server
[ERROR] 2019-06-03 15:37:46,208 SDK: TW_NEW_SSL_CLIENT: SSL handshake error. Error: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol.
and port 88 changinf the false to true in the config.json at http_server, ssl:true and received this
[FORCE] 2019-06-03 12:43:17,747 ./wsems: Initializing EMS ....
[FORCE] 2019-06-03 12:43:17,747 main: Using config file /home/pi/microserver/etc/config.json
[INFO ] 2019-06-03 12:43:17,747 ./wsems: Creating the WsEms proxy.
[DEBUG] 2019-06-03 12:43:17,747 DutyCycle::calculateDutyCycleTimePeriods: m_ConnectPeriod: 60000
[DEBUG] 2019-06-03 12:43:17,747 DutyCycle::calculateDutyCycleTimePeriods: m_DisconnectPeriod: 0
[INFO ] 2019-06-03 12:43:17,748 ./wsems: Starting HTTP Server.
[INFO ] 2019-06-03 12:43:17,748 Main: Encryption is enabled on HTTP Server.
[ERROR] 2019-06-03 12:43:17,748 Main: Failed to get HTTP Server certificate.
Can you browse to your ThingWorx server with this URL? - note the S in https:
https://192.168.1.206:80/ThingWorx
Because port 80 is usually used for http connections, I would guess you are not able to connect.
To allow the EMS to connect to an unsecure server, change your config:
"ws_connection": { "encryption" : "none" },
you are right, i am not able to connect to it. however i changed the port on which thingworx is installed, from 80 to 88 and let it set to none and it worket. now the socket is connected. thanks so much!