Skip to main content
1-Visitor
June 16, 2016
Solved

Publishing data to the device?

  • June 16, 2016
  • 2 replies
  • 4326 views

ThingWorx has made it very easy to get data from the device, but I have been facing difficulty in the platform-to-device communication. For example, I can get a reading from one of the devices connected. But I am clueless as to how to send messages to any device connected to the platform?

Best answer by scity

Finally, I have found how to make it work. Services, defined on the thing side, and then called from the thingworx platforms does the job.

2 replies

1-Visitor
June 16, 2016

First, let's clarify what "sending a message" means. It can be

  • a property setting on the device
  • load a file on the device
  • call a device service
  • remote desktop session
  • etc.

All of the mentioned cases are covered well by examples of the C SDK. If you could tell how you connect your device (EMS? REST? SDK?) and what you want to achieve it will be easier to show you how to do this.

scity1-VisitorAuthor
1-Visitor
June 16, 2016

'Sending a message' for me is : 1. A property setting on the device, and 2. Call a device service.

It would be very convenient for me not to use SDKs if possible.

scity1-VisitorAuthor
1-Visitor
June 16, 2016

I apologize for not being explicit. Here's the complete scenario:

We have a thing (raspberry pi) which is connected to the ThingWorx platform and is running one of the nodejs thing-agent files. It was very easy for me to get data. (in fact, it was already in the default nodejs file)

Now, I want to do something of this sort. In my mashup I want to have a button. 1.) Upon clicking, the button should ask the device to send it the required values ( which the raspberry gets from sensors and other devices connected to it) 2.) It should, upon clicking some other specific button, it performs another action which I will define in the nodejs script running on the device.

Thanks.

scity1-VisitorAuthorAnswer
1-Visitor
June 17, 2016

Finally, I have found how to make it work. Services, defined on the thing side, and then called from the thingworx platforms does the job.

1-Visitor
September 11, 2017

Hi there, I'm facing the same problem. I want to run a code script on raspberry pi by clicking a button on thingworx mashup. Unfortunately I didn't understand your solution. Can you explain it more clearly?

Thank you