Remote Coding for IMP

I just started to code at work, with my IMP sitting at home, hooked up to an open wireless and nicely USB powered. The main reason being that my office network still failed to be set up to let my IMPs communicate with the world.
However cool it is to work from remote (way cool), it seems, whenever I update the code and save, the IMP does not wake up once gone to sleep.

Is this a usual behaviour, can I kick wake up the IMP somehow from remote. (Currently I text my wife to plugin/out the USB on the IMP to restart, which gets on her nerves.)

when you make changes to the code and everything is correct it should restart itself. You dont need to be married to remote work with the imp :slight_smile: Just kidding :slight_smile: But i think you might have an infinite loop somewhere in your code and makes the imp unresponsive. Pretty much the new code that you wrote doesnt really go into the imp because the imp is stuck in the infinite loop. Check your code again…

If you are remote-coding, why would you send your imp to sleep?

I am not putting it to sleep, but it tends to go offline by itself for some reason.

ok, have you installed a watchdogtimer then?
It’s a bug that will be solved in the next firmware update
`function watchdog() {
imp.wakeup(5*60, watchdog);

// start sending something every ~5 minutes

I’ve found there’s no need to be near your Imp when you’re coding. After you’ve setup the hardware the way you want. For some projects that only takes a minute.

I am doing a JSON request update (http.get) every 3 minutes, but it does it a few times then keeps stumm OR when I change code and update(save) it seems to stop working. Sometimes there is an actual > offline log message.

I saw the watchdog cause, but I guess my loop would act as the same wakeup call effect right?

if your get function is agent based, you still could have a problem, because it is about imp/server communication, not agent/cloud

I am currently mainly working in the agent script. I am not sure however, what you are trying to say in your previous post.

The problem in the current firmware, is that a number of people encounter online->offline events without a clear reason.
You said that you don’t need a watchdogtimer because your appliction makes JSON request updates (http.get) every 3 minutes.
What i was trying to say is that this might not stop your Imp to go offline, if those calls are communication from the impserver (agent) to the webservice you are comunicating with, not comunication from the Imp to the impserver.
In this case, the watchdog might help.
Sorry, I don’t know how to put this in proper English.

Nono, that was proper english it exactly clarified the issue. SO the kicker needs to be an event between imp and agent, not agent and web, got it. However every get request is followed with an imp update on my side, so again I guess it should kick. But maybe it needs an event from imp to agent as well, so both sides need a proverbial kick in the digital butt.

Was working great with new “Virtual Router” on new to me PC. No offline events all day. Then I made a cable to hook 4.1v battery thru USB to April. It went offline every minute or so. Worse still it ignored my “Run” clicks. It stayed that way even after power cycle for hours. Now OK? Any ideas?

To clarify. It worked perfectly thru a day of experimental hardcore coding. It ignored my run clicks while continuing to write to log. Now it works fine with the same cable and battery. Huh?

If the imp has power problems, then it can behave erratically. 4.1v battery? What would that be? Most Li-Ion cells spend most of their time around 3.7v.

It was a software issue. It happened at the same time I changed the battery. Is it OK to put 4v thru USB cable to Imp? 4.1v is a big 3.7v battery sleeping all the time so it lasts for months before getting down to 4v.

See other thread for example of my error that causes it to go Offline and fail to respond to Run clicks.


The discharge of a Li-Ion cell isn’t linear, but yes it may spend a while over 4v. This would be ok on April through the USB connector as that goes directly to the VIN connection.

I keep my IMP on the USB when I leave the house. My IMP feels safer then :wink: