We have been quite successful with our project so far and we are encountering another hurdle we are getting over. Our system will run for about 24 hours connected to the network, but will mysteriously go offline and not re-connect. We are looking for suggestions on how we should be handling our data connections, here is our proposed flow:
le_avdata_AddSessionStateHandler to manage the session with Air Vantage.
PollForConnection to see if we’re online (sometimes it says we’re online when we actually aren’t)
If our publish fails we are considering using le_mrc_interface (modem radio control) and power cycling the radio. Is this a good idea? Or will this just cause us pain?
We have been looking at the RedSensorToCloud repo, but it doesn’t seem to have any way of connecting and disconnecting from the network and retrying if it cannot connect.
What legato version is using?
I had the same problem with legato 17.06.
Now with legato 17.11 all work fine (4 mangos without problem). I push data every 15mn with heartbeat set to 1h.
Have you checked why the network operator has thrown you out? some networks deny the radio resources to make sure that the connected device isn’t just stuck and deny radio resources. You may want to check the cause from le_mrc_NetworkRejectHandlerRef_t. if you don’t get immediate re-registration, you could scan the PLMN and attempt to register to the next available network and loop through the list. Once you are able to get onto an alternative network, your original network network should unblock you so that you can go back to it at a later date.
So, just so I’m clear - does legato automatically try to handle the connection through the session handler? If it loses connection does it try to re-connect? Or would it normally not try unless you’ve implemented a state machine that’s manually checking whether it has a connection?
We are running Legato 17.07.2… I’ll have to talk to @nick, but I believe there may be some breaking changes that we need to account for in an upgrade to 17.11.
We just upgraded to 17.11 and that was very smooth. We have added a retry timer if our AVSession returns failed, the retry timer power cycles the radio after waiting 2 minutes, 4 mins, 8 mins, or 16 mins depending on how many retries it’s attempted. When we turn off the radio we release the session, which probably doesn’t matter, and when we turn on the radio again we force the state to ‘no connection’ again in order for our loop to validate our connection.
Hoping to test this over the next 24 hours or so on 4 MangOH red units.
A side note - we confirmed that our connections had all died after 12 hours in the past… which doesn’t seem like a coincidence. The way to get them back was to power cycle the radios on the units.
@Francis.duhaut Which problem are you referring to? Keeping the device online (this topic) and getting AirVantage updates to work (the other topic you posted a link to) are completely separate concerns.
Just as a heads up, we ran into a new problem overnight on one of our units… Not sure if it will appear on our other units or not, but the avPublisher claims that it ran out of memory. It may be us causing a memory leak somewhere, but this is new after our latest update to 17.11 legato.
One further thing that’s new today after upgrading to 17.11 is one of our units is succesfully publishing, but AirVantage is showing ‘no communication available’. We can see that we have the right number of data points that have been received by AV, but we just don’t see the data on the platform.
Our publishing app is derivative of this repository: https://github.com/mangOH/RedSensorToCloud. The only change we made is some retries in the AvSessionStateHandler callback.