Agent suddenly stops

Hi all,

I just built a Christmas Ficus tree with a LED string light for the occasion, and everything worked well for hours, but now, sometimes the agent side stops running, without any message in the log window. I don’t know how to debug this situation. Could someone give me some advice?

Thanks you.
By the way I wish you all a Merry Christmas!

Agent side code:
function requestHandler(request, response) { try { if ("blinkmode" in request.query) { if(request.query.blinkmode== "blink") device.send("mode",1); else if(request.query.blinkmode== "rand") device.send("mode",2); else if(request.query.blinkmode== "blink_slow") device.send("mode",3); } response.send(200, "OK"); } catch (ex) { response.send(500, "Internal Server Error: " + ex); } } http.onrequest(requestHandler);

What does it exactly do? I’m confused. Is it something you control using a webpage?

Also a bit confused - what do you mean by stops? That agent code will only do something when you access the agent URL - are you saying the agent URL no longer responds?

Yes I am using the http method with the parameter blinkmode=value. Hugo you got it, sometimes the agent URL is returning “no http handler” or something like this. Moreover, in the IDE, on top of agent code window, the status is not “running” anymore but is “stoppednot running”…

What is the difference between this:

and this:

Oops consider that blinkmode replaced jui. Jui was the old parameter name. I forgot to change this one . Anyway, this did not cause the issue. Strange behaviour, now the agent code seems to be stable and don’t stops anymore, without any changes from my side. Did the electricimp team worked on agents stability in the meantime?

No changes that should have affected that, no. Please PM me your agent URL so I can look in the logs…