Sending and getting data. limit of 63 char is annoying


#1

I’m linking a core to an RGB matrix . For sending data it seems that the spark.function is the easiest, but is limited to a string , length 63. I have tried putting data into a string, but I cant send any bytes > 128 in value, and the character 38 “&” causes all letters in the string after it to not appear. I can get around this by just using 6 bits of data (numbers 0-63) . ie to send the number 33, I add 40 to it, and on the spark subtract 40, seems to work.(This gets around the ascii(38) issue)
Is there any easy way to send more data than 63 bytes?
Its works but is slow…
Would UDP work better???

Hamish


#2

@peekay123 should have some inputs for you :smile:


#3

@hamish,the Photon has a limit of 255 while the new Core release planned in a couple of months will get the same limit. For now, on the Core your best bet is to use TCP or UDP. :smile:


#4

The Photon has a limit of 255? The docs still say 63, I assume this is a copy/paste issue then?


#5

So… I just bumped the core firmware contents limit to 255, so it’s 63 chars for the topic, and 255 for the contents. :slight_smile:

Thanks,
David


#6

Docs are updated to reflect 255 on all platforms now. :smile:


#7

Are you guys talking about Spark.function or Spark.publish? Because the Photon docs for Spark.function still say 63.


#8

@tjp, from what I gather, it is only for Spark.publish(). I am confirming with @Dave.

CONFIRMED - Spark.publish() only (for Core and Photon)


#9

Thanks for checking on that for us @peekay123. Just want to point out that the OP was referring to Spark.function.

Is this limit going to change? It would be nice to pass more than 63 bytes into a cloud function.

Thanks,
TJ


#10

@tjp, yes the Spark.function() limit will be changed and I believe soon(ish). Stay tuned!


#11

Has this been updated? The docs for Particle.function() still say that:

A cloud function is set up to take one argument of the String datatype. This argument length is limited to a max of 63 characters.

Thanks
-Adam


#12

We urgently need this update too. Will the limit not be changed?


#13

This limit remains 63. Any chance of it going up?


#14

It can be increased and it WILL be increased :slight_smile: https://github.com/particle-iot/firmware/issues/1467