Log Useful Hardware Details At Start-up
When an imp-enabled development is powered up or restarts, it does not present any information about the device state, such as which impOS™ version it is running, how it is connected to the Internet, or what event may have prompted the restart.
All of this information is available to Squirrel, via a number of imp API methods. The following code uses these methods to provide useful device information at start-up. Typically you will place the code toward the top of your device code listing.
Here is a typical log output from the code:
2018-01-15 12:47:38.766 [server.log] impOS version 36.13 2018-01-15 12:47:38.773 [server.log] Connected by WiFi on SSID "darkmatter" with IP address 192.168.0.4 2018-01-15 12:47:38.776 [server.log] Device restarted: Application code updated 2018-01-15 12:47:38.778 [server.log] Running 'Experimental' (bb62683f-d8d4-7aaf-fa4e-5c4796105507) 2018-01-15 12:47:38.779 [server.log] SHA d36dcd27034fa4d270c75abb82c0aaea5910df70f19301491e8e4edab79015e1