Release 25 - Release Notes + New Features

Release 25 brings a couple improvements, and a slew of new API calls for you to take advantage of. Here are the details:

New features (Imp)
Native methods (such as pin.write) can now be bound to their objects in order to form a free function: this can be useful for optimising tight loops as it reduces the number of lookups in the global table. For technical (object-lifetime) reasons you can’t bind to lazily-generated objects such as hardware.pin5 directly – hardware.pin5 must be assigned to another object first:
chipSelect <- hardware.pin5; csWriter <- chipSelect.write.bindenv(chipSelect);

New Features (agent)
To allow for more precise timing, the standard Squirrel date() function has been extended to return a “usec” field containing the fractional part of the current second, in microseconds – plus, for ease of calculation, a “time” field containing the Unix time (seconds since 1970-01-01) as an integer.

New API Calls and Functionality
Deep Sleep

Environment Methods

FixedFrequencyDAC Class

Wifi Control

Other things you may notice:

  • Connect to wifi time is much improved (DHCP bug which added 2 seconds to connect time has been fixed)
  • WiFi stability should be much better (merged latest wifi driver code from chipset supplier)
  • No need for watchdog code in order to keep an imp connected when it’s idle

I noticed a device.isconnected() on the API documentation.

Do you know when this functionality will be in place? What is the latency between the imp going offline and the agent being able to distinguish between connected/non-connected.

Thanks!

This functionality is in place, as is the onconnectionstatus callback, see http://devwiki.electricimp.com/doku.php?id=electricimpapi:device:onconnectionstatus

  • For online notification, this is immediate.
  • For offline notification, if the disconnection is clean (ie the imp sleeps) the notification is also immediate.
  • If the device going offline is caught by connection maintenance (there’s no way to tell if a TCP connection is alive when there’s no data being transferred) then on average the offline state is noted 5 minutes later.

Great thanks Hugo!

Thanks for the update Hugo, great to see hardware.wakereason() :slight_smile:

Cheers

Benjamin:-)

Looks nice, thanks Hugo.
I wonder, is there any plan to add the abillity to cancel future wakeups / callbacks?

Yes, this has also already been implemented. Next release :slight_smile:

Since this update, my imp no longer seems to stay connected to my network. It connects and wakes up, shows up in the log, but goes to sleep right away. Could this be caused by the update, or possibly a different factor?

It’s the update, we’ve suspended it for now so we can diagnose why a handful of imps are struggling to update.

Hugo, thats great thing to hear!
Im too lazy to upgrade all of my code, i will wait for…release 26? :slight_smile:

Wait, hang on, device.onconnectionstatus hasn’t been implemented yet and is not in the current agent code! This feature is still under discussion: we intend it to be in a future update to the server, although possibly not in that exact form. For now, continue to use device.onconnect() and device.ondisconnect.

Peter