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

Do you need EMS if you have a device that knows how to make web socket requests natively.

jamesso
10-Marble

Do you need EMS if you have a device that knows how to make web socket requests natively.

I have devices from Texas Instruments (TI SmartRF06EB and CC2538) that I can load firmware to that will make websocket calls to an endpoint of my choosing. These boards have a light sensor and an accelerometer whose readings I want to send out periodically back to a ThingWorx mashup and both display current data and then retain and display a history of readings.


These devices run the Contiki open source operating system and are programmed in a C language dialect with some preprocessor directives to do efficient threading. I can't install an EMS there but I am hoping that I don't need to. I can also make REST calls to the device and get data values back that way.


Is there some instructional material I can refer to? I have yet to dig into the Raspberry Pi demo but that is based on the use of an EMS and I am hoping I can get by without an EMS.


Any pointers appreciated.


Jim Solderitsch

Villanova University



1 REPLY 1
VladimirRosu
19-Tanzanite
(To:jamesso)

Hi Jim,
I have in mind two possibilities:

1. Basically if you can access from ThingWorx platform the REST
of the device, than I think the easiest way would be to create a service
which makes a REST call to the device, and then puts the received
parameters of the device to some property of a Thing.
You can do this by using the GetText function snippet (search the wiki for that).
You can customize the function to accept a parameter (address of the device or SN) if you have several devices and want to use the same function in order to get the properties for each one.
And you can create a timer that can execute that function on a regular basis in order to keep your platform Things synchronized.

2. The other way around, if you can do URL calls on top of a WS connection, from the Device to the ThingWorx platform, than you can build a custom url like "http://yourIPaddress:yourPort/Things/YourThingName/Properties/PropertyName?method=put&appKey=yourAppKey&x-thingworx-session=true&value=yourSensorValue" and do regularly HTTP calls to this URL from inside your C program.

Hope it helps!
Vladimir



Announcements


Top Tags