# Ultra low power mode in GPS example

**URL:** https://mangoh.discourse.group/t/ultra-low-power-mode-in-gps-example/1377
**Category:** mangOH Green
**Created:** [May 3, 2018, 2:46pm UTC](https://mangoh.discourse.group/t/ultra-low-power-mode-in-gps-example/1377 "2018-05-03T14:46:11Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rzapata](https://avatars.discourse-cdn.com/v4/letter/r/a587f6/32.png) [@rzapata](https://mangoh.discourse.group/u/rzapata)
#### Post date: [May 3, 2018, 2:46pm UTC](https://mangoh.discourse.group/t/ultra-low-power-mode-in-gps-example/1377/1 "2018-05-03T14:46:11Z")

</div>

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](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

---

<div class="post-metadata">

### Author: ![antoniohart](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@antoniohart](https://mangoh.discourse.group/u/antoniohart)
#### Post date: [December 2, 2020, 12:18pm UTC](https://mangoh.discourse.group/t/ultra-low-power-mode-in-gps-example/1377/2 "2020-12-02T12:18:14Z")

</div>

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](https://yalantis.com/blog/location-aware-app/) to learn the difference.

I guess you need to switch to pure GPS mode
