Agent stops responding

For the last couple hours the agent stops responding after sending a few commands. Wait a few minutes and they all pile in. Happens even if I power cycle the imp while waiting (after sending the commands). I’m sending 3 values for RGB data and a command string. The code works fine, when there is no delay. It happens whether I send the data from my computer’s browser or from my phone’s browser not on my wifi network. Also made a small hello world agent/message code test, it has the same issue.

Are you sending responses for every request? If not, you’ll be hitting the rate limiting because requests need to complete to free up a slot for re-use.

Thank you Hugo, that was it. One of my commands was not sending a response.
Also, sending a response makes perfect sense and should obviously be done at all times, but I wasn’t able to locate anything about rate limiting in the documentation.

`// HTTP handler function
function httpHandler(req, resp) {
try {
local d = http.jsondecode(req.body);
if (d.c == “setcolor”) {
if (validateRequest(d)) {
local color = [d.r.tointeger(), d.g.tointeger(), d.b.tointeger()];
device.send(“setColor”, color);

            // return Status code 200
            resp.send(200, "OK");
        else {
            resp.send(400, "Invalid Request");
    } else if (d.c == "wheel") {
        device.send("wheel", d.val.tointeger());
} catch(ex) {
    // If there was an error, send it back in the response
    resp.send(500, "Internal Server Error: " + ex);


// Make sure all the parameters we want are in there and valid (between 0 and 255)
function validateRequest(d) {
return (d != null &&
“r” in d && d.r.tointeger() <= 255 && d.r.tointeger() >= 0 &&
“g” in d && d.g.tointeger() <= 255 && d.g.tointeger() >= 0 &&
“b” in d && d.b.tointeger() <= 255 && d.b.tointeger() >= 0);

// Register HTTP Handler

Should have included:
} else if (d.c == "wheel") { server.log(d.val.tointeger()); device.send("wheel", d.val.tointeger()); resp.send(200, "OK"); }