Boron LTE System Modes

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>


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

    for (uint32_t ms = millis(); millis() - ms < 1000; Particle.process());
    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()); 

    for (uint32_t ms = millis(); millis() - ms < 1000; Particle.process());
    for (uint32_t ms = millis(); millis() - ms < 1000; Particle.process());
    lastPublish = millis();
  } // End "It's Time To Publish"

}  // End LOOP()

Thanks in advance!

This is a known issue.

  1. SYSTEM_MODE(MANUAL) and SEMI_AUTOMATIC not working properly
    Status: Under investigation (reported in 0.8.0-rc.25)
    Example: Xenon, combining threaded and manual modes can leave Xenon flashing green permanently

Also after (and potentially also Particle.connect() won’t power up the radio module - needs to be done explicitly (for now).


@rickkas7, thanks for the Reply and Link. That obviously explains it.

@ScruffR, I saw the Issue you posted.
My simplified flow:
Cellular.on(); Particle.connect(); Particle.publish; Particle.disconnect();;
Please forgive my ignorance if this is a stupid question, but the flow shown above “should” avoid the Issue you linked to, correct?

I think I’ve found a solution to not having System_Modes on the Boron for the time being.
I’ll post details after further testing.

I have only tested WiFi so far and there it was just WiFi.on() and Particle.connect() without the former the latter didn’t connect. With it it did.
Also you can directly go from Particle.connected() == true to (or for the matter) without the intermediate steps.
But to reconnect, I’ve found WiFi.on() was required.