Skip to main content
1-Visitor
October 6, 2015
Solved

How to send data through port 8000 on EMS to platform?

  • October 6, 2015
  • 11 replies
  • 4245 views

New to ThingWorx, have been plowing through the various forums, use cases, and other collateral.

Need a pointer to how to get started with the following:

Have Edge Micro Server installed on Linux machine and have connection to ThingWorx cloud Platform.

Where do I learn, or where are examples, of what and how I push data to port 8000 on the EMS and how I prepare the platform to ingest that data?

I know "it depends" on use case and sensor(s) used and a bunch of other stuff.  For now just want to understand at the level of the web socket (aka port 8000).  I'll get the data moving from my sensor(s) as soon as understand what goes into port 8000 such that the platform can pull it out on the other side.

Just need a starting place, I can do the legwork if given enough context and example.

Thanks,

Best answer by Aanjan

Beck, quick question - what is the platform version that you are currently using? Primitive_ToJson suggests it's trying to convert something to Json though. I suppose adding a content header should fix it. Please try using this command instead -

curl -X PUT -H "Accept: application/json" -H "Content-Type: application/json" -d "{\"Your_Property_Name\":\"Your_Value\"}" "localhost/Thingworx/Things/Name_of_Thing/Properties/Your_Property_Name?appKey=Your_appKey"

11 replies

5-Regular Member
October 6, 2015

Beck, I'm not sure if you checked already, but we have an Edge Help Center which has more information on how the Edge Microserver functions, along with some example configurations, lua functionality etc. Do let me know if you have any questions.

1-Visitor
October 6, 2015

Yes, this is very helpful, Thanks.  I will examine the section regarding the Java SDK to learn more about this method at that level.

I am also seeing references to RESTful API.  Is there a documentation section or examples on preparing the platform to accept GET and PUTs from the EMS?

(Note: If this needs to be in another thread, I will search for and then open same if needed).

Again, just need a pointer to get started, will do the legwork to figure it out once acclimated to the ThingWorx development ecosystem.

Thanks,

5-Regular Member
October 6, 2015

The EMS does make REST calls to the platform to send and receive data back and forth. I quite don't understand what you meant by preparing the platform though. All you need from the platform's perspective is a Remote Thing to which you would make a connection using the EMS. The EMS download package contains an example template and some sample scripts. You can use that to add/ bind example properties and services in the platform.