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

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.

3 Likes

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!

2 Likes

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?

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!

4 Likes

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

1 Like

@bsatrom Has there been any updates on resolving this? I am experiencing the same issue

Thanks

Hey @jackpot, let me check with the firmware team and I’ll let you know today.

Hey @jackpot, I just spoke to the team and this is on our plate for the 1.2.0 firmware release. The current target for Beta 2 of this version of Device OS is slated for mid-May.

2 Likes

@bsatrom Thank you very much

1 Like