I am working with the Serial Daemon, trying to port a Wisblock Dev board to be operable through the Web Interface, almost everything working but having problems with the buffer encodings, I have my data formated as a Json, according to my research, I need to encode this to Cbor and then to base64, this is the problem.
This is my data:
{
“protected”: {
“ver”: “v1”,
“alg”: “HS256”
},
“signature”: “efa7140df9b04e9467b8d3248…3324c8437ea90c366ab301f0de0ed6”,
“payload”: {
“device_name”: “EA:0C:FF:14:2F:1A”,
“device_type”: “SEEED_WIO_TERMINAL”,
“interval_ms”: 16,
“sensors”: [
{
“name”: “Illumination”,
“units”: “na”
}
],
“values”: [
5,
6,
5,
6,
7,
7,
6,
6,
6,
6,
5,
5,
6,
6,
]
}
}
This is a functional base64 of a similar data sample of what I want to get:
o2lwcm90ZWN0ZWSiY3ZlcmJ2MWNhbGdlSFMyNTZpc2lnbmF0dXJleEBlZmE3MTQwZGY5YjA0ZTk0NjdiOGQzMjQ4NjljYjUxN2UzMzMyNGM4NDM3ZWE5MGMzNjZhYjMwMWYwZGUwZWQ2Z3BheWxvYWSla2RldmljZV9uYW1lcUVBOjBDOkZGOjE0OjJGOjFBa2RldmljZV90eXBlclNFRUVEX1dJT19URVJNSU5BTGtpbnRlcnZhbF9tc/lMAGdzZW5zb3JzgaJkbmFtZWxJbGx1bWluYXRpb25ldW5pdHNibmFmdmFsdWVzn/lFAPlGAPlFAPlGAPlHAPlHAPlGAPlGAPlGAPlGAPlFAPlFAPlGAPlGAPlFAPlGAPlHAPlGAPlGAPlHAPlFAPlGAPlHAPlFAPlFAPlFAPlGAPlGAPlFAPlGAPlHAPlGAPlGAPlGAPlGAPlHAPlFAPlGAPlFAPlGAPlGAPlGAPlGAPlGAPlGAPlGAPlFAPlGAPlGAPlGAPlGAPlGAPlGAPlGAPlGAPlGAPlFAPlGAPlGAPlGAPlFAPlGAPlHAPlGAPlGAPlHAPlGAPlHAPlFAPlFAPlFAPlGAPlGAPlGAPlGAPlHAPlGAPlGAPlGAPlGAPlGAPlFAPlFAPlGAPlGAPlGAPlFAPlIAPlHAPlHAPlGAPlFAPlGAPlFAPlHAPlHAPlGAPlGAPlGAPlHAPlFAPlGAPlGAPlGAPlFAPlFAPlFAPlGAPlGAPlHAPlHAPlIAPlGAPlGAPlGAPlHAPlGAPlFAPlGAPlGAPlFAPlGAPlHAPlGAPlGAPlGAP8=
I’ve tried different things but I cant make my Json to look like the base64 example even by encoding it with some Arduino libraries out there or online encoders.
Please help, I think that this “base64” string is a combination of Cbor and base64.