Unable to Leave Listening Mode on BoronLTE

Hello,

I’ve been struggling with getting my BoronLTE to exit listening mode when SYSTEM_MODE(MANUAL)
BoronLTE has been flashed with hybrid-0.8.0-rc.27-boron.bin

/***************************************************************************************************************************/
#include <Particle.h>

/ The "manual" mode puts the device's connectivity completely in the user's control
SYSTEM_MODE(MANUAL);
// enabling multi-threaded mode
SYSTEM_THREAD(ENABLED);

void cellular(){
    Cellular.on();
    // starts flashing blue at this point, indicating listening mode 
    Cellular.listen(false);
    Cellular.setActiveSim(INTERNAL_SIM);
    Cellular.connect(); // attempt cellular connection using default particle apn and internal-sim
    while(Cellular.connecting()){
        // connecting
    }
}

void setup(){
cellular();
}

void loop(){
} 
/***************************************************************************************************************************/

BoronLTE stays in listening mode (flashing blue) unless I press mode for 3 seconds.
Any help is appreciated.

There is a setup done flag on mesh devices. Until setup is complete, you won’t leave listening mode. Normally, if you set up your device using the mobile apps the done flag will be set and you’ll leave listening mode.

You can flash this program to your device to clear the flag, after which you can put your normal firmware back on the device.

Also, you do not need to set the active SIM each time; the setting is saved in flash memory.

#include "Particle.h"

#include "dct.h"

SYSTEM_MODE(SEMI_AUTOMATIC);

void setup() {
    // This clears 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);
}

void loop() {
}
6 Likes

Thank you @rickkas7! This helped me.

I had an Argon that was would always default to listening mode after I had re-flashed firmware and tinker. I could get it to connect to the cloud if I held down the Reset button for 3 seconds, but for some reason it wouldn’t auto-reconnect after flashing or powering off/on.

However, in SEMI_AUTOMATIC mode, I found that the device would turn WiFi off and would not attempt to connect to the cloud anymore. (To others who find this thread read here to learn about System Modes.)

I used this:

#include "Particle.h"
#include "dct.h"
SYSTEM_MODE(AUTOMATIC); // <-- Note use of AUTOMATIC mode!

void setup() {
    // This clears 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);
}

void loop() {
}

FWIW, rather than using the above as a standalone script, I found I could incorporate your code into my sketches and just comment it out after clearing the setup flag.

HTH!

1 Like

Can this not be also achieved in the similar way that you can access the DCT of the electron or photon using a dfu-util command? Is there an equivalent for the Argon/Xenon/Boron?

Talk about a nightmare of a setup procedure.
The app doesn’t work, the CLI wont work by default etc.

This worked for fixing two of my devices, but even after flashing the code via CLI, still had the same issue. Had to hold down the Mode button until it rapid blinked Blue, THEN hold down mode button again for 5 seconds then let go. It finally returned to flashing Green.

No idea how it got stuck in that mode but can’t say I’m impressed with the overall stability of the install/setup process.

*Worked for me using:

  • 0.9.0 firmware flash via CLI (tried the bootloader, hybrid and part1)
  • Flash the above code from @rickkas7 (thank you)
  • Hold Mode button till fast flashing blue
  • Let go after fast blue flashing stops
  • Hold Mode button again for 5 seconds
  • Wait for green flash to connect via Cyan flash (took about 1-2minutes to go Cyan)

Late breaking news, in case this wasn’t known to remove devices stuck in listening mode -

Use CLI command “particle mesh add [device-to-pair] [hosting-device]”

*Can use either device name, or if it’s unclaimed the device ID
*Works on devices we couldn’t recover with rickkas7’s firmware

If you don’t use mesh networking, what is the side effect of doing this? I have had trouble exiting listening mode, even with @rickkas7’s code.

I’m not sure there’s a side effect except piling up unused mesh networks, which may eventually cost you money (as stated here).

Note after a little more testing seems you could use a “dummy” mesh network to “setup” devices, then move devices to other networks as desired (and appears unused networks are automatically deleted). Not sure this solves the long-term problem because eventually you’ll run out of free networks.

Maybe you could put all the stuck devices onto a mesh network called waitingForParticlesNetworkDeleteButton :wink: - fun fact, appears you can’t have uppercase or punctuation in mesh network names or it errors out.

Does this still work on firmware 1.4.2?
I can’t seem to get my boron out of listen mode using this code:

#include "Particle.h"
#include "dct.h"

SYSTEM_MODE(SEMI_AUTOMATIC);

void setup() {
    // This clears 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);
    delay(500);

    System.dfu(); //re-enter DFU for product firmware
}

void loop() {
}

@jack4566, yes it should work on the Boron.

I think it might be a firmware problem on my boards. If it do Update then dct_write_app_data It will work, but right out of the box I cant seem to call dct_write_app_data.

I can work around that with a factory programming script. Solved.

8 posts were split to a new topic: E-Series stuck in Listening Mode

@ScruffR sorry about that i thought of that afterwards as it causes confusion to the thread. I forgot the thread title was specifically referencing the Boron