Base 256 encoding in Particle publishes

I am working on a project where I will need to publish approx 200 bytes of data.

If I encode this 200 bytes of data using hex characters, It will be take a minimum of 400 characters.

That means it will take 2 Particle.publishes in order to send my data, since each Particle.publish() is limited to a maximum size payload of 255 characters.

Alternatively, I was wondering if it would be feasible to use a base-255 encoding scheme (is there a name for this?) instead of a base 16 encoding scheme (i.e. hex) to encode the data. That would mean that I could represent each byte by a single character, though I would be using “weird” characters to accomplish this.

Characters such as ±◘╚♪♀♂◙○◘•♠♣♦♥☻☺

Would this work? Would there be anything in the OSI comm layers preventing this from working (i.e. special characters being scrubbed/altered/deleted as they pass from my app to my server via the Particle Cloud)?

@jaza_tom, “base 255” would be pure 8-bit binary! The publish restricts the payload to pure ASCII so an efficient conversion is Base64 which would make your payload about 267 bytes long. You can find the Base64RK library in the Web IDE to make things easy.


Are you aware that limits have been increased for most of the cloud thingies, in the 0.8.x versions?


Hmm, I was not aware.

I searched through the Particle Tools Changelog that you link to and could find no mention of the word “publish” in any release after 0.6.x

Any idea if publishing limits have been updated and now differ from what is shown in the reference documentation?

1 Like

It’s in that very post I linked to :wink:


Ah of course. I’m such an infant. :japanese_goblin: