Arduinojson: MessagePack Support?

Created on 24 Sep 2016  路  8Comments  路  Source: bblanchon/ArduinoJson

Is it possible to have MessagePack support.
Instead of printing JSON string to buffer using this method
size_t prettyPrintTo(char *buffer, size_t bufferSize)
can we have another method like
size_t msgPackPrintTo(char *buffer, size_t bufferSize)

Use case:

  • Final buffer size could be smaller and it can reduce the network data usage where sensor sending lot of data in json string.
  • Instead of storing plain JSON string to SPIFFS we can store small msgPack buffer. It will reduce file size.
enhancement

Most helpful comment

This sound like a good idea, and that's 100% aligned with the philosophy of ArduinoJson.
However, I'm afraid most users would prefer the official implementation instead of ArduinoJson...

Also, it looks like there will be a lot of testing, so I'd like to see how much traction this feature gets before writing a lot of code.

Let's see how many upvotes 馃憤 (or downvotes 馃憥) we get on this feature request.

All 8 comments

This sound like a good idea, and that's 100% aligned with the philosophy of ArduinoJson.
However, I'm afraid most users would prefer the official implementation instead of ArduinoJson...

Also, it looks like there will be a lot of testing, so I'd like to see how much traction this feature gets before writing a lot of code.

Let's see how many upvotes 馃憤 (or downvotes 馃憥) we get on this feature request.

When its about...

Final buffer size could be smaller and it can reduce the network data usage where sensor sending lot of data in json string.

I upvote. For me size is equally important to performance in micro controllers.

I'd be keen on this. reducing the buffer size is great from my end! limited ram and all..

upvote. I want to use arduino JSON to store data on local storage, but it is not efficiently packed. Would love a way to reduce the output size. Even just storing variables in their hex format would be good.

ArduinoJSON is miles ahead of the msgPack arduino implementation, would way rather use ArduinoJSON for this purpose.

Branch 5.8.x seems to be quite stable now.
I'll now focus on this feature.

@bblanchon, @mahmed8003, @cosmikwolf there's a new PR of mine that includes an initial support to messagepack: https://github.com/bblanchon/ArduinoJson/pull/682, if anyone could test more with an arduino I'd be glad. Thanks.

MessagePack is finally available in ArduinoJson 6.0.0

Was this page helpful?
0 / 5 - 0 ratings