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

how to get Raspberry pi EMS connectd to Thingworx comper running on my pc?

SOLVED
Highlighted
Level 1

how to get Raspberry pi EMS connectd to Thingworx comper running on my pc?

how to get EMS on Raspberry pi  connectd  to Thingworx composer, running on my pc at this address: localhost/thingworx/composer/index.html?

both my Raspberry-pi and pc are on the same LAN. but when I use my pc´s ip address in config.jason file of Microserver, this error occurs:

[WARN ] 2016-11-12 13:42:10,678 Main: Unable to connect to server.  Trying .booted config file

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: how to get Raspberry pi EMS connectd to Thingworx comper running on my pc?

thanks to you all who contributed on this post,

I have finally found the problem!

the new version of apache tomcat has some security options which prevents remote access to computer's local host; in order to disable this function , the "server.xml" file on "conf" folder of "Apache software foundation" must be editted in the way that the line address="0.0.0.0" be added to the piece of code below:

<Connector port="80" protocol="org.apache.coyote.http11.Http11NioProtocol"

  connectionTimeout="20000"

               redirectPort="8443"

              address="0.0.0.0"

    />

by this new configuration, I could ping and view the local host of my pc on Raspberry pi and so the connection to Thingworx composer running on the local host of my pc was successfully established!!!

5 REPLIES 5

Re: how to get Raspberry pi EMS connectd to Thingworx comper running on my pc?

Forough, please do post your entire config.json file and your log file.

Re: how to get Raspberry pi EMS connectd to Thingworx comper running on my pc?

Hi ​Forough MS​,

Please also make sure that the ports are open for connection.

Also, if you have GUI in Raspberry pi; try opening the URL from your raspberry Pi and check if it works.

Thanks,

Ankit Gupta

Re: how to get Raspberry pi EMS connectd to Thingworx comper running on my pc?

here is my cofig.jason file:

{

"ws_servers":   [{

        "host": "192.168.1.36",

        "port": 80

    }],

"http_server":  {

    "host": "127.0.0.1",

    "port": 8080

},

"appKey":   "2c4342c7-a534-4aa3-9660-4bad4e8d46a6",

"logger":   {

    "level":    "DEBUG"

},

"auto_bind":    [{

        "name": "PiThing",

        "gateway":  false

    }],

"certificates": {

    "validate": false,

    "allow_self_signed":    true

},

"ws_connection":    {

    "encryption":   "none",

    "verbose":  true,

    "msg_timeout":  1000

}

}

by the way, Iḿ using windows 10 and thingworx composer is up and running on my pc. on raspberry, when typing in browser I could access the localhost on my pc but now that is even inaccessible, thought my antivirus is disabled an there is no firewall active! so now Iḿ getting this error:

pi@raspberrypi:~/Downloads/microserver $ sudo ./wsems

[INFO ] 2016-11-15 14:25:30,290 ./wsems: Using config file: /home/pi/Downloads/microserver/etc/config.json

[FORCE] 2016-11-15 14:25:30,290 ./wsems: Starting up ....

[FORCE] 2016-11-15 14:25:30,290 ./wsems: Initializing EMS ....

[FORCE] 2016-11-15 14:25:30,290 main: Using config file /home/pi/Downloads/microserver/etc/config.json

[INFO ] 2016-11-15 14:25:30,290 ./wsems: Creating the WsEms proxy.

[INFO ] 2016-11-15 14:25:30,290 ./wsems: Starting HTTP Server.

[INFO ] 2016-11-15 14:25:30,291 ./wsems: starting http server port= REST interface.

[FORCE] 2016-11-15 14:25:30,291 httpServer: starting http server port=8080

[DEBUG] 2016-11-15 14:25:30,291 httpServer: http server bound to port=8080.

[DEBUG] 2016-11-15 14:25:30,291 SDK: twWs_Create: Initializing Websocket Client for 192.168.1.36:80//Thingworx/WS

[DEBUG] 2016-11-15 14:25:30,291 SDK: twTlsClient_Create: Initializing TLS Client

[DEBUG] 2016-11-15 14:25:30,292 SDK: twApi_Initialize: Websocket Established after 0 tries

[DEBUG] 2016-11-15 14:25:30,293 SDK: subscribedPropsMgr_Initialize: Initializing subscribed properties manager

[DEBUG] 2016-11-15 14:25:30,293 jsonConfigurator::getJsonEntity: Key cert_chain not found

[DEBUG] 2016-11-15 14:25:30,293 jsonConfigurator::getJsonEntity: Key validation_criteria not found

[DEBUG] 2016-11-15 14:25:30,294 jsonConfigurator::getJsonEntity: Parent file not found

[DEBUG] 2016-11-15 14:25:30,294 jsonConfigurator::getJsonEntity: Parent file not found

[INFO ] 2016-11-15 14:25:30,294 wsEmsProxy::initialize: Initialization complete!

192.168.1.36:80-->[INFO ] 2016-11-15 14:25:30,295 ./wsems: Starting the connection.

[DEBUG] 2016-11-15 14:25:30,296 SDK: twTlsClient_Reconnect: Re-establishing SSL context

[DEBUG] 2016-11-15 14:25:30,296 SDK: twTlsClient_Connect: Connecting to server

[ERROR] 2016-11-15 14:25:30,297 SDK: Error intializing socket connection.  Err = 111

Re: how to get Raspberry pi EMS connectd to Thingworx comper running on my pc?

Just so I understand correctly, you said you could ping/ access your ThingWorx server but now you're not able to? Please do remove the http_server section on your config.json, switch the logger level from DEBUG to TRACE and retry. Do post the new set of logs as well.

Re: how to get Raspberry pi EMS connectd to Thingworx comper running on my pc?

thanks to you all who contributed on this post,

I have finally found the problem!

the new version of apache tomcat has some security options which prevents remote access to computer's local host; in order to disable this function , the "server.xml" file on "conf" folder of "Apache software foundation" must be editted in the way that the line address="0.0.0.0" be added to the piece of code below:

<Connector port="80" protocol="org.apache.coyote.http11.Http11NioProtocol"

  connectionTimeout="20000"

               redirectPort="8443"

              address="0.0.0.0"

    />

by this new configuration, I could ping and view the local host of my pc on Raspberry pi and so the connection to Thingworx composer running on the local host of my pc was successfully established!!!