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, or an empty string ("") if WiFi is not needed
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 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™ Test Factory 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.”

If you are configuring a DUT that does not use WiFi, pass empty strings into the ssid and password parameters.

When this method is called, the imp first contacts the impCloud server to verify its status as a BlinkUp fixture (ie. it has been assigned to a Test Factory Device Group or a Factory Device Group). On a successful reply, the imp transmits the necessary BlinkUp packets on the specified pin, which should be connected to an LED pointing at the DUT.

Note imp001-based factory BlinkUp fixtures are no longer be supported 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

Constant Description
BLINKUP_FAST 142Hz BlinkUp. Default: 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 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 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

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.