Is there a limit on the amount of variables that can be read via the SparkCloud? I can read 4 variables without problems but when add a fifth variable then I see a lot a errors (timeouts on protocol level) and the SparkCore resetting (CFoD, although it will come back with the latest core-firmware release :-)).
EDIT: I forgot to mention that the variables are read shortly after each other every 5th second.
Hi @nika8991 - yes there is a limit of four variables, but this isn’t a limit imposed by the Cloud, but rather the Core (it’s a way to reduce the memory overhead).
There is a bug that we’ve got in our backlog with strings as Spark.variables—they do not currently work AFAIK. I just spent a little time looking over the code and saw no immediate problems. I’ve asked @satishgn to dig into it this week.
Hi @zachary, here my findings.
When I tried to get 4 integer variables and 1 string variable I got a lot of timeouts, the string is indeed the 5th variable.
After I changed that into 3 integers and 1 string (again at the end) the SparkCore was stable and I was able the get the correct integer and string values.
Thanks @zachary, I was trying to figure out why my string cloud variables were not all working. I found that my first String variable works all the time. however a 2nd String variable never works - it always produced a ‘time-out’. I have 4 other INTEGERS that seem to work. I have not tried 3 String variables.
I’m out-of-office-ish right now, but I think I saw a pull request to fix this related to a hard-coded packet length rather than testing strlen() to determine length. Most likely a fix is coming soon to a web IDE near you!
I can confirm that the variable string length fix was merged into the build branch and is live – you can now safely return strings up to about 230 chars in length.