I’m new to Spark and am having the following issue. I want to publish an event from Spark, listen to events indefinitely (ie. run curl and each event published will appear for as long as I leave curl running). The problem is that curl is only printing 3 events and then going silent. Furethermore, it only prints these 3 events when I run the curl command, leave it running, and then flash using the cloud IDE. When I still leave curl on and power cycle the device, it again prints 3 and only 3 events, which means that curl is working fine. Any idea what’s happening here? Any idea how to fix it? Thanks in advance!
Curl outputs (Side note: I’ve edited the ouput to truncate the coreid to “…687” for security…is it unsecure to post my device id publicly?):
event: temperature
data: {"data":"inside_setup","ttl":"60","published_at":"2015-03-07T23:42:42.344Z","coreid":"...687"}
event: temperature
data: {"data":"inside_loop","ttl":"60","published_at":"2015-03-07T23:42:42.348Z","coreid":"...687"}
event: temperature
data: {"data":"inside_loop","ttl":"60","published_at":"2015-03-07T23:42:42.479Z","coreid":"...687"}
… then it goes quiet and no more events are picked up unless I power cycle the device, then the same 3 events are printed…
There are limits to how fast you can publish to avoid overloading the cloud. One per second on average with a burst of four is allowed. If you change your delay to 1000 for one second it should work fine.
Thanks bko, but It still only publishes 3 events even with the 1000 delay
Update: a delay of 1500 works, but 1000 does not work… I feel like I need to run gradient descent on the Spark API to find the decision boundary for the update delay…
Is that timing limit written anywhere in the docs…if so, where can I read more? If not, why might it be missing and what other gotchas should I expect? Thanks so much!
@bko is right on the limits, I suspect you’re hitting three because your core also publishes an extra event on startup, the “spark/cc3000-patch-version” event.
Thanks guys! Is that timing limit written anywhere in the docs…if so, where can I read more? If not, why might it be missing and what other similar gotchas should I expect? Thanks so much!