> For the complete documentation index, see [llms.txt](https://ask.simplehw.eu/kb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ask.simplehw.eu/kb/simple-api-6-generation/factory-mode.md).

# Factory Mode

### Mode Description:&#x20;

Some devices may be shipped in a special mode called ***Factory mode***. This mode is used typically for devices where their pre-configuration can cause unnecessary battery drain eg. during transportation, manipulation, or during storage. In this mode, the device is limited to very basic functionality with no heartbeats.&#x20;

### How to identify that a device is in Factory mode?&#x20;

Short button press (SimplePack & SimplePack Plus) \
Magnet with reed switch interaction (SimpleIndustry & SimpleMeter) for ***0 – 2.9*** seconds.

*The Factory mode presence is indicated by:*&#x20;

1. two long LED blinks&#x20;
2. a message starting with FA30 is sent&#x20;

### How to exit Factory mode?&#x20;

Long button press (SimplePack & SimplePack Plus) \
Magnet with reed switch interaction for (SimpleIndustry & SimpleMeter) for ***3 – 5.9*** seconds.

*The Factory mode exit is indicated by:*&#x20;

1. rapid LED blinking for approx. 5 seconds&#x20;
2. message starting with **FAFA01**&#x20;
3. device reset into the pre-configured state.

There can be a specific setting to exit Factory mode automatically by timer overflow specified in API 6 registry E0 noted in SimpleTime.&#x20;

For example, automatic Factory mode exit in 5 days after the device is manufactured if E0 is set to C5.&#x20;

### How to return to Factory mode?&#x20;

In the case of a need to return to factory mode, you can write D5 with the value of 0x01 via downlink into API 6 registers. The Device will reboot into factory mode.

## Payload Description&#x20;

* 1st Byte = 0xFA = Factory mode&#x20;
* 2nd Byte (Event)&#x20;
  * The same rules as for any other event&#x20;
  * \- New Events:&#x20;
    * 0xF9 = Factory mode GAS message&#x20;
    * 0xFA = Factory mode exit message&#x20;
    * 0xFB = Factory mode ADC raw values
* 3rd – 12th Bytes&#x20;
  * The same rules as for any other event (either appended payload or event-specific payload)
  * For the new events:&#x20;
    * Event 0xF9
      * 3rd and 4th Byte is the Gas value in pp**m**
    * Event 0xFA&#x20;
      * 3rd Byte = Type of exit&#x20;
        * 0x00 = enter&#x20;
        * 0x01 = exit via button&#x20;
        * 0x02 = exit via timer&#x20;
        * 0x03 = exit via register 0xD5 mf bit&#x20;
      * 4th – 7th Bytes = ID of the device&#x20;
    * Event 0xFB&#x20;
      * 3rd Byte = ADC A mV MSB&#x20;
      * 4th Byte = ADC A mV LSB + MS 4bit ADC B&#x20;
      * 5th Byte = ADC B mV LSB

## Examples&#x20;

* FA30 = Short press in Factory mode&#x20;
* FA30C0307D = Short press in Factory mode with Voltage (3.0 V) and Temperature (22.5 °C) appended to the payload&#x20;
* FAFA01025B46E2 = Exit of Factory mode via button and with the ID of the device (025B46E2)
