Agent not running

How did I get into this state - and how do I get my agent running again? My imps are connected to the network, and I believe the agent code is error free.

Is there a troubleshooting guide for how to deal with this state?

We don’t have a troubleshooting guide around this right now.

What is/should your agent be doing / how can you tell it’s not running?

I think I was running into the same problems as the other posters yesterday afternoon – all of a sudden my agent is working fine again.

Ah, if it was just yesterday it’s likely it was caused by AWS’ outage:

Status Page

It was odd how it failed when the servers went out. It failed to get an IP address from the local server (according to the flashing LEDs) and then went dark. It was just the servers though and not my code, as I just tried it and it popped right up the first time.

    • Thank you Imp people for getting on this as quickly as you did. * *

In general though, if you do end up with some rogue code that loops so quickly as to exclude all communication with the server, is there a better way of clearing it than simply unpowering it and repowering it?

The imp only has a single thread of execution. Right now, if your code never lets of the thread (ie - an infinite or long loop) it can’t communicate with the server, which means you can’t send it any commands (like restart, etc).

Yes, I’m aware of that and I’m always careful not to do that. If it happens though, does unpowering the Imp and repowering it give you a window of opportunity to load in something else? Or is there a way of just wiping it?

Yes - every time you powerc ycle the imp and it connects to wifi it makes sure it’s impOS is up to date, and that it has the correct (and most recent) code.

If you get your imp into an infinite loop, you can make changes in the IDE, click build and run, then power cycle your imp and it will download the proper code.

We go through a lot of effort to make sure developers can accidentally brick their imps with Squirrel code!

My imp device does not have a physical power switch and is currently stuck in an infinite loop. Is there any way to revive it or is it bricked?

Unplug it and plug it back in?

I am copying>pasting basic tutorial code from this site (“Blink”). Does this code contain an infinite loop? How do you prevent this? I am not able to upload new code.

Hmm, looks like you didn’t link to the site…

You can find some ‘Blink’ code in our Getting Started Guide which doesn’t use an infinte loop. Instead, it creates a function to flip the state of the pin the LED is attached to, and then schedules that function to run ever second.