Anyone try to pass down a JSON Payload that was greater than 1024 byte limit using a Particle Function? I was looking for some guidance/inspiration on the best way to structure it.
Off the cuff, I was thinking use a Particle Function to append additional elements to an existing JSON object within the Particle Device. I.e. every time it calls the function, it’ll append the items. The concern comes up with what happens during re-tries or if one the function calls doesn’t go through but other ones do the end result won’t be complete.
Should I just create temporary JSON object and have an index counter i.e. 1 of 4, 2 of 4, 3 of 4, 4 of 4. And only accept the re-assembled JSON on the Particle Device by appending objects if and only if we recently received all 4 sub messages?
Anyone have examples I could use as inspiration or any chance there is a good library out there for this?
The end structure is ideally something like this but with up to 50 or even more members of key 22 and 23.
{
"21": 6,
"22": {
"xxxxxxcec0": 1092,
"xxxxxx9052": 1093,
"xxxxxxb8f8": 1094,
"xxxxxx683e": 1095,
"xxxxxxe57": 1100,
... (50 key/value pairs, maybe more)
"xxxxxx4adb": 1103
},
"23": {
"1092": [99, 10, 0],
"1093": [99, 11, 1],
"1094": [99, 12, 2],
"1095": [99, 13, 3],
"1100": [99, 14, 4],
... (50 key/value pairs, maybe more)
"1103": [99, 32, 5]
}
}