SYSTEM_MODE(SEMI_AUTOMATIC);
does not turn on the network device at boot, much like MANUAL mode. When you call Particle.connect()
a lot of things are automatically done for you, like turning on the network module, making it’s connection, then connecting to the cloud.
So you do need Cellular.on()
before you can use System.sleep(SLEEP_MODE_SOFTPOWEROFF, 30L);
because the way the modem is put in deep sleep is via AT commands. So it must be initialized properly via Cellular.on() to accept the power off commands.
I’ll look into the threaded case not working.