# How to supervise/Query Network Registration in Realtime

**URL:** <https://forum.legato.io/t/how-to-supervise-query-network-registration-in-realtime/4638>\
**Category:** Legato Application Framework\
**Created:** [August 20, 2019, 1:09am UTC](https://forum.legato.io/t/how-to-supervise-query-network-registration-in-realtime/4638 "2019-08-20T01:09:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eddie435](https://avatars.discourse-cdn.com/v4/letter/e/e9bcb4/32.png) [@eddie435](https://forum.legato.io/u/eddie435)\
**Post date:** [August 20, 2019, 1:09am UTC](https://forum.legato.io/t/how-to-supervise-query-network-registration-in-realtime/4638/1 "2019-08-20T01:09:46Z")

</div>

Hi all,

I currently have Network Registration State Event Handler in my app to monitor the network’s registration state, but I noticed that if I’m not using the network, it doesn’t monitor the state realtime. I removed the antenna from the FX30S modem, but the NetRegStateEventHandler doesn’t get triggered with an event like you would expect.

My app needs to be able to supervise the network registration state continuously, but I don’t know what API function to use to do it. How do I get the NetRegStateEventHandler to update?

Any suggestions greatly appreciated!

Thanks.

Eddie

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [August 20, 2019, 8:11am UTC](https://forum.legato.io/t/how-to-supervise-query-network-registration-in-realtime/4638/2 "2019-08-20T08:11:42Z")

</div>

have you tried the cm tool?

> **[cm - Legato Docs](https://docs.legato.io/latest/toolsTarget_cm.html#toolsTarget_cm_radio)**
>
> legato™ is an open source Linux-based embedded platform designed to simplify connected IoT application development

Also have you tried the modemdemo sample app?  
Does it work?

---

<div class="post-metadata">

**Author:** ![eddie435](https://avatars.discourse-cdn.com/v4/letter/e/e9bcb4/32.png) [@eddie435](https://forum.legato.io/u/eddie435)\
**Post date:** [August 28, 2019, 7:41pm UTC](https://forum.legato.io/t/how-to-supervise-query-network-registration-in-realtime/4638/3 "2019-08-28T19:41:13Z")

</div>

I’ve tried the CM tools, and looked at the modemdemo app, but found nothing that could help me.

Like mentioned above, I have **NetRegStateEventHandler** in my app, but it doesn’t send an event after I remove the antenna. It’s like it’s not actively checking the registration state.

If I try to open a socket, then it realizes the registration was lost and that the signal strength is low, and then it sends an event.

If that is the way the modem works, than I need a function that will get the current status of the modem and check registration and signal strength so that I may supervise the state at all times.

Eddie

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [August 29, 2019, 3:49am UTC](https://forum.legato.io/t/how-to-supervise-query-network-registration-in-realtime/4638/4 "2019-08-29T03:49:51Z")

</div>

I don’t see problem to receive the off network event in NetRegStateHandler() in modemdemo application.  
In the callback function NetRegStateHandler(), add the following debug message:  
LE\_INFO(“%s”, GetNetStateString(state));

After that if I remove the antenna, I can receive:

* * *

Aug 29 03:46:55 | modemDemo[1971]/demoComponent T=main | demo.c NetRegStateHandler() 971 | off of the network

* * *
