Skip to main content
1-Visitor
May 16, 2018 2:07 PM UTC
Question

Can't connect Raspberry Pi Properties to ThingWorx Composer - Error binding properties

  • I have a raspberry Pi 3 set up and have my EMS running and the lua script resource running.
  • The raspberry pi thing is showing isConnected as true on my Thingworx platform.
  • The properties on the raspberry pi are updating every 30 seconds as instructed
  • Thingworx Composer is open at localhost:8080/Thingworx/Composer

However, property values are not being pushed to Thingworx. My pi connection was working perfectly up until the middle of April and then wan't used at all until I tried to open my project again today.

Remote bindings are already set up but when I go again to the "manage property bindings tab" I get a message saying "Error browsing properties. Be sure the remote device/server is connected and configured properly".

 

I now also get the following message in my lua script repeated:

[INFO ] 2018-05-16 14:38:32,799 PiThing: EMS is available: true, online: true
[WARN ] 2018-05-16 14:38:32,799 thingworx.server: Could not set properties on server. code: 500, resp:
[DEBUG] 2018-05-16 14:38:34,305 thingworx.server: Created batch of 6 properties to be pushed to the server (last batch of group).
[DEBUG] 2018-05-16 14:38:34,309 SDK: twTlsClient_Create: Initializing TLS Client
[DEBUG] 2018-05-16 14:38:34,388 TlsStream::doclose: Disconeccting socket
[DEBUG] 2018-05-16 14:38:34,389 SDK: twTlsClient_Close: Disconnecting from server
[DEBUG] 2018-05-16 14:38:34,390 SDK: twTlsClient_Close: Disconnecting from server
[INFO ] 2018-05-16 14:38:34,389 PiThing: Error occured while accessing EMS. Checking isConnected.
[DEBUG] 2018-05-16 14:38:34,390 SDK: twTlsClient_Create: Initializing TLS Client
[DEBUG] 2018-05-16 14:38:34,392 TlsStream::doclose: Disconeccting socket
[DEBUG] 2018-05-16 14:38:34,392 SDK: twTlsClient_Close: Disconnecting from server
[DEBUG] 2018-05-16 14:38:34,393 SDK: twTlsClient_Close: Disconnecting from server
[INFO ] 2018-05-16 14:38:34,394 PiThing: EMS is available: true, online: true

Here is my config.json:

{
 "ws_servers": [{
 "host": "localhost",
 "port": 9000
 }],
 "http_server": {
 "host": "127.0.0.1",
 "port": 8000,
 "ssl": false,
 "authenticate": false
 },
 "appKey": "c9291758-bb3e-45e4-83a8-fb8b8abcff35",
 "logger": {
 "level": "DEBUG"
 },
 "auto_bind": [
 {
 "name": "PiThing",
 "host": "127.0.0.1",
 "port": 8001,
 "protocol": "http",
 "identifier": "KitchenPiThing",
 "gateway": false
 }],
 "certificates": {
 "validate": false,
 "allow_self_signed": true
 },
 "ws_connection": {
 "encryption": "none",
 "verbose": true,
 "msg_timeout": 10000
 }
}

And my config.lua:

scripts.log_level = "DEBUG"
scripts.PiThing = {
 file = "thing.lua",
 template = "PiTemplate",
 identifier = "KitchenPiThing",
 scanRate = 1000,
 taskRate = 30000
 }

scripts.rap_host = "127.0.0.1"
scripts.rap_port = 8000
scripts.rap_ssl = false
scripts.rap_validate = false


scripts.script_resource_host = "127.0.0.1"
scripts.script_resource_port = 8001
scripts.script_resource_ssl = false
scripts.script_resource_authenticate = false

Thanks in advance,

Charlotte

8 replies

13-Aquamarine
May 16, 2018 2:17 PM UTC

Can you check the validity of the application key used?

Translate
csummers11-VisitorAuthor
1-Visitor
May 16, 2018 2:19 PM UTC

Yes, the app key is valid until 23/2/2022

Translate
1-Visitor
Jun 16, 2018 9:56 AM UTC

Hi,

Did you find out what was the cause of the issue? I have exactly the same issue and cannot find it!

 

Thanks!

Translate
csummers11-VisitorAuthor
1-Visitor
Jun 18, 2018 7:41 AM UTC

Unfortunately not. Instead though I set up node-RED on my raspberry pi and used that to create the connection. If you follow this tip guide it will tell you everything you need to know to get your connection.

 

(Note that you will have to recreate your 'things' because for the node-RED connection they need to be generic things rather than the remote things used for the EMS connection).

Translate
1-Visitor
Jun 18, 2018 8:02 AM UTC

Hey, I finally found out what was the issue in my case. The answer was in the error message, I just did not understood at first:

thingworx.server: Could not set properties on server. code: 500, resp:

The user that I had configured to access the platform from the Edge had permissions to READ the properties, but I forgot to give the permissions to this user to WRITE properties. Once I did that, the error message dissapeared, and the Edge was able to push and update the properties on the platform. 

 

Hope it helps!

Translate