I have brand new Boron LTE running 0.9.0 OS. I’m using Web IDE and Linux Mint as a host.
Since I want to use this as a standalone device, I added a LiPo battery.
First, I connect through the USB port and I can flash code and communicate with it just fine.
If I disconnect the USB cable and run it on the battery, I can flash new code, but upon restart it will not connect to the network. It gets stuck in listening mode. As soon as I reconnect the USB cable it connects to the network automatically. Am I missing something?
I even tried hard-coding the connect function in the setup. Still no luck.
Thanks
#include "Particle.h"
SYSTEM_MODE(AUTOMATIC);
void setup() {
Cellular.on();
Cellular.setActiveSim(INTERNAL_SIM);
Cellular.connect();
Cellular.clearCredentials();
Particle.connect();
// This is just so you know the operation is complete
pinMode(D7, OUTPUT);
digitalWrite(D7, HIGH);
}
void loop() {
}
That code will not work as intended. Because the SYSTEM_MODE is AUTOMATIC, setup and loop are not run until already connected to the cloud. You’d need to use SEMI_AUTOMATIC or use SYSTEM_THREAD(ENABLED) for that to work.
How did you initially configure the Boron?
There’s a setup complete flag that is set by the mobile apps when you complete the guided setup process. If the setup is not complete, the device generally boots into listening mode, even when it has a valid SIM. It shouldn’t depend on being connected to USB, however.
You could try this to manually set setup done:
#include "Particle.h"
#include "dct.h"
SYSTEM_MODE(SEMI_AUTOMATIC);
void setup() {
Cellular.setActiveSim(INTERNAL_SIM);
Cellular.clearCredentials();
// This set the setup done flag on brand new devices so it won't stay in listening mode
const uint8_t val = 0x01;
dct_write_app_data(&val, DCT_SETUP_DONE_OFFSET, 1);
// This is just so you know the operation is complete
pinMode(D7, OUTPUT);
digitalWrite(D7, HIGH);
Cellular.on();
Particle.connect();
}
void loop() {
}
That’s it, Rick! I tried your code and it that fixed it.
For some reason my setup never really finished. I followed the standard path (using Android phone), but the step where it comes back to the desktop app never completed. Despite this I was able to communicate with the device and program it except for the issue I described.
I just uploaded the code you suggested and it works. Now it will restart properly when running as a standalone.
thanks
I had a similar issue with a Boron LTE module running 0.8.0-rc.26 OS firmware. The code I was running would successfully connect to the cellular network and operate correctly when the module was powered by the USB cable connected to a computer. If used standalone with a fully charged lipo battery, it would flash blue continually.
I modified the code I was running which used system mode AUTOMATIC to use SEMI_AUTOMATIC as indicated in the above referenced code, still no dice. I added a Cellular.connect(); call after the Cellular.on(); call and that fixed the problem.
I now can connect to the cellular network with either the USB cable or the lipo battery.