Skip to main content

server.factoryblinkup(SSID, password, pin, flags)

Triggers an imp to perform a BlinkUp operation on a second imp

Availability

Device
Available for use in Factory Firmware only

Parameters

Name Type Description
SSID String The name of the factory WiFi network
password String The factory WiFi network’s password, or an empty string ("") if no password is needed
pin imp pin object The pin to which the BlinkUp transmission LED is attached
flags Integer Bitfield of BlinkUp flags (see below), or 0 if none needed

Returns

Nothing

Description

This method is available only for inclusion in factory firmware. It is called by an imp module-based factory BlinkUp™ fixture, such as Electric Imp’s impFactory™, to trigger the BlinkUp of a powered up imp-enabled device under test (DUT) on the assembly line. This functionality is only enabled on BlinkUp fixtures assigned to an impCentral™ Product’s Factory Test Device Group or Factory Device Group. Attempting to call server.factoryblinkup() on any other device will simply log the following error: “Factory BlinkUp request failed. This is not a factory imp.”

On this call, the imp initially contacts the server to verify its factory imp status. On a successful reply, the fixture transmits the necessary BlinkUp packets on the specified pin, which should be connected to an LED pointing at the target device(s).

Note From March 1, 2018, imp001-based factory BlinkUp fixtures will no longer be supported (see ‘Changes to Production Processes Under impCentral’) and calls made from these devices to server.factoryblinkup() will fail.

The method returns as soon as the request for the factory enrollment token has been sent to the server. The response from the server is handled asynchronously. When the enrollment token is received, the BlinkUp process begins and Squirrel is suspended while the LED is flashed. Once BlinkUp is complete, Squirrel execution continues once more.

BlinkUp Flags

Const Description
BLINKUP_FAST 142Hz BlinkUp (default is 60)
BLINKUP_ACTIVEHIGH LED is active-high (default, active-low)

Whether you require BLINKUP_ACTIVEHIGH or the default setting will depend on how your BlinkUp LED is connected in your own factory BlinkUp fixture. The impFactory requires use of the BLINKUP_FAST flag, but a custom-made BlinkUp fixture may not.

Note The BlinkUp LED should be off when it is not sending data. If it is lit when idle and factory BlinkUp isn’t working, try adding (or removing) BLINKUP_ACTIVEHIGH.

If no flags are required, ie. you are happy with both default values, you should pass the value 0 as the method’s fourth and final parameter.

Example Code

Advanced Factory Firmware

This is a complete example of factory firmware that can be used as the basis for your own factory firmware. It was written to run on the impFactory appliance, but can be readily adapted to your own design of imp module-based factory BlinkUp fixture, which should have a button which can be used by the operator to trigger BlinkUp when the fixture and a production device are physically aligned, LED to photosensor, but in practice you may wish to automate this.

The code uses the Factory Tools library to determine which of these devices the firmware is instanced on and to select the correct code path. The Factory BlinkUp Fixture section contains code called on that device; the Production Device section contains the device-under-test code. A final section, Your Test Function, defines a shell in which you can add code of your own to test elements of your production device hardware. This code should return true to ensure the device’s blessing proceeds.