waitFor(Particle.connected, timeout) doesn't work on BRN404X

I'm using the waitFor(Particle.connected, timeout) function on the BRN404X to continue operation after power-up, even if there’s no cellular connection, but it’s not timing out as expected. Has anyone else experienced this issue or found a solution?

Thanks,
David

Are you sure it's blocking on that line?

Do you have SYSTEM_THREAD(ENABLED)? If not, then setup() won't even run so that code won't be executed. (Except on Device OS 6.2.0, where it's defaults to on, and some other exceptions involving SYSTEM_MODE).

If you have a Particle.publish() without a check for Particle.connected()? If so, that line would block until connected.

You're right! I didn’t have SYSTEM_THREAD(ENABLED) initially, but the function works perfectly now that I’ve added it!

Best,
David

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.