LOGIN
Ravi Pujar
21
Community Expert
Embedded systems engineer, Founder @Valetron Systems, Blogger @www.raviyp.com
 · DharwadIndia
Share
Report
Get Link
IDEA

Shorter message format for IOT devices

Hi, I am updating the data to the server using this packet format.

{"body": 
[
{
  "topic": "record",
  "action": "write",
  "recordName": "valtrack/params",
  "path": "motion",
  "data": "ACTIVE2"
},
{
  "topic": "record",
  "action": "write",
  "recordName": "valtrack/params",
  "path": "latitude",
  "data": 15.1416
},
{
  "topic": "record",
  "action": "write",
  "recordName": "valtrack/params",
  "path": "longitude",
  "data": 75.001
},
{
  "topic": "record",
  "action": "write",
  "recordName": "valtrack/params",
  "path": "speed",
  "data": 85.00
}
]
}

In my opinion, Here the fields topic,recordname, action are reduntant. And the names path, data also are simply extra bytes wasted on network. In IOT devices we should be delivering the message contents in shortest number of bytes possible. Every byte counts.

When am sending data to Dreamfactory, i just send this packet,

 {"resource":[{"devid":"TEST_DEVICE2","time":"2017-09-02 23:47:00","etype":"G_PING","engine":"OFF","lat":"8.000000","lon":"0.000000","vbat":"4038","speed":"0.00","pInt":"60","fuel":0}]}

More information in shorter message, Can we do something like this for Deepstream also?
if i send the below same amount of information to Deepstream it would grow very big.
I am not aware of other formats if already present on Deepstream to send message in shorter format. Please educate me.

0 like 
Like
Award Contribution
Load 2 previous comments
Ranjan Dailata
57
Community Expert
Application Architect/Lead Developer
 · ChicagoU.S.
Share
Report
Get Link

Perfect, that’s exactly I would send. You could have various parameters like date time, engine fuel and seed information etc.

Just a suggestion, the record name can be like this - valtrack/[deviceid] format. ex: valtrack/VALTRACK-V2. The reason being, you can fetch all the device data by the record name at ones.

Let me know if you need any more help. I am thinking of writing an article with my experience and how to architect things and deal with the Deepstream.

Like
1 like 
Award Contribution
Ravi Pujar
21
Community Expert
Embedded systems engineer, Founder @Valetron Systems, Blogger @www.raviyp.com
 · DharwadIndia
Share
Report
Get Link

Hey, How to make JSON colorful like the above post. Why is some colored and others are not?

Like
0 like 
Award Contribution
Harsha Alva
91
Community Expert
Mechanical Engineer + Software Developer
 · MangaluruIndia
Share
Report
Get Link

Ravi Pujar Use

```
code here
```

Like
0 like 
Award Contribution
Ravi Pujar
21
Community Expert
Embedded systems engineer, Founder @Valetron Systems, Blogger @www.raviyp.com
 · DharwadIndia
Share
Report
Get Link

I am trying to edit my previous comment with that but not working. May be its cached.

Let me test here 
Like
0 like 
Award Contribution
Ravi Pujar
21
Community Expert
Embedded systems engineer, Founder @Valetron Systems, Blogger @www.raviyp.com
 · DharwadIndia
Share
Report
Get Link

Comment edit, Not working… Robert Lancer
Can you confirm Harsha Alva

Like
0 like 
Award Contribution
Harsha Alva
91
Community Expert
Mechanical Engineer + Software Developer
 · MangaluruIndia
Share
Report
Get Link

Ravi Pujar I tried editing your post, but it isn’t working for me too.

Like
0 like 
Award Contribution
Leave a reply...
DISCOVER
CHAT
HIRE
ACTIVITY
FEED
New Post
Help
Start Project
Online Users
Share Link