🛠 Se connecter au réseau cellulaire et publier un événement
Objectives
The Boron is the cellular board in the Particle range: the BRN404X model features a u-blox SARA-R510S modem (LTE Cat M1, bands 2/4/5/12/13, North America only) and a pre-provisioned EtherSIM. This tutorial takes you from "firmware running" to "connected object": enable the radio, wait for network registration and cloud connection, read signal strength (Cellular.RSSI), and publish events with Particle.publish. You will also verify that the external antenna is properly connected — without it, there is no cellular connectivity.
Hardware
- 1× Particle Boron LTE (BRN404X) with the mandatory external antenna on the U.FL connector (the PARANTC41EA flex antenna provided in kits)
- LiPo battery or stable USB power supply (cellular transmission causes current spikes)
- Particle account with a device already claimed (
particle listshows "online")
Complete Code
// Boron — connexion cellulaire + publication cloud (Device OS 4.x LTS)
SYSTEM_THREAD(ENABLED); // le stack cloud tourne en parallèle de loop
int rssi = 0;
void setup {
Serial.begin(9600);
Particle.variable("rssi", rssi);
Cellular.on;
Cellular.connect;
// Attendre jusqu'à 120 s : enregistrement réseau + connexion cloud
if (waitFor( => Cellular.ready, 120000)) {
Serial.println("Cellulaire + cloud prets");
} else {
Serial.println("Echec de connexion : verifier antenne et couverture");
}
}
void loop {
if (Cellular.ready) { // reseau ET cloud connectes
rssi = Cellular.RSSI;
char buf[64];
snprintf(buf, sizeof(buf), "%d", rssi);
Particle.publish("boron-rssi", buf, PRIVATE);
Serial.printf("RSSI=%d publie\n", rssi);
}
delay(300000); // 5 minutes
}
Expected Verification
After flashing, the RGB LED goes through network search phases and then stays in a cyan "breathing" state when everything is connected. particle list shows your device as "online". On the cloud side, the private event boron-rssi arrives every 5 minutes: verify it with particle subscribe PRIVATE <your_account> or in the event stream of the Particle console. The RSSI value varies with the antenna position.
Common Errors
- Cellular antenna missing or poorly clipped on the U.FL connector: the LED blinks cyan indefinitely; the U.FL connector is fragile, do not manipulate it repeatedly.
- BRN404X with Device OS < 4.0.0: this model requires 4.x LTS, firmware that is too old will not start correctly.
- Confusing network ready and cloud ready: only
Cellular.readyguarantees both;Cellular.connectalone is not sufficient to publish. - Publishing rate exceeded: the limit is 4 events/second and 60/minute; beyond that,
Particle.publishreturns false. - LTE models are not certified in Europe and 2G/3G models are deprecated (networks shut down in the US in 2022): check your operator's coverage before deploying.
Other tutorials for this board
Code examples for this board
clignotante.inoArduinobouton-evenement.inoArduinofonction-distance.inoArduinocapteur-dht.inoArduinoruban-neopixel.inoArduinopwm-respiration.inoArduino