I am writing a web app and am using Javascript setinterval to repeatedly request variable values. This was fine with one variable, but once i started requesting 3 my photon crashed (solid cyan LED). I am guessing it can’t cope with 3 requests very close together? Does this seem a likely cause?
If it is, I guess I can create a JSON string with my 3 variables and then extract in my JS, or stagger the requests.
Solid Cyan LED is not a sign of the Photon crashing. If you want some help then maybe posting your code? Are you using SYSTEM_THREAD(ENABLED); show the registration of the Particle Function and the Function handler.
Do you wait for the return code before sending the next command/function API call?
Apologies for not replying sooner. Been bogged down homeschooling my children.
Code is here: https://go.particle.io/shared_apps/5ee48f97fbd3d5000c75e40e
The javascript is sending API calls in very quick succession with no delay between, I think this was this issue. Going forward I am going to try to do the API calls from PHP to hide the access token from the client, so this post can probably be closed now?
It’s doing pretty much the same thing without the need for a “library” - you can’t really get a lot shorter than this three-liner.
If you have a look at the implementation of the elapsedMillis “library” you’ll see there would merely be some extra definitions you won’t be using after all