Xenon, combining threaded and manual modes can leave Xenon flashing green permanently


#1

I’m not sure whether this is a bug but I think it’s useful to know

If using the Xenon in mesh only mode without a cloud connection the following code with SYSTEM_THREAD(ENABLED) will leave the Xenon flashing green forever and the application will never start running. Removing SYSTEM_THREAD(ENABLED) and the code runs fine. The mesh connection in my case takes less than 2 seconds. That’s perfect if the device needs to sleep.

SYSTEM_THREAD(ENABLED) without a call to Mesh.connect() will leave the Xenon breathing white which is correct but as soon as you call Mesh.connect() it seems to want to connect to the cloud even though Particle.connect() is not called.

//SYSTEM_THREAD(ENABLED);
SYSTEM_MODE(MANUAL);

bool beat = FALSE;

void myHandler(const char *event, const char *data)
{
  beat = atoi(data);
  digitalWrite(D7, beat);
}

void setup() {
    Mesh.connect();
    while (!Mesh.ready()) {
        
    }
	pinMode(D7, OUTPUT);
	Mesh.subscribe("Heartbeat", myHandler);
}

void loop() {
	
}

For the above code to function once connected your Argon or another Xenon will need to Mesh.publish a bool alternating between TRUE and FALSE.


[Updated 12/10] Particle Mesh Known Issues and Fixes
Boron LTE System Modes
Mesh Network behavior question
Xenon MESH Network - Tips & Tricks
#2

Hey @Jseiler, thanks for posting this issue. I just tested this on one of my Xenons and verified that this is indeed an issue in the Device OS. I’ll notify the engineering team and will keep you posted on the status. Thanks for your patience and for taking the time to post this issue!


#3

Hello Jseiler, the same happened to me.

I tried to pair with my phone and the particle app, but after a few attempts the particle started to flash green permanently.

Do you suggest me try to flash over the serial using particle CLI?


#4

Update here: The firmware team suspects that this may be a race condition between the system code that manages the cloud connection and user code, and they’ll dig into this today. I’ll update again when we identify the root cause and/or have a fix. Thanks again for posting!


#5

Thank you @bsatrom for the insanely quick response, the update / fix will be well received.