# Ntpd via cellular data connection

**URL:** <https://forum.legato.io/t/ntpd-via-cellular-data-connection/4257>\
**Category:** Legato Application Framework\
**Created:** [April 8, 2019, 2:35pm UTC](https://forum.legato.io/t/ntpd-via-cellular-data-connection/4257 "2019-04-08T14:35:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lazzox](https://avatars.discourse-cdn.com/v4/letter/l/b9bd4f/32.png) [@lazzox](https://forum.legato.io/u/lazzox)\
**Post date:** [April 8, 2019, 2:35pm UTC](https://forum.legato.io/t/ntpd-via-cellular-data-connection/4257/1 "2019-04-08T14:35:31Z")

</div>

At the moment when I configure in /etc/time\_service.conf to

`TIME_SERVICES="ntpd_time"` it doesn’t update system time when cellular data connection is established, it only works when eth connection is established. I tried using IP adress from [pool.ntp.org](http://pool.ntp.org).  
Is there a way to make this work?

I am using 18.04 Legato on WP7702 and I don’t have AirVantage services installed, also my application is desired to be sandboxed, installed services are:

[running] atService  
[running] cellNetService  
[running] dataConnectionService  
[running] fwupdateService  
[running] gpioService  
[running] modemService  
[running] portService  
[running] powerMgr  
[running] secStore  
[stopped] tools

I don’t want to use **qcom\_time** because some providers that I have connected to didn’t provide correct time.

---

<div class="post-metadata">

**Author:** ![JayM2M](https://avatars.discourse-cdn.com/v4/letter/j/3d9bf3/32.png) [@JayM2M](https://forum.legato.io/u/JayM2M)\
**Post date:** [May 28, 2019, 7:33am UTC](https://forum.legato.io/t/ntpd-via-cellular-data-connection/4257/2 "2019-05-28T07:33:21Z")

</div>

Hi,

Try to replace “ **`eth0`** ” by “ **`rmnet_data0`** ” in these two scripts:

- `/etc/network/if-up.d/ntpd_start`
- `/etc/network/if-down.d/ntpd_stop`

* * *

Jay

---

<div class="post-metadata">

**Author:** ![lazzox](https://avatars.discourse-cdn.com/v4/letter/l/b9bd4f/32.png) [@lazzox](https://forum.legato.io/u/lazzox)\
**Post date:** [May 28, 2019, 8:07am UTC](https://forum.legato.io/t/ntpd-via-cellular-data-connection/4257/3 "2019-05-28T08:07:02Z")

</div>

Tahnks for your reply in the end I patched these files:  
/etc/time\_service.conf  
/etc/network/interfaces  
And added two scripts one in the  
/etc/init.d/ntpd\_start\_custom  
/etc/network/if-up.d/ntpd\_start\_custom

Added protection in the script to wait until the internet connection is established and then to reach for the time from ntp server. This solved my issue. Thanks
