System Calls Used By Your factory Firmware
The following API methods are reserved for the two key Connected Factory operations: BlinkUp™ and blessing. All of these methods are intended only to be included in your factory firmware — if included in application firmware, they will throw exceptions that cause devices to restart.
The third, imp.clearconfiguration(), is not required, but is strongly recommended. It will prevent Production Devices from attempting to connect using their stored factory network and enrollment credentials when end-users power them up for the first time. Clearing the stored credentials with imp.clearconfiguration() ensures that each device’s BlinkUp status LED signals what should be the correct state for a new end-user device: that the unit is unconfigured.
Also useful to writing efficient factory firmware is the data stored in the imp.configparams property. The remaining API methods are optional.
Initiates the blessing of the Device Under Test (DUT) on which it is called.
server.factoryblinkup(ssid, password, ledPin, flags)
Initiates BlinkUp by the factory BlinkUp fixture on which it is called.
Sets the device’s WiFi region.
Sets the device’s enrollment data — its plan ID and enrollment token — without BlinkUp.
Sets the device’s WiFi NVRAM image (imp003, imp004m and imp005 only).
Sets the device’s WiFi access credentials without BlinkUp.
Electric Imp provides a free-to-use code library, FactoryTools, to help you construct your factory firmware by providing simple functions for determining the type of device on which your factory firmware is running.