4

My question might be a little strange but I can't find any answer to it. I'm designing a simple IoT system that has some devices as a client and a server that controls these clients like reading sensors, sending commands, etc. In the communication side, I can use any internet-based protocols like HTTP, UDP, TCP, etc.

On the other side devices using cellular network 2G to connect to the network which has a low bandwidth. Is there any standard message structure between client and server?

For example, If I want to set an led on a device I can send led=1 or I can use a JSON-based structure like {led: 1}. But I have a very low bandwidth and I want to use a simple structure that uses compact size. Is there any standard at all?

A device might have up to 10 sensors and 10 outputs and I want to get values as fast as possible.

I know I can compress my messages but I need a robust and compact message structure.

1 Answer 1

4

Firstly, if you use HTTP then it is very likely the HTTP headers will dwarf any message you are actually sending. A low overhead protocol like MQTT may be better suited if one of your key aims is to reduce bandwidth usage.

As for the formatting of the data it comes down to the type of values being sent and if you need the data to be human readable at all times.

If you want really tight packing then something like Protocol Buffers but you'll need an encoder/decoder on each end to turn it back into human readable values.

4
  • 1
    Thanks. Message format shouldn't be human readable it is just a machine to machine interface. I want a simple short standard to transfer information between client and server. I thought there might be some standard protocols. Oct 17, 2018 at 8:44
  • 2
    Then protobuff would be a good fit
    – hardillb
    Oct 17, 2018 at 8:46
  • 1
    Thank you I will look into it and see if I can port it to low power devices. Oct 17, 2018 at 8:57
  • 3
    There are huge number of existing protobuff libraries, including small footprint versions (github.com/nanopb/nanopb). Also iot.stackexchange.com/help/someone-answers
    – hardillb
    Oct 17, 2018 at 9:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.