Device won't work unless there is wifi connection

Hi there, I got myself the bluetooth version (RedBear Duo), it is upgraded to latest firmware (0.3.1). connected it to wifi, claimed it and pushed a sketch into it via the particle website. my problem is after you turn it on (in the car, connected to OBD port), the green LED keeps blinking trying to establish wifi connection. the sketch will not start working unless there is internet. the first line in setup function is WiFi.off(); but this I assume only runs after the wifi connection is established.

how can I get it working when there is no internet? my code doesn’t need connection.

Cheers,
Ali

In addition to adding SYSTEM_MODE(AUTOMATIC), I would recommend adding SYSTEM_THREAD(ENABLED) at the top of your .ino file to enable automatic connection to wifi and multi-threading on your device as well.

I am having the same behavior even though I activated SYSTEM_THREAD(ENABLED). It doesn’t read anything from the CANbus unless it is connected to the internet. I’m using an Electron.

Is there a guide for this solution?

Thanks.

Hi Alan, the problem is the other way around. I don’t want to automatically connect the wifi. I want it to be off and disabled. I don’t want to have a dependancy on a wifi hotspot for my sketch to work.

Then SYSTEM_MODE(MANUAL) (modes) should be what you are looking for.

thanks!
that did the trick

1 Like

@itsmedavid, Thanks for answering that; you beat me to it. I can view the community but I cannot post anything when I am at the office. My responses have to wait until I am home.

System Mode MANUAL means that you control the Particle cloud connection and the WiFi connection manually. The default is no connection on startup.

[edit] SEMIAUTOMATIC means that processing is automatic once connected to the Cloud (and WiFi is connected). The default is not to connect until your application commands it.

AUTOMATIC means that the default behaviour is to automatically attempt to connect, which means it will not get around to running the application when there is no connection established.

[edit] Along with this, there is some functionality during the connection process that is blocking (it blocks the rest of the application thread). There is a good discussion on it here:

1 Like