Using a input to control wifi

I swear I had done this in the past but now I can’t find it.

I want to be able to use a switch on an input to keep the Photon from connecting to the cloud. The WiFi access is not great in that location, and it’s not needed for daily operation, but I want to be able to easily have someone turn it back on if I need to push an update.

So really my questions are:

  1. What is the proper way to keep the Photon from waiting to connect to the cloud on boot
  2. Just want to confirm, if I boot as per 1 with the cloud /wifi disabled that I can later use WiFi.on() and Particle.connect() to connect back to the cloud (triggered by an input)

Thanks!

I found this thread that gave me the answers I seek…

I would always have SYSTEM_THREAD(ENABLED);

Then for 1. SYSTEM_MODE(MANUAL) or SYSTEM_MODE(SEMI_AUTOMATIC); and don’t call WiFi.on(); or WiFi.connect(); etc. and it stays offline. You need to accept that Particle.variable() and Particle.function() will not work and that certain system calls need to be avoided OR you check for WiFi.ready() or Particle.connected();

Yes for 2. Advantage of SEMI_AUTOMATIC is that once connected, it will retry to connect.