Ultra low power mode in GPS example

Hello everyone,

I’m a new developer, I’ve used mangOH for some IoT applications.

I’m struggling with the following example that sends current location get from GPS to a cellphone via sms.

sample link: https://github.com/legatoproject/legato-af/tree/master/apps/sample/textLoc

The sample starts getting ULPM firmware version. If it’s not found it kills the process by using LE_FATAL_IF.

Then it gets the cellphone number. After that, it creates a network registration state handler. This is where my first question is: Why does it uses network registration as parameter to send the location? It’s not using the GPS signal itself as parameters (as I would expect), but the internet registration. The odd part is that when I enter “cm data” via Putty connected to MangOH, it says my sim is registered, why is it expecting that to change prior to sending my GPS location?

After adding the handler, it puts the function in the queue via le_event_QueueFunction. The function RegistrationStateHandler is the one executed when network registration state changes (am I right? please let me know if I’m not), and this function uses a switch statement to tell when the network status is LE_MRC_REG_ROAMING. Then it gets the GPS position, set boot by gpio and time and shutdown app via le_ulpm_ShutDown.

When the application is in ULPM, after a boot event happens (GPIO or time), does the main component start again?

Best regards,

Renato Zapata Lusni

Hello, rzapata

Why does it uses network registration as parameter to send the location?
I believe, it is because it uses not pure GPS, but A-GPS (also collecting data about your WI-Fi and cellular connection. You can check this guide to learn the difference.

I guess you need to switch to pure GPS mode