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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

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

csummers1
9-Granite

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 8
jdass
12-Amethyst
(To:csummers1)

Can you check the validity of the application key used?

csummers1
9-Granite
(To:jdass)

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

Hi,

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

 

Thanks!

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).

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!

Huh, interesting! How did you do that?

 

Although curious as I was previous able to bind properties and then suddenly not. Also my user is Administrator - the one that it automatically created when you install Thingworx.

The user that the Edge is using to communicate with the platform needs read/write permissions on the properties of the Thing you want to update. You also need to give execute permissions to the following services:

  • SetPropertyValues
  • UpdatePropertyValues
  • GetPropertySubscriptions
  • UpdateSubscribedPropertyValues

Initially, I gave the user the permissions on all services and it worked. Then I nailed it down to the only services required, in order not to give permissions that are not required.

 

So now, the platform is configured to read only from the cache, so, no longer pulling data, and this is the Edge that is pushing values into the cache when values are changing.

slangley
23-Emerald II
(To:ncarbonneau)

Hi @csummers1.

 

If you found a solution to your issue, please post it here for the benefit of others who may have the same problem.

 

Regards.

 

--Sharon

Top Tags