# Time taken to connect to VPN is inconsistent and long

Source: https://forum.modalai.com/topic/899/time-taken-to-connect-to-vpn-is-inconsistent-and-long
Category: General Questions (https://forum.modalai.com/category/2/general-questions)
Posted: 2022-04-28 16:00:17 UTC by hmlow
Replies: 5 · Views: 745

## hmlow · 2022-04-28 16:00:17 UTC

Hi devs

Im running v0.50 of the software suite on VOXL. I have my own OpenVPN server and am using the LTEv2 board on the VOXL.

I noticed that the time taken for the modem and time-sync (needed so that OpenVPN can validate the certs) services to complete is inconsistent and long. Sometimes it takes 2mins and at times up to 4mins. 

I also noticed that the voxl-time-sync service takes a very long time to complete; almost 1-1.5mins.

May i know if there is a way to speed up the process?
I noticed that while /etc/systemd/timesyncd.conf exists, ntpd.service does not exist?
 *ntpd.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)*

Hope you guys can help!

## Reply by Eric Katzfey (ModalAI staff) · 2022-04-28 16:26:03 UTC

@hmlow Yes, it is the ntp time sync service that takes so long. And you cannot connect to the VPN until you have a reasonable system time otherwise the certificate authentication will fail. If you could figure out how to make it happen faster that would be great!

## Reply by hmlow · 2022-04-28 16:34:27 UTC (in reply to Eric Katzfey)

@Eric-Katzfey but what does VOXL actually uses for the time sync? 

If I'm not mistaken voxl-time-sync is just a simple python script to grab updated system date and time?

## Reply by Eric Katzfey (ModalAI staff) · 2022-04-28 16:43:44 UTC (in reply to hmlow)

@hmlow chronyd:
```/lib/systemd/system # systemctl status -l chronyd
● chronyd.service - NTP client/server
   Loaded: loaded (/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 1970-01-01 00:00:08 UTC; 1min 16s ago
  Process: 2334 ExecStart=/usr/sbin/chronyd $OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 2350 (chronyd)
   CGroup: /system.slice/chronyd.service
           └─2350 /usr/sbin/chronyd

Jan 01 00:00:07 apq8096 systemd[1]: Starting NTP client/server...
Jan 01 00:00:08 apq8096 chronyd[2350]: chronyd version 2.4 starting (+CMDMON +NTP +REFCLOCK +RTC -PRIVDROP -SCFILTER -SECHASH +ASYNCDNS +IPV6 -DEBUG)
Jan 01 00:00:08 apq8096 systemd[1]: Started NTP client/server.
```

## Reply by hmlow · 2022-04-30 05:03:46 UTC (in reply to Eric Katzfey)

@Eric-Katzfey said in [Time taken to connect to VPN is inconsistent and long](/post/4210):
> @hmlow Yes, it is the ntp time sync service that takes so long. And you cannot connect to the VPN until you have a reasonable system time otherwise the certificate authentication will fail. If you could figure out how to make it happen faster that would be great!

I think the process is long because chronyd is meant to make small adjustments over time. So when the VOXL boots up with a sys date as 1970, chronyd (even with makestep) doesnt work well.

I installed ntpd and ran it with the -q command to make that one large stepped correction when the modem is connected. chronyd.service starts only after ntpd -q completes and takes over to track and correct for time difference for the remainder of the flight.

Time taken from boot to openvpn connection is now about 1min 45s which is good enough for me.

## Reply by Eric Katzfey (ModalAI staff) · 2022-04-30 22:24:46 UTC (in reply to hmlow)

@hmlow Great, thanks for looking into that!
