Skip to main content
1-Visitor
December 22, 2020
Solved

raspberry pi 4 connection error 111

  • December 22, 2020
  • 1 reply
  • 3195 views

Hi

Been scratching my head long enough. Can anyone offer guidance on the following error - Thank you

pi@raspberrypi:~/microserver $ sudo ./wsems
[FORCE] 2020-12-22 14:52:28,215 ./wsems: Initializing EMS ....
[FORCE] 2020-12-22 14:52:28,215 main: Using config file /home/pi/microserver/etc/config.json
[INFO ] 2020-12-22 14:52:28,215 ./wsems: Creating the WsEms proxy.
[INFO ] 2020-12-22 14:52:28,215 ./wsems: Starting HTTP Server.
[WARN ] 2020-12-22 14:52:28,215 Main: Encryption is disabled on HTTP Server.
[WARN ] 2020-12-22 14:52:28,215 Main: TLS Hostname Validation Is Disabled
[WARN ] 2020-12-22 14:52:28,215 Main: Authentication is disabled on the HTTP Server.
[INFO ] 2020-12-22 14:52:28,216 ./wsems: Initializing the ThingWorx REST interface.
[FORCE] 2020-12-22 14:52:28,216 httpServer: starting http server port=8080
[INFO ] 2020-12-22 14:52:28,216 wsEmsProxy::initialize: FIPS is disabled.
[INFO ] 2020-12-22 14:52:28,216 wsEmsProxy::initialize: Encryption is enabled on Web Socket connection.
[ERROR] 2020-12-22 14:52:28,216 httpserver: Server socket error: Address already in use [127.0.0.1:8080]
[ERROR] 2020-12-22 14:52:28,216 httpServer: unable to bind http server to port=8080, trying next port.
[ERROR] 2020-12-22 14:52:28,216 httpserver: Server socket error: Address already in use [127.0.0.1:8081]
[ERROR] 2020-12-22 14:52:28,216 httpServer: unable to bind http server to port=8081, trying next port.
[WARN ] 2020-12-22 14:52:28,217 SDK: SDK Version: 2.2.11
[WARN ] 2020-12-22 14:52:28,217 SDK: TLS Library: OpenSSL
[WARN ] 2020-12-22 14:52:28,217 SDK: TLS Library Version: 1.1.1c
[INFO ] 2020-12-22 14:52:28,225 WsProxy::initialize: EMS Version 5.4.9.1154
[INFO ] 2020-12-22 14:52:28,225 WsProxy::initialize: twApi singleton initialized
[WARN ] 2020-12-22 14:52:28,225 WsProxy::initialize: Certificate validation is disabled.
[INFO ] 2020-12-22 14:52:28,226 wsEmsProxy::initialize: Initialization complete!

localhost:8443-->[INFO ] 2020-12-22 14:52:28,227 ./wsems: Starting the connection.
[ERROR] 2020-12-22 14:52:36,987 SDK: twTlsClient_ConnectSession: Error initializing socket connection. Err = 111
[ERROR] 2020-12-22 14:52:36,987 SDK: twWs_Connect: Error restarting socket. Error 111
[ERROR] 2020-12-22 14:52:41,990 SDK: twTlsClient_ConnectSession: Error initializing socket connection. Err = 111
[ERROR] 2020-12-22 14:52:41,990 SDK: twWs_Connect: Error restarting socket. Error 111

config.json

{
 "ws_servers": [{
 "host": "localhost",
 "port": 8443
 }],
 "appkey": "7e5768b6-f6c9-4259-99c9-c8e1a2e73d39",
 "http_server": {
 "host": "127.0.0.1",
 "port": 8080,
 "use_default_certificate": true,
 "ssl": false,
 "authenticate": false
 },
 "logger": {
 "level": "INFO"
 },
 "certificates": {
 "validate": false,
 "disable_hostname_validation": true
 }
}

 

Best answer by Rick-Stanley

Are you able to follow the steps in the guide to connect to a free hosted trial instance?

 

is the EMS running on a different piece of hardware than the hardware where ThingWorx Foundation is running? If so, you will need to enter the IP address where ThingWorx Foundation is running into the config.json file of the EMS. 

1 reply

5-Regular Member
December 22, 2020

The log file shows that some process is already running on port 8080 and port 8081. Do you have more than one instance of the EMS running already?

 

Do you have ThingeWorx Foundation running on this same machine? What happens when you browse to:

https://localhost:8443/Thingworx 

You should be able to browse to ThingWorx at the hostname and port where the EMS is trying to connect.

Can you connect to a free hosted trial of ThingWorx by following the directions in this guide:

https://developer.thingworx.com/en/resources/guides/thingworx-raspberry-pi-quickstart

 

 

 

1-Visitor
December 22, 2020

Thank you for the quick response.

 

No I don't believe I have another instance of EMS already running - will check though.

 

I have ThingWorx Foundation running on a separate laptop. When I browse to: https:localhost:8443/Thingworx it takes me to https://localhost:8443/Thingworx/Composer/index.html#/modeler/browse/Project

I am following the Raspberry Pi quick guide although trying to connect to local host rather than ThingWorx hosted trial.

5-Regular Member
December 23, 2020

Hi @DS_9742416 ,

 

Have you checked the port using any tool. The port number should be in openstate.

If host/port is blocked then if it is iptables as the firewall then you need to add a rule to allow the connection.

Are you able to connect unsecured ?

Maybe you need to set 

 

"ws_connection": {

"encryption": "SSL",

"verbose": true,

"msg_timeout": 1000

},

 

Hope it helps,