cbor orunpack ?
-
hello,
I need to serialise many int data before I send to sigfox.
i would like to know if i can use cbor with my sipy. If it's possible which is the best , cbor or unpack to serialise.
the target is to put the maximum data in one message.
And i heard i can send with json format, so do you have documentation about that ?thank you for all
-
@quentho cbor is not implemented in Micropython. If it is straight python, it may be possible to use it. But if you do not have any compatibility constraints, you can use ustruct.pack() and ustruct.unpack().
You can also use the ujson.dumps() and ujson.loads() methods. But that is an ASCII format, which takes more space than a binary format.
P.S.: I just looked into a cbor package from PyPi. It should be possible to port it to MicroPython, but it is quite a bunch of code.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login