4 Replies Latest reply on Jun 17, 2016 12:27 AM by scity RSS
    scity Newbie

    Publishing data to the device?

    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?

      • Re: Publishing data to the device?
        christianb Apprentice

        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.

          • Re: Publishing data to the device?
            scity Newbie

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

              • Re: Publishing data to the device?
                scity Newbie

                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.

            • Re: Publishing data to the device?
              scity Newbie

              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.