Cellular intermittent connection confusion

Hi, folks—I'm getting confusing results from one of two deployed Borons. I have two devices with identical hardware/user firmware/deviceOS setups deployed in two different locations. One of them is working as intended (in brief, collect a sensor sample, transmit via cell, go to sleep, wake again at firmware-calculated time). The other seems to be collecting its sample and connecting to the cloud but only intermittently transmitting the data. As far as I can tell remotely, it is going back to sleep.

The console for the worse device shows this (30% cellular signal strength,
19% cellular signal quality):

The 11 am transmissions cease before the Particle Cloud receives the waterLevel event (i.e., incomplete transmission). The 12 pm transmissions receive the event and corresponding data (i.e., complete transmission).

Both devices behaved as desired for ~ 15 hours but then the worse device stopped sending data a few hours ago this morning and struggled to connect when first deployed. Both are Boron 404x devices with the Particle-supplied and branded cell flex antenna.

My guess is that this is related to a cellular signal strength issue that is mostly out of my control, but if anyone has recommendations, I'm eager to find a more robust solution. One other confusing detail is that I had a similar, though not identical, sensor package running on a Boron in the same exact location for three weeks with no major cell drops.

BTW, rickkas7 (intentionally not tagging so as to not try to ping specifically) helped with a potentially related issue over here and I'm using that firmware chunk in the current script.

My sleep config is

config.mode(SystemSleepMode::ULTRA_LOW_POWER)
      .gpio(D2, FALLING)
      .duration(wakeInSeconds* 1000L); // Set seconds until wake
      // .network(NETWORK_INTERFACE_CELLULAR, SystemSleepNetworkFlag::INACTIVE_STANDBY);

with the INACTIVE_STANDBY flag commented out since I'm sleeping for ~ 3570 seconds (wakeInSeconds), just shy of an hour.

One thing: Make sure you check the result of Particle.publish(). Store the result in a variable, and at least use it in a Log.info() statement.

The reason is that if you don't check the result, the publish is asynchronous, and you could end up going to sleep before the transmission completes. This is more likely if there's poor connectivity and a retransmission is required.

Another good option is to use .flag(SystemSleepFlag::WAIT_CLOUD) in your sleep configuration to make sure all cloud acknowledgement have been received.

1 Like

Thanks, @rickkas7. I have been checking the result of Particle.publish() using the solution you helpfully offered over here

but hadn't been using that .flag(SystemSleepFlag::WAIT_CLOUD). I will add the latter and see if that makes a difference. The sensor is deployed in the field where I will leave it for a few weeks, so I'll wait to mark this as a solution till I have a chance to test the updated firmware in that same location (noting that the firmware worked without much of a hiccup at home, as often happens)! Thanks again.