I can’t seem to get Manual or Semi_Automatic Modes to work on the Boron LTE.
I’ve tried various combinations with and without Threading.
The intention of this test code is once a minute Turn Modem On,Connect, publish, Turn Modem Off.
The Boron is breathing White (as expected), but is breathing BLUE during the 10 seconds of particle.process after Particle.connect();
No Cloud connection or Publish happens.
What am I missing here?
//#include <Particle.h>
SYSTEM_MODE(MANUAL);
//SYSTEM_MODE(SEMI_AUTOMATIC);
//SYSTEM_THREAD(ENABLED);
unsigned long lastPublish = 0;
unsigned long publish_delay = 1 * 60000; // Multiply # of Minutes * 60,000 ms.
void setup() {
} // End Setup()
void loop() {
if ((millis() - lastPublish) > publish_delay) { // It's Time to Connect and Publish
Cellular.on();
for (uint32_t ms = millis(); millis() - ms < 1000; Particle.process());
Particle.connect();
for (uint32_t ms = millis(); millis() - ms < 10000; Particle.process()); // wait 10 seconds to Connect. Boron connects in <10seconds on my desk in AutoMode.
Particle.publish("Debug", "Boron Test Publish with System_Modes", 300, PRIVATE, NO_ACK);
for (uint32_t ms = millis(); millis() - ms < 1000; Particle.process());
Particle.disconnect();
for (uint32_t ms = millis(); millis() - ms < 1000; Particle.process());
Cellular.off();
for (uint32_t ms = millis(); millis() - ms < 1000; Particle.process());
lastPublish = millis();
} // End "It's Time To Publish"
} // End LOOP()
Thanks in advance!