cyanarnofsky
Posts: 70
Joined: Tue Jul 31, 2012 11:33 pm

NTP over USB 3G Modem PPP Connection

Thu Jun 19, 2014 12:39 am

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.

sander2
Posts: 60
Joined: Wed Jul 04, 2012 2:22 pm

Re: NTP over USB 3G Modem PPP Connection

Thu Jun 19, 2014 6:07 am

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?

cyanarnofsky
Posts: 70
Joined: Tue Jul 31, 2012 11:33 pm

Re: NTP over USB 3G Modem PPP Connection

Fri Jun 20, 2014 5:44 pm

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
Last edited by cyanarnofsky on Fri Jun 20, 2014 5:55 pm, edited 1 time in total.

User avatar
DougieLawson
Posts: 38882
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: NTP over USB 3G Modem PPP Connection

Fri Jun 20, 2014 5:48 pm

cyanarnofsky wrote:Returns command not found.
Try ntpd -g -q
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

cyanarnofsky
Posts: 70
Joined: Tue Jul 31, 2012 11:33 pm

Re: NTP over USB 3G Modem PPP Connection

Fri Jun 20, 2014 5:57 pm

No output, or date change after command:

ntpd -g -q

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

cyanarnofsky
Posts: 70
Joined: Tue Jul 31, 2012 11:33 pm

Re: NTP over USB 3G Modem PPP Connection

Fri Jun 20, 2014 6:48 pm

Route -n shows no default
Attachments
Raspberry Pi • View topic - NTP over USB 3G Modem PPP Connection - Google Chrome.jpg
Raspberry Pi • View topic - NTP over USB 3G Modem PPP Connection - Google Chrome.jpg (20.42 KiB) Viewed 3872 times

sander2
Posts: 60
Joined: Wed Jul 04, 2012 2:22 pm

Re: NTP over USB 3G Modem PPP Connection

Fri Jun 20, 2014 7:20 pm

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


User avatar
DougieLawson
Posts: 38882
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: NTP over USB 3G Modem PPP Connection

Fri Jun 20, 2014 7:55 pm

sander2 wrote:

Code: Select all

mtr -nrc2 8.8.8.8
You'll need to install that with apt-get.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

sander2
Posts: 60
Joined: Wed Jul 04, 2012 2:22 pm

Re: NTP over USB 3G Modem PPP Connection

Fri Jun 20, 2014 8:07 pm

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

User avatar
DougieLawson
Posts: 38882
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: NTP over USB 3G Modem PPP Connection

Fri Jun 20, 2014 8:21 pm

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
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

sander2
Posts: 60
Joined: Wed Jul 04, 2012 2:22 pm

Re: NTP over USB 3G Modem PPP Connection

Fri Jun 20, 2014 8:42 pm

... 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.

User avatar
DougieLawson
Posts: 38882
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: NTP over USB 3G Modem PPP Connection

Fri Jun 20, 2014 8:57 pm

Code: Select all

 for i in `seq 1 30`; do ping -t$i -n -c1  8.8.8.8 | grep -i from; done
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

cyanarnofsky
Posts: 70
Joined: Tue Jul 31, 2012 11:33 pm

Re: NTP over USB 3G Modem PPP Connection

Fri Jun 20, 2014 9:22 pm

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 :)

sander2
Posts: 60
Joined: Wed Jul 04, 2012 2:22 pm

Re: NTP over USB 3G Modem PPP Connection

Sun Jun 22, 2014 9:55 pm

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!

Return to “Raspberry Pi OS”