2 ms·
If you have a Python script at the other end JSON is nicer to decode and debug, and for such a low amount of data the few bytes overhead doesn't really matter.
by flohofwoe 9y ago
If you have a Python script at the other end JSON is nicer to decode and debug, and for such a low amount of data the few bytes overhead doesn't really matter.
Also, once you go with binary encoding, using a fixed-point integer format is almost always the better choice over sending float numbers. Depending on the needed spatial resolution (which isn't much in this example), you can reduce message size by using 8-bit or 16-bit fixed-point integers, or if you need more precision than float in the same space, a 32-bit fixed-point number.