Argon boots in Listening mode instead to load installed user app

argon
Tags: #<Tag:0x00007fe21c3d9810>

#1

My new Argon running Device OS v0.9.0 enters immediately listening mode (flashing blue) on boot or reset with buttons released. Buttons are not broken, it reacts on both in different cases.
CL| command particle usb stop-listening works. The device connects to WiFi and mesh network and successfully starts the loaded user code, for example Tinker works properly.

Current installation is result of

particle flash --serial argon-ncp-firmware-0.0.5-ota.bin
particle flash --usb hybrid-0.9.0-argon.bin

FTR Xenon loaded with its 0.9.0 works properly, on boot connects to Mesh network and starts the loaded program.

Pls advise
David Davidov


#2

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

You sir are perfectly right!
Altering DCT_SETUP_DONE resolved the issue.

FTR I got in that situation after failed attempt to setup my new Argon and Xenon devices using Particle Android application on Samsung Galaxy Note 4. The QR scanner showed the label image but after many minutes refused to react to the code. So I switched to CLI approach.

Thanks again,
Dave


#4

Thanks @rickkas7 - this little snippet saved my bacon on two devices that required a particle usb stop-listening via CLI after every power outage or firmware update! Obviously a deal killer for a remote device. Cheers