Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Hi Team,
I'm getting this error while connecting EMS on Raspberry Pi with ThingWorx server.
[DEBUG] 2018-05-11 19:39:40,950 SDK: twTlsClient_Create: Initializing TLS Client
[ERROR] 2018-05-11 14:09:41,3 UnencryptedClientStream::doopen: Error opening socket. Error: 111
[ERROR] 2018-05-11 14:09:41,4 HttpClient::initialize: Exception while opening connection request to 127.0.0.1. Error: Error opening non-TLS socket [127.0.0.1:8000]
[DEBUG] 2018-05-11 14:09:41,4 TlsStream::doclose: Disconeccting socket
[DEBUG] 2018-05-11 19:39:41,4 SDK: twTlsClient_Close: Disconnecting from server
[DEBUG] 2018-05-11 19:39:41,5 SDK: twTlsClient_Close: Disconnecting from server
[DEBUG] 2018-05-11 14:09:41,4 HttpClient::processReq: Error initializing stream.
[ERROR] 2018-05-11 14:09:41,4 luaBindings::httpPost: Error POSTing to HTTP Server at 127.0.0.1/Thingworx/Things/LocalEms/Services/AddEdgeThing
[INFO ] 2018-05-11 14:09:41,4 PiThing: Error occured while accessing EMS. Checking isConnected.
[DEBUG] 2018-05-11 19:39:41,5 SDK: twTlsClient_Create: Initializing TLS Client
[ERROR] 2018-05-11 14:09:41,6 UnencryptedClientStream::doopen: Error opening socket. Error: 111
[ERROR] 2018-05-11 14:09:41,7 HttpClient::initialize: Exception while opening connection request to 127.0.0.1. Error: Error opening non-TLS socket [127.0.0.1:8000]
[DEBUG] 2018-05-11 14:09:41,7 TlsStream::doclose: Disconeccting socket
[DEBUG] 2018-05-11 19:39:41,7 SDK: twTlsClient_Close: Disconnecting from server
[DEBUG] 2018-05-11 19:39:41,7 SDK: twTlsClient_Close: Disconnecting from server
[DEBUG] 2018-05-11 14:09:41,7 HttpClient::processReq: Error initializing stream.
[ERROR] 2018-05-11 14:09:41,7 luaBindings::httpGet: Error GETing from HTTP server at 127.0.0.1/Thingworx/Things/LocalEms/Properties/isConnected
[INFO ] 2018-05-11 14:09:41,7 PiThing: EMS is available: false, online: false
Any help is much appreciated. Also my 30 days free trail period is getting over by today(25th May) for ThingWorx composer server. can the date will be extended as I didn't complete my testing?
When approaching the end of the 30-day hosted trials on the Developer Portal, we recommend exporting all relevant Entities and then importing them into one of our 120-day self-hosted trials.
DevPortal downloads page: https://developer.thingworx.com/resources/downloads
At the end of the 30-day hosted trial, the entire server is deleted with no way to recover any non-Exported Entities.
As for Raspberry Pi connectivity, I'd recommend the DevPortal's Raspberry Pi guide here: https://developer.thingworx.com/resources/guides/thingworx-raspberry-pi-quickstart
Thank you,
Jason
I have got the 120 days trail now and downloaded the latest version of EMS.
EMS is getting connected to Thingworx server (isConnected = true).
By going through Composer (TW server), I can Monitor my remote thing 'PiThing'.
While running luaScriptResouce, the execution stops at thingworx.handler: Creating a new handler
And I can't see "EMS is Online: true".
So while trying to manage binding, am always getting "Error browsing properties; be sure remote thing is connected properly and configured".
Please support; I was struggling to move forward....
Moreover, as it is a test application, I disabled SSL completely(Insecure configuration).
This is what I can see from Application Log:
2018-06-11 17:29:53.433+0530 [L: ERROR] [O: c.t.w.BaseService] [I: ] [U: Administrator] [S: ] [T: http-nio-8080-exec-1] [context: com.thingworx.webservices.context.HttpExecutionContext@213b2031][message: Unable to Invoke Service GetRemoteMetadata on PiThing : null]
2018-06-11 17:29:57.942+0530 [L: ERROR] [O: c.t.w.BaseService] [I: ] [U: Administrator] [S: ] [T: http-nio-8080-exec-6] [context: com.thingworx.webservices.context.HttpExecutionContext@241eb5c][message: Unable to Invoke Service GetRemoteMetadata on PiThing : null]
2018-06-11 17:29:58.940+0530 [L: ERROR] [O: c.t.w.BaseService] [I: ] [U: Administrator] [S: ] [T: http-nio-8080-exec-4] [context: com.thingworx.webservices.context.HttpExecutionContext@54178b88][message: Unable to Invoke Service GetRemoteMetadata on PiThing : null]
2018-06-11 17:30:53.617+0530 [L: ERROR] [O: c.t.w.BaseService] [I: ] [U: Administrator] [S: ] [T: http-nio-8080-exec-8] [context: com.thingworx.webservices.context.HttpExecutionContext@3d38ecdb][message: Unable to Invoke Service GetRemoteMetadata on PiThing : null]
Just checking, but are you following the instructions in the Developer Portal's Raspberry Pi guide?
https://developer.thingworx.com/resources/guides/thingworx-raspberry-pi-quickstart
Since you're now utilizing a 120-day trial, you'll need to modify the instructions slightly, as the EMS config is assuming a connection to the SSL / Port 443 hosted servers.
Even that was my doubt.
So should I need to issue certificate locally for ssl where my tomcat is running?
Currently ThingWorx server is running on the Tomcat server with HTTP/8080 port.
Thanks.
Modifying that guide's suggested config.lua and config.json files is beyond the scope of what the DevPortal can support.
We make sure that our guides work versus specific environments (in this case, versus our 30-day hosted servers), but we can't cover every permutation.
Fortunately, EMS configuration is a *VERY* popular topic. I believe you should find pre-existing articles which can help you, if not just getting direct community feedback.
Thank you,
Jason
Yes, am using 120 days trail. But I exactly followed the 'Installation guide' while setting up my tomcat server.
Could you please help me to clarify following 2 queries:
1. Should I replace the protocol "HTTP/1.1" in all the places with "org.apache.coyote.http11.Http11NioProtocol"?
Or only in Connection Port:8443? And most importantly, should I remove the comment line as given below for
Connection Port:8443 entry line? (because in the installation guide, the comment line is there!-- -->) Also, do I need to have the certificate keystore value to be included?
Here is my server.xml under conf folder. Please review and say your comments.
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL/TLS HTTP/1.1 Connector on port 80
-->
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
-->
<!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443
This connector uses the NIO implementation. The default
SSLImplementation will depend on the presence of the APR/native
library and the useOpenSSL attribute of the
AprLifecycleListener.
Either JSSE or OpenSSL style configuration may be used regardless of
the SSLImplementation selected. JSSE style configuration is used below.
-->
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS">
<SSLHostConfig>
<Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
type="RSA" />
</SSLHostConfig>
</Connector>
<!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2
This connector uses the APR/native implementation which always uses
OpenSSL for TLS.
Either JSSE or OpenSSL style configuration may be used. OpenSSL style
configuration is used below.
-->
2. What is the port number should I use in the config.json?
Currently I'm using "port": 80 and here is my config.json file:
{
"ws_servers": [{
"host": "xx.xx.xx.xx",
"port": 80
}],
"http_server": {
"host": "localhost",
"port": 8000,
"ssl":true,
"authenticate":false
"use_default_certificate": true
},
"appKey": "xxxxxxxxxxxxxxxxxx",
"logger": {
"level": "DEBUG"
},
"auto_bind": [{
"name": "PiThing",
"gateway": false
}],
"certificates": {
"validate": false,
"allow_self_signed":true
},
"ws_connection": {
"encryption": "ssl",
"verbose": true,
"msg_timeout": 1000
}
}
would be grateful for your support!! Thanks!!
On this page in the Installation document:
In the "Install Tomcat" section, step 20, it says the following:
Replace HTTP/1.1 with protocol="org.apache.coyote.http11.Http11NioProtocol"
The entire "protocol" line in server.xml should be replaced, as per above.
For instance, here is that entire section in my own Port 80 native setup:
<!-- A "Connector" represents an endpoint by which requests are received and responses are returned. Documentation at : Java HTTP Connector: /docs/config/http.html Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html Define a non-SSL/TLS HTTP/1.1 Connector on port 80 --> <Connector port="80" protocol="org.apache.coyote.http11.Http11NioProtocol" connectionTimeout="20000" redirectPort="8443" /> <!-- A "Connector" using the shared thread pool--> <!--
The installation guide does not recommend any modifications in server.xml except that one line.
However, once again, the installation document linked above assumes Port 80 connectivity.
You are utilizing a different Port and, I believe, not using SSL. The TWX installation instructions are not explicitly written to work with the instructions in the Raspberry Pi guide. The Pi guide assumes a connection to the 30-day hosted server, not the 120-day self-hosted trial.
As such, the instructions in the DevPortal's Raspberry Pi guide concerning config.lua and config.json here will need to be modified:
https://developer.thingworx.com/resources/guides/thingworx-raspberry-pi-quickstart
Thank you,
Jason