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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Raspberry pi ThingWorx SSL error

MS_Santos
15-Moonstone

Raspberry pi ThingWorx SSL error

I have an error to communicate my raspberrypi with ThingWorx the same as the SSL error but I didn't enable this option how do I get the error out?

ACCEPTED SOLUTION

Accepted Solutions
wcui
16-Pearl
(To:MS_Santos)

Per below errors, it seems port 8000~8004 already used by other application on your raspberrypi OS.

     [ERROR] 2022-09-21 12:40:45,309 httpserver: Server socket error: Address already in use [*:8000]
    [ERROR] 2022-09-21 12:40:45,309 httpServer: unable to bind http server to port=8000, trying next port.

 

From you confg.json, I can see no port is configured with below settings. In this case, wsems.exe will use default 8000 port and if that fail it try next port by plus 1. I suggest to change to an available port then try restart EMS.

 

    "http_server": {
         "ssl": false,
        "authenticate": false
    },

    ---->

    "http_server": {
         "host": "localhost",
         "port": 8xxx,
         "ssl": false,
         "authenticate": false
},

View solution in original post

9 REPLIES 9
wcui
16-Pearl
(To:MS_Santos)

Are you running WSEMS or Edge SDK app on respberrypi?

Can you give more details about the SSL error and what application you are using to communicate with ThingWorx?

MS_Santos
15-Moonstone
(To:wcui)

I'm using this link to do the procedure https://developer.thingworx.com/en/resources/guides/setup-raspberry-pi-iot-device/mlp-pi-connect-ems , I'm on step 6 , I'm giving the sudo command ./wsems

wcui
16-Pearl
(To:MS_Santos)

I see below error in wsems log. Can you check if Port 8443 is correct and assure it is not blocked by firewall on TW server ?

you can try ping tw server and its port from raspberrypi to see if connection is possible or not.

    Unable to connect to server.

 

Also, you can try extend timeout settings, socket_read_timeout, connect_timeout,  per below link, 

http://support.ptc.com/help/thingworx/edge_microserver/en/#page/c_sdk/v5.4.0_c_ems_wsems_configuration_websocket.html

 

Besides, if you use self-signed cert on TW side, please add below setting to pass the check.

"http_server": {

    "allow_self_signed": true

MS_Santos
15-Moonstone
(To:wcui)

Port 8443 is released in TW Server Firewall even on inbound when outbound

When you say ping on the raspberrypi port which serial because ping is normal for him

Where do you say to put this command in TW? or in the config.json file
"http_server": {

"allow_self_signed": true

wcui
16-Pearl
(To:MS_Santos)

Yes, please put "allow_self_signed": true inside below section of config.json.

wcui_0-1663636253767.png

 

Do you mean below commands running on Raspberrypi returned good results?

  ping 192.168.18.80 -c 4 //4 pings

  telnet 192.168.18.80 8443

 

besides, please also try extending timeout settings, socket_read_timeout, connect_timeout,  per below link, 

http://support.ptc.com/help/thingworx/edge_microserver/en/#page/c_sdk/v5.4.0_c_ems_wsems_configurati...

 

 

MS_Santos
15-Moonstone
(To:wcui)

Hello ,

I managed to pass through port 8443 but now I have an SSL error

 

pi@raspberrypi:~/Downloads/microserver $ sudo ./wsems
[FORCE] 2022-09-21 12:40:45,306 ./wsems: Initializing EMS ....
[FORCE] 2022-09-21 12:40:45,306 main: Using config file /home/pi/Downloads/microserver/etc/config.json
[INFO ] 2022-09-21 12:40:45,306 ./wsems: Creating the WsEms proxy.
[INFO ] 2022-09-21 12:40:45,306 ./wsems: Starting HTTP Server.
[WARN ] 2022-09-21 12:40:45,307 Main: Encryption is disabled on HTTP Server.
[WARN ] 2022-09-21 12:40:45,307 Main: TLS Hostname Validation Is Disabled
[WARN ] 2022-09-21 12:40:45,307 Main: Authentication is disabled on the HTTP Server.
[FORCE] 2022-09-21 12:40:45,307 httpServer: starting http server port=8000
[INFO ] 2022-09-21 12:40:45,307 ./wsems: Initializing the ThingWorx REST interface.
[INFO ] 2022-09-21 12:40:45,307 wsEmsProxy::initialize: FIPS is disabled.
[INFO ] 2022-09-21 12:40:45,307 wsEmsProxy::initialize: Encryption is enabled on Web Socket connection.
[WARN ] 2022-09-21 09:40:45,308 SDK: SDK Version: 2.2.12
[WARN ] 2022-09-21 09:40:45,309 SDK: TLS Library: OpenSSL
[WARN ] 2022-09-21 09:40:45,309 SDK: TLS Library Version: 1.1.1j
[ERROR] 2022-09-21 12:40:45,309 httpserver: Server socket error: Address already in use [*:8000]
[ERROR] 2022-09-21 12:40:45,309 httpServer: unable to bind http server to port=8000, trying next port.
[ERROR] 2022-09-21 12:40:45,309 httpserver: Server socket error: Address already in use [*:8001]
[ERROR] 2022-09-21 12:40:45,309 httpServer: unable to bind http server to port=8001, trying next port.
[ERROR] 2022-09-21 12:40:45,310 httpserver: Server socket error: Address already in use [*:8002]
[ERROR] 2022-09-21 12:40:45,310 httpServer: unable to bind http server to port=8002, trying next port.
[ERROR] 2022-09-21 12:40:45,310 httpserver: Server socket error: Address already in use [*:8003]
[ERROR] 2022-09-21 12:40:45,310 httpServer: unable to bind http server to port=8003, trying next port.
[ERROR] 2022-09-21 12:40:45,311 httpserver: Server socket error: Address already in use [*:8004]
[ERROR] 2022-09-21 12:40:45,311 httpServer: unable to bind http server to port=8004, trying next port.
[INFO ] 2022-09-21 12:40:45,316 WsProxy::initialize: EMS Version 5.4.10.1509
[INFO ] 2022-09-21 12:40:45,316 WsProxy::initialize: twApi singleton initialized
[WARN ] 2022-09-21 12:40:45,316 WsProxy::initialize: Certificate validation is disabled.
[INFO ] 2022-09-21 12:40:45,316 wsEmsProxy::initialize: Initialization complete!

192.168.18.80:8443-->[INFO ] 2022-09-21 12:40:45,317 ./wsems: Starting the connection.
[ERROR] 2022-09-21 09:40:50,387 SDK: TW_NEW_SSL_CLIENT: SSL handshake error. Error: error:1408F10B:SSL routines:ssl3_get_record:wrong version number.
[ERROR] 2022-09-21 09:40:50,388 SDK: twWs_Connect: Error restarting socket. Error 0
[ERROR] 2022-09-21 09:40:55,396 SDK: TW_NEW_SSL_CLIENT: SSL handshake error. Error: error:1408F10B:SSL routines:ssl3_get_record:wrong version number.
[ERROR] 2022-09-21 09:40:55,397 SDK: twWs_Connect: Error restarting socket. Error 0

https://www.ptc.com/en/support/article/CS377365 may help? at least it is the exact error you have.

wcui
16-Pearl
(To:MS_Santos)

Per below errors, it seems port 8000~8004 already used by other application on your raspberrypi OS.

     [ERROR] 2022-09-21 12:40:45,309 httpserver: Server socket error: Address already in use [*:8000]
    [ERROR] 2022-09-21 12:40:45,309 httpServer: unable to bind http server to port=8000, trying next port.

 

From you confg.json, I can see no port is configured with below settings. In this case, wsems.exe will use default 8000 port and if that fail it try next port by plus 1. I suggest to change to an available port then try restart EMS.

 

    "http_server": {
         "ssl": false,
        "authenticate": false
    },

    ---->

    "http_server": {
         "host": "localhost",
         "port": 8xxx,
         "ssl": false,
         "authenticate": false
},

wcui
16-Pearl
(To:wcui)

@MS_Santos please mark above reply as "Accept as Solution" if it helps reolve the issue.

Announcements


Top Tags