Unable to Leave Listening Mode on BoronLTE

boron
Tags: #<Tag:0x00007f1ca10bf8a0>

#1

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.


#2

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() {
}

#3

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!


#4

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?


#6

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)