Not Receiving HTTP Posts to Agent

I’ve had an HTTP post setup for a long time that sends a string to the agent, but it seems to have stopped working in the last few days. It’s coming from a script that runs on our (Exosite) platform. I’ve tested that it works when I send to a server that I control and I’ve had a coworker TCP dump the connection to the agent url and it is setting up a valid HTTPS connection.

The only thing that I’m wondering if it could be the problem, when I dig the domain from my desktop I get ‘54.241.247.73’ as the ip, but when they do it from the server (which is also in aws) they get ‘184.169.150.38’ as the ip. Are these both valid servers for talking to an agent?

The 184.169.150.38 address is the agent.electricimp.com load balancer; not sure what the 54.x.x.x one is.

Have you tried using curl from your desktop machine to post some test data?

I have:

$ curl -d “led=00CC00” https://agent.electricimp.com/
No HTTP Handler%

Nothing shows up in the IDE log.

Also, in the last 30 seconds the DNS response that I’m getting at home has changed from 54.241.247.73 to 184.169.150.38. With both I get the same response to the curl command above.

The IDE shows that the agent is running and clicking the link gives me the same “No HTTP Handler” response.

I’m assuming you are actually putting your entire agent URL in there (ie you need the whole URL not just agent.electricimp.com).

If you can PM me your code and agent ID then I can look in the logs. You need an http.onrequest() handler, obviously, but I guess you have that.

Okay, I think that this may have been a misunderstanding on my part. My Imp was disconnected, complaining “[Exit Code] imp restarted, reason: wifi outage”, and I hadn’t bothered to reconnect it because I was just testing things in the agent. I was under the impression that the agent would keep running when the device was disconnected, but maybe that’s not true when it actually gives an error.

I did a blinkup in the imp and it seems to be happy again and the agent is responding to http requests. So all is good for now as far as I’m concerned.

Would you still like me to send you the agent id?

I would assume that even with a disconnected device, the agent’s http.onrequest() handler would continue working. At least unless the disconnection of the device is also creating problems (crashes/restarts) in the agent. Is this a correct assumption ?

Yes, the agent should continue to run, but if you deployed new code it may have stopped it and not restarted this until the device next connected (this is a known issue).

Yep, that sounds like the problem. I’m pretty sure I tried to push code when I wasyl trying to figure out what was going wrong.