Argon boots in Listening mode instead to load installed user app

I believe the problem is that the setup complete flag was never set when you set up the device initially, or got cleared.

The stop listening command exits listening mode, but does not set the flag, so you go back into listening mode on reboot.

The code will manually set the flag in configuration flash.

#include "Particle.h"

#include "dct.h"

SYSTEM_MODE(SEMI_AUTOMATIC);

void setup() {
    // This set the setup done flag on brand new devices so it won't stay in listening mode
    const uint8_t val = 0x01;
    dct_write_app_data(&val, DCT_SETUP_DONE_OFFSET, 1);

    // This is just so you know the operation is complete
    pinMode(D7, OUTPUT);
    digitalWrite(D7, HIGH);

    Particle.connect();
}

void loop() {
}
3 Likes