Power state, how to keep it on

31-1-2013 21:21:45: totaal: 92884.5
31-1-2013 21:21:45: 344.669 W/h
31-1-2013 21:21:45: Gem. Dagverbruik: 481.424 W/h
31-1-2013 21:21:45: Gem. Maandverbruik: 483.962 W/h
31-1-2013 21:22:04: Power state: online=>offline

and yes, a pagerefresh solved everything

1-2-2013 03:45:57: 755.953 W/h
1-2-2013 03:45:57: Gem. Dagverbruik: 945.602 W/h
1-2-2013 03:45:57: Gem. Maandverbruik: 945.602 W/h
1-2-2013 03:46:01: tellerstand: 13.9111
1-2-2013 03:46:01: totaal: 92886.4
1-2-2013 03:46:01: 1679.73 W/h
1-2-2013 03:46:03: Gem. Dagverbruik: 946.879 W/h
1-2-2013 03:46:03: Gem. Maandverbruik: 946.879 W/h

Hi Hugo,
Thanks for your explanation, much clearer now. With the operation of the imp totally dependent of it being online, I guess it is reasonable to ask how often the server updates occurs ( I have just observed another online/ offline instance), as each time it updates the imp presumable is out of action for up to 10 - 20 secs (or have i got it wrong).
Cheers,
Ken

I saw a problem this morning where the log had indicated a online=>ofline as the last entry. After going back to planner and clicking edit the Logs pane was updated and showed that it had a offline=>online and further watchdog outputs present.

So, the log stopping after offline->online is a bug (the web client should be attempting reconnect but something is failing here). This will be fixed soon.

Server updates will become seamless in the fairly near future too, so you shouldn’t notice any downtime at all.

As to how often server updates come in, we will be splitting servers out and having much more infrequent updates - ideally with an option for users to be able to pick the server they’d like to use (some downtime but new features first, or fewer updates and more uptime).

I have the same problem of my IMP dropping off.

I’ll add the watchdog code and report back.

Thanks Hugo

I added the “watchdog” code with the fake outport in my project and it caused an error: “ERROR: the index ‘myoutput’ does not exist”. It still powers itself off with out the watchdog code or with the first version of the watchdog code.

Fake output? Can you post the code you’re using?

Here is my code, I cannot figure out where to put the watchdog but have the issue of the imp going to sleep.

Thanks Hugo

`// Switches on the light based on input

// Configure an input to the imp from the planner
class input extends InputPort {
type=“number”;
name=“output”;

function set(s) {
    // Write the pin and show the change on the planner
    hardware.pin9.write(s?1:0);
    server.show(s?"Light On":"Light Off");
    server.log(s?"Light On":"Light Off");
}

}

// Configure pin1 as an output
hardware.pin9.configure(DIGITAL_OUT_OD_PULLUP);

// Configure ourselves with the one input
imp.configure(“Output”, [input()], []);`

Just add this to the end:

function watchdog() { imp.wakeup(60, watchdog); } watchdog();

great, the code is added and I will see if it still falls asleep.

Should I expect any watchdog messages in the log? So far non have.

Thanks.

Phil

No, logging isn’t necessary to work around the bug.

if you want to see it working:

function watchdog() { server.log("watchdog barked.... "); imp.wakeup(60, watchdog); } watchdog();

So far so good, it’s been live for a few days and it’s still alive.

Thanks.

Phil

@Hugo do we still need this workaround? When will the bug be fixed?

Using this code, the thing still powered off after 10 min:

`imp.configure(“What’s my status?”, [], []);

wd <- OutputPort(“watchdog”);

// add a dummy output port; keep whatever I/Os you currently have where they are
//imp.configure(“my device”, [myinput], [myoutput, wd]);

// send something on the output port periodically
function watchdog()
{
imp.wakeup(5*60, watchdog);
wd.set(0);

server.log(format("Impee ID: %s", hardware.getimpeeid())) ;
server.log(format("Supply voltage: %f", hardware.voltage()));
server.log(format("Signal: %d dBm", imp.rssi()));
server.log(format("BSSID: %s", imp.getbssid()));
server.log(format("MAC: %s", imp.getmacaddress()));
server.log(format("Memory available: %d bytes", imp.getmemoryfree()));
server.log("sleeping for 5 min");  

}

watchdog();
`

here is the log:
6/2/2013 1:51:51 PM: Power state: offline=>online 6/2/2013 1:51:51 PM: Downloading new code 6/2/2013 1:51:51 PM: Device configured to be "What's my status?" 6/2/2013 1:51:51 PM: Impee ID: 232ac63643fc42ee 6/2/2013 1:51:51 PM: Supply voltage: 3.311000 6/2/2013 1:51:51 PM: Signal: -65 dBm 6/2/2013 1:51:51 PM: BSSID: 1caff7d00079 6/2/2013 1:51:51 PM: MAC: 0c2a69001e8f 6/2/2013 1:51:51 PM: Memory available: 53484 bytes 6/2/2013 1:51:51 PM: sleeping for 5 min 6/2/2013 1:57:03 PM: Impee ID: 232ac63643fc42ee 6/2/2013 1:57:03 PM: Supply voltage: 3.311000 6/2/2013 1:57:03 PM: Signal: -62 dBm 6/2/2013 1:57:03 PM: BSSID: 1caff7d00079 6/2/2013 1:57:03 PM: MAC: 0c2a69001e8f 6/2/2013 1:57:03 PM: Memory available: 58480 bytes 6/2/2013 1:57:03 PM: sleeping for 5 min 6/2/2013 2:00:51 PM: Power state: online=>offline

Release 23 has the bug fixed. If that’s really your complete code, I’ve no idea why it goes offline because it looks like it should be just fine (wd is being referenced, even though it’s not in the imp.configure, but I believe that shouldn’t cause things to go bang).

is Release 23 out yet? how do we know if our devices have this? How do we know when the release has begun?

Could the known issues page use some updating perhaps?

I’ll post when we roll it out. We’re rolling out some server changes and decided to hold the client update back until the server changes were deployed.

Given how close it is, I’ll leave the known issues page alone for now…

OK so what are my options then? I found this post initially since my Imp also needs to be reinserted or power cycled every time I wish to upload a new piece of code to it.

I bought the imp a month ago from Sparkfun, could I have gotten an older version that still has the SW issues? (this was mentioned earlier in this thread)

Your imp will be running the current release - they self-update.

Is the post above absolutely the exact code you’re running?