Page 1 of 1

NTP over USB 3G Modem PPP Connection

Posted: Thu Jun 19, 2014 12:39 am
by cyanarnofsky
Recently I have noticed that when I connect with Ethernet or Wifi Dongle my time keeps up well. I also have a 3G modem I have working great with Wvdial, but when I boot the Pi with only the 3G connected it seems like it cant pull current time through the modem as it is always way off by hours. Soon as I pull the 3G Modem and reboot on either Wifi or Ethernet again the time pops up correct. Possible I need to point the NPT to the PPP connection?

The 3G connection is established during boot as well.

Re: NTP over USB 3G Modem PPP Connection

Posted: Thu Jun 19, 2014 6:07 am
by sander2
NTP uses port 123 (ntp 123/tcp) ... so: is that port open when 3G is up? Maybe your 3G has closed it?

Furthermore: anything in /var/log/* ?

What is the output of

Code: Select all

ntpdate -d 0.europe.pool.ntp.org
while on normal Internet versus 3G?

Re: NTP over USB 3G Modem PPP Connection

Posted: Fri Jun 20, 2014 5:44 pm
by cyanarnofsky
Returns command not found.


I may need to dig deeper, tried to Ping a few external sources from the Pi and they all fail. Sources ping fine from my PC so I know they are valid. Seems like either the PPP connection is restricting something or possible my ISP (although my ISP said no ports are blocked within that range :/)

I know LAN or Wifi the time stays correct. Odd part is I can ping my Pi modem and SSH into it remotely so it is network visible...kind of

Re: NTP over USB 3G Modem PPP Connection

Posted: Fri Jun 20, 2014 5:48 pm
by DougieLawson
cyanarnofsky wrote:Returns command not found.
Try ntpd -g -q

Re: NTP over USB 3G Modem PPP Connection

Posted: Fri Jun 20, 2014 5:57 pm
by cyanarnofsky
No output, or date change after command:

ntpd -g -q

Maybe default gateway? Whats the correct way to set that for PPP?

Re: NTP over USB 3G Modem PPP Connection

Posted: Fri Jun 20, 2014 6:48 pm
by cyanarnofsky
Route -n shows no default

Re: NTP over USB 3G Modem PPP Connection

Posted: Fri Jun 20, 2014 7:20 pm
by sander2
0.0.0.0 = default, so that's good.

Easy next step: check that IP is working:

Code: Select all

mtr -nrc2 8.8.8.8
Example of good output:

Code: Select all

$ mtr -nrc2 8.8.8.8
HOST: haring                      Loss%   Snt   Last   Avg  Best  Wrst StDev
  1.|-- 62.59.54.1                 0.0%     2    0.4   0.7   0.4   1.1   0.4
  2.|-- 62.59.30.129               0.0%     2    0.6   0.6   0.6   0.6   0.0
  3.|-- 62.59.254.162              0.0%     2    2.4   2.5   2.4   2.5   0.1
  4.|-- 72.14.219.174              0.0%     2    1.8   1.8   1.8   1.8   0.0
  5.|-- 209.85.254.90              0.0%     2   45.8  23.8   1.8  45.8  31.1
  6.|-- 72.14.238.153              0.0%     2    2.0   2.0   2.0   2.0   0.0
    |  `|-- 209.85.253.249
  7.|-- 209.85.254.231             0.0%     2    5.2   5.2   5.2   5.2   0.0
  8.|-- 216.239.49.30              0.0%     2    5.3   5.3   5.3   5.3   0.0
    |  `|-- 216.239.49.28
  9.|-- ???                       100.0     2    0.0   0.0   0.0   0.0   0.0
 10.|-- 8.8.8.8                    0.0%     2    5.4   5.4   5.4   5.4   0.0


Re: NTP over USB 3G Modem PPP Connection

Posted: Fri Jun 20, 2014 7:55 pm
by DougieLawson
sander2 wrote:

Code: Select all

mtr -nrc2 8.8.8.8
You'll need to install that with apt-get.

Re: NTP over USB 3G Modem PPP Connection

Posted: Fri Jun 20, 2014 8:07 pm
by sander2
DougieLawson wrote:
sander2 wrote:

Code: Select all

mtr -nrc2 8.8.8.8
You'll need to install that with apt-get.
... so that could be a chicken-egg-situation? ;)

Is 'tracepath' installed by default? Less useful, but OK for a test:

Code: Select all

$ tracepath -n 8.8.8.8
 1:  62.59.54.21                                           0.230ms pmtu 1500
 1:  62.59.54.1                                            0.448ms
 1:  62.59.54.1                                            0.380ms
 2:  62.45.30.129                                          0.621ms
 3:  62.45.254.162                                         2.067ms asymm  5
 4:  no reply
 5:  no reply
 6:  no reply
 7:  no reply

Re: NTP over USB 3G Modem PPP Connection

Posted: Fri Jun 20, 2014 8:21 pm
by DougieLawson
Nope. No tracepath nor traceroute.

I guess you could pull the DEBs on a Windows machine and install them on the RPi from a USB stick.

http://mirrordirector.raspbian.org/rasp ... _armhf.deb
http://mirrordirector.raspbian.org/rasp ... _armhf.deb

Re: NTP over USB 3G Modem PPP Connection

Posted: Fri Jun 20, 2014 8:42 pm
by sander2
... that leaves a manual hop measurement:

First hop, aka default gateway:

Code: Select all

ping -t1 -n -c1  8.8.8.8 | grep -i from
Second hop, usually some public IP address:

Code: Select all

ping -t2 -n -c1  8.8.8.8 | grep -i from
So the OP should be able to do that and see if there is first hop and a second hop. If not, there is Internet routing problem, and not a NTP problem.

Re: NTP over USB 3G Modem PPP Connection

Posted: Fri Jun 20, 2014 8:57 pm
by DougieLawson

Code: Select all

 for i in `seq 1 30`; do ping -t$i -n -c1  8.8.8.8 | grep -i from; done

Re: NTP over USB 3G Modem PPP Connection

Posted: Fri Jun 20, 2014 9:22 pm
by cyanarnofsky
Thanks for your help, this was my own ignorance.

My modem operates in a private pool, didn't realize this one had been added to the pool so it isn't publicly rout-able....derrr.

Going to pull modem sys time directly from the nearest tower via AT command after boot. Should solve this and also do away with needing handle time zones, a win/win :)

Re: NTP over USB 3G Modem PPP Connection

Posted: Sun Jun 22, 2014 9:55 pm
by sander2
DougieLawson wrote:

Code: Select all

 for i in `seq 1 30`; do ping -t$i -n -c1  8.8.8.8 | grep -i from; done
Wow ... beautiful!