New to IMP: Having device connection / firmware issues

I’m working through the getting started examples and falling down immediately whenever trying to access “hardware” or various “imp” methods. When I run this code:

`function startup() 
{
    server.log("Device started");
    if ("getsoftwareversion" in imp)
    {
        server.log("Device firmware version: " + imp.getsoftwareversion());
    }
    else 
    {
        server.log("Sorry - my firmware doesn't include imp.getsoftwareversion() yet.");
    }
} 
 
startup();
`

I see this in the Device Logs:

`Device firmware version: 93da439 - jenkins-ei-named-branch-1810 - Mon Apr 20 14:26:20 2015
`

I can’t find any information on this firmware online.

Is there any way to perform a factory reset on the IMP?

My MAC address is 0c2a6904a6e5.

Many thanks for any guidance or tips you can offer.

The code I’m trying to run is this:

`
// create a global variabled called led and assign pin9 to it
led <- hardware.pin9;
 
// configure led to be a digital output
led.configure(DIGITAL_OUT);
 
// create a global variable to store current state of the LED
state <- 0;
 
function blink() {
  // invert the value of state:
  // when state = 1, 1-1 = 0
  // when state = 0, 1-0 = 1
  state = 1-state;  
 
  // write current state to led pin
  led.write(state);
 
  // schedule imp to wakeup in .5 seconds and do it again. 
  imp.wakeup(0.5, blink);
}
 
// start the loop
blink();
`

Which logs this output the Device Logs:

`2015-05-25 11:41:48 UTC-7	[Status]	Device connected
2015-05-25 11:41:58 UTC-7	[Agent]	ERROR: the index 'hardware' does not exist
2015-05-25 11:41:58 UTC-7	[Agent]	ERROR:   at main:2
2015-05-25 11:42:08 UTC-7	[Agent]	ERROR: the index 'hardware' does not exist
2015-05-25 11:42:08 UTC-7	[Agent]	ERROR:   at main:2
2015-05-25 11:42:18 UTC-7	[Agent]	ERROR: the index 'hardware' does not exist
2015-05-25 11:42:18 UTC-7	[Agent]	ERROR:   at main:2
2015-05-25 11:42:29 UTC-7	[Agent]	ERROR: the index 'hardware' does not exist
2015-05-25 11:42:29 UTC-7	[Agent]	ERROR:   at main:2
...
`

Hello rantler,
this code should run on the device side (the hardware), not in the agent (the cloud). Just cut this code out of the Agent pane of the IDE (left or top pane) and paste it in Device pane (right or middle pane) of the IDE.

best regards from Québec, Canada
François

I can't find any information on this firmware online.

The value returned by imp.getsoftwareversion() is the version of the improm (or agent host).

When called on the device, it will return something like “94283d3 - release-32.7 - Fri May 15 10:40:46 2015”. When called on the agent (running in the cloud), it will return something like “64d456b - jenkins-ei-release-4917 - Thu May 14 08:23:27 2015”.

It’s human-readable, intended for debugging, and the exact format should not be relied on.

It is not the version of your squirrel code.

Thanks everyone. I failed to fully read the details in the instructions and got confused since some of the code worked in the Agent code pane. Everything is working well!