Solved
Permissions while connecting C-SDK to ThingWorx.
Hi Team,
I have a device connected to a remote Thing by using an AppKey (DefaultAppkey) with no permissions (The associated User has no permissions). What I'm trying to do is:
- To use that DefaultAppkey only to have the device connected to the Thingworx (appearing in the Unbound Thing List), so that I can create a Remote Thing, a new User (DeviceUser) and Appkey (DeviceAppKey) (with specific permissions to run services and read/write remote properties)
- After completing the last step, I want to send that new DeviceAppKey to the device through a remote service (Let's call it SendAppKey_Service) and set some Remote properties.
I've made a service to create all these Entities, using EntityServices, set the remote properties and run the Remote Service to send the DeviceAppKey to the device (Let me call it CreateDeviceEntities_Service).
That CreateDeviceEntities_Service is called from the Thingworx side, by an Administrator User, once the device appears in the Unbound Thing list (connected using the DefaultAppkey ).
I can run the CreateDeviceEntities_Service on thingworx side as Administrator but both SendAppKey_Service and setting remote properties just don't work.
I've already tried to run everything step by step and manually, and I can't set the remote properties (it allows me to change its value but once I refresh the properties, it returns to its original value)
and the SendAppKey_Service doesn't run properlly.
I've already tried to run everything step by step and manually, and I can't set the remote properties (it allows me to change its value but once I refresh the properties, it returns to its original value)
and the SendAppKey_Service doesn't run properlly.
Even when the Remote Thing is created, I have that error message in the C-SDK logs:
[ERROR] 2019-07-19 12:15:02,806: twMessaging::handleMessage: Response ID 6 has code 160: Entity DeviceThing.T does not exist or is not yet associated with a Thing
[ERROR] 2019-07-19 12:15:02,806: twSubscribedPropsMgr_PushPropertyInfoList: Error pushing properties for DeviceThing.T. Error: 1110.
[ERROR] 2019-07-19 12:15:02,806: twSubscribedPropsMgr_PushProperties: error pushing or persisting property list, code: 1110
[ERROR] 2019-07-19 12:15:02,806: twSubscribedPropsMgr_PushPropertyInfoList: Error pushing properties for DeviceThing.T. Error: 1110.
[ERROR] 2019-07-19 12:15:02,806: twSubscribedPropsMgr_PushProperties: error pushing or persisting property list, code: 1110
What would be the best way to implement this workflow ?
Is it possible o set a remote property value and run a remote service while using an Administrator User in the Thingworx but having the device connected through an AppKey with no permissions ? In that case, am I supposed to get permissions errors in the Thingworx Log ?
Note: I'm using ThingWorx 8.4.2. and ThingWorx Edge C-SDK-2-2-3-1545 running in the device.
Thanks in advance.

