Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#172756 - 30/07/2003 07:08 SNTP on the Empeg
fede
journeyman

Registered: 31/01/2002
Posts: 89
Loc: Texas
Has anyone ever tried to set up a SNTP client on the Empeg to update the Empeg clock from the internet? I am not a Linux guy so I would have no idea how to do this but I have noticed that my Empeg clock gains a few minutes every month. Has anyone else experienced this? I did a search for SNTP on both the forum and the FAQ but could not find anything.
_________________________
'a stock car stereo is a beautiful thing to waste' MKIIa 60gb MKIIa 20gb

Top
#172757 - 30/07/2003 07:23 Re: SNTP on the Empeg [Re: fede]
tms13
old hand

Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
Searching for "ntpdate" turns up this thread which explains what I did. I find that my player needs several seconds of correction per day, so it is really good to have automated this!

Did you mistype NTP in your subject line, or is SNTP some alternative time protocol?
_________________________
Toby Speight
030103016 (80GB Mk2a, blue)
030102806 (0GB Mk2a, blue)

Top
#172758 - 30/07/2003 07:32 Re: SNTP on the Empeg [Re: tms13]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
Did you mistype NTP in your subject line, or is SNTP some alternative time protocol?
From http://www.faqs.org/rfcs/rfc2030.html

SNTP can be used when the ultimate performance of the full NTP implementation described in RFC 1305 is not needed or justified. When operating with current and previous NTP and SNTP versions, SNTP Version 4 involves no changes to the NTP specification or known implementations, but rather a clarification of certain design features of NTP which allow operation in a simple, stateless remote-procedure call (RPC) mode with accuracy and reliability expectations similar to the UDP/TIME protocol described in RFC-868.
_________________________
- Tony C
my empeg stuff

Top
#172759 - 30/07/2003 08:37 Re: SNTP on the Empeg [Re: tms13]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5682
Loc: London, UK
To that, I'd add that you can find an ntpdate binary (and a bunch of other useful stuff besides) on my website, here. You'll want base.tar.gz.
_________________________
-- roger

Top
#172760 - 30/07/2003 11:59 Re: SNTP on the Empeg [Re: tms13]
fede
journeyman

Registered: 31/01/2002
Posts: 89
Loc: Texas
I only searched for SNTP I was not aware of NTP. I downloaded the ntpdate file from Roger's web site (thanks Roger) and put it in a new directory at /usr/local/bin. I also created a copy of your timesynch.sh script and put it in the same location. I put the exact same line in the config.ini as you showed.


Yes, I did make it work.

I wrote a short script called /usr/local/bin/timesync.sh as follows:


#!/bin/sh
(sleep 10; /usr/local/bin/ntpdate $@) &


and put the following in config.ini:

;@AC ;@EXEC /usr/local/bin/timesync.sh 10.70.x.x 10.70.x.x 10.70.x.x

where the x.x are replaced with the correct values for the time servers here.


The only change I made was for the address in the config.ini file


;@AC ;@EXEC /usr/local/bin/timesync.sh tick.greyware.com tick.greyware.com tick.greyware.com


I am sure I must have done something wrong but I do not know what.

The empeg boots fine but does not actually change the time.

I am running 2.00 developer version with hijack 340 with the empeg in Mark Lord dock. I am also using DHCP.

_________________________
'a stock car stereo is a beautiful thing to waste' MKIIa 60gb MKIIa 20gb

Top
#172761 - 30/07/2003 12:03 Re: SNTP on the Empeg [Re: fede]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
Does the empeg use the DNS setting from your DHCP server? If not then you may want to try using the IP addresses instead.

Top
#172762 - 30/07/2003 12:04 Re: SNTP on the Empeg [Re: fede]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Is there a resolver on the empeg? I'm guessing that there's not, which means that you'll need to specify IP addresses and not DNS names.
_________________________
Bitt Faulk

Top
#172763 - 30/07/2003 12:17 Re: SNTP on the Empeg [Re: wfaulk]
fede
journeyman

Registered: 31/01/2002
Posts: 89
Loc: Texas
OK, I changed the config.ini. It now reads like this...

;@AC ;@EXEC /usr/local/bin/timesync.sh 208.14.208.19 208.14.208.19 208.14.208.19


It is still a no go on the time update. Is it possible that since the player is in a dock it is misinterpreting the ;@AC argument?
_________________________
'a stock car stereo is a beautiful thing to waste' MKIIa 60gb MKIIa 20gb

Top
#172764 - 30/07/2003 14:46 Re: SNTP on the Empeg [Re: fede]
tms13
old hand

Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
Firstly, no need to repeat the same nameserver address three times - I should have been more clear in my example that they were three different addresses. That shouldn't harm, though.

I suspect that you forgot to make the script executable. Either make it executable (chmod +x /usr/local/bin/timesync.sh) or explicitly start a shell to interpret it:
;@AC ;@EXEC /bin/sh /usr/local/bin/timesync.sh 208.14.208.19 208.14.208.19 208.14.208.19


Also, check for errors on the console. I would hope that Hijack would print something if exec() fails! If you don't see a line beginning with "hijack_exec(" then it's not even trying. What I get in my boot log is something like
Starting player
Hijack: intercepting config.ini

hijack_exec("/usr/local/bin/timesync.sh 10.70.x.a 10.70.x.b 10.70.x.c 1)
player.cpp : 385:empeg-car 2.00 2003/04/01.
Prolux 4 empeg car - 2.1434 Mar 26 2003
Vcb: 0x40891000
30 Jul 19:09:35 ntpdate[72]: adjust time server 10.70.x.a offset -0.391570 sec


There's (unsurprisingly) a ten-second delay during this phase.

_________________________
Toby Speight
030103016 (80GB Mk2a, blue)
030102806 (0GB Mk2a, blue)

Top
#172765 - 30/07/2003 16:23 Re: SNTP on the Empeg [Re: wfaulk]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5682
Loc: London, UK
Is there a resolver on the empeg?

There is, if you install base.tar.gz and configs.tar.gz from the location I linked to. configs.tar.gz is a set of hoopy scripts that figure out whether to configure my empeg for home/work. You might need some of that -- there's a template /etc/resolv.conf in there, e.g..
_________________________
-- roger

Top
#172766 - 31/07/2003 10:42 Re: SNTP on the Empeg [Re: tms13]
fede
journeyman

Registered: 31/01/2002
Posts: 89
Loc: Texas
I suspect that you forgot to make the script executable. Either make it executable (chmod +x /usr/local/bin/timesync.sh) or explicitly start a shell to interpret it:

You are right. I did forget to make the script executable.

I am at work right now and the only prompt I can get on the player (that I know of is via ftp) My serial cable is at the house. Unless there is a way to make it executable via ftp I will wait until I get home to try that crucial step.

Thanks for your help.

Please forgive my ignorance. I was brought up on Microsoft operating systems and am still trying to learn the Linux interfaces and shell scripting. I am starting from scratch and it seems like a long road ahead.

Does anyone have any suggestions for a Linux newbie like me trying to get started? I am a programmer in Windows but would like to also be a programmer in Linux.
_________________________
'a stock car stereo is a beautiful thing to waste' MKIIa 60gb MKIIa 20gb

Top
#172767 - 31/07/2003 11:08 Re: SNTP on the Empeg [Re: fede]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Unless there is a way to make it executable via ftp
Have your ftp client send the command ``site chmod 755 timesync.sh''. With Windows's CLI ftp client, that's ``quote site chmod 755 timesync.sh''.
_________________________
Bitt Faulk

Top
#172768 - 31/07/2003 11:12 Re: SNTP on the Empeg [Re: tms13]
fede
journeyman

Registered: 31/01/2002
Posts: 89
Loc: Texas
I foud a cable. I modified permissions on timesync.sh. After getting a permissions error on sleep I realized I did not even have that file on the machine. It was in the base.tar that I got from Roger. I put that on the player and gave it execute permission as well. I also gave execute permission to ntpdate.

Now if I try to run the timesync.sh from a shell I do get the delay from sleep. There is a new error though.

empeg:/usr/local/bin# timesync.sh
empeg:/usr/local/bin# /usr/local/bin/ntpdate: error in loading shared libraries:
librt.so.1: cannot open shared object file: No such file or directory


What am I missing?
_________________________
'a stock car stereo is a beautiful thing to waste' MKIIa 60gb MKIIa 20gb

Top
#172769 - 31/07/2003 11:14 Re: SNTP on the Empeg [Re: wfaulk]
fede
journeyman

Registered: 31/01/2002
Posts: 89
Loc: Texas
Have your ftp client send the command ``site chmod 755 timesync.sh''. With Windows's CLI ftp client, that's ``quote site chmod 755 timesync.sh''.

Thanks for the tip!
_________________________
'a stock car stereo is a beautiful thing to waste' MKIIa 60gb MKIIa 20gb

Top
#172770 - 31/07/2003 11:19 Re: SNTP on the Empeg [Re: fede]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
You need to have the /lib/librt* files from base.tar.gz on the empeg, too. You might want to just put the entirety of that archive on there.
_________________________
Bitt Faulk

Top
#172771 - 31/07/2003 11:25 Re: SNTP on the Empeg [Re: wfaulk]
fede
journeyman

Registered: 31/01/2002
Posts: 89
Loc: Texas
You need to have the /lib/librt* files from base.tar.gz on the empeg, too. You might want to just put the entirety of that archive on there.


Do I need to set all of the files in the to have execute permission? If so, is there some sort of wildcard command to cover all of them at once?

Thank you for your help.
_________________________
'a stock car stereo is a beautiful thing to waste' MKIIa 60gb MKIIa 20gb

Top
#172772 - 31/07/2003 11:37 Re: SNTP on the Empeg [Re: wfaulk]
fede
journeyman

Registered: 31/01/2002
Posts: 89
Loc: Texas
You need to have the /lib/librt* files from base.tar.gz on the empeg, too. You might want to just put the entirety of that archive on there.


One other question; should the /lib/librt* files go in /lib/ or in /usr/lib/?
_________________________
'a stock car stereo is a beautiful thing to waste' MKIIa 60gb MKIIa 20gb

Top
#172773 - 31/07/2003 11:39 Re: SNTP on the Empeg [Re: fede]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Uncompress the base.tar.gz file to base.tar, transfer the whole base.tar file and extract it (tar xf base.tar) directly on the empeg; this will take care of the permissions issues. You should extract it in /, not /usr/.
_________________________
Bitt Faulk

Top
#172774 - 31/07/2003 11:58 Re: SNTP on the Empeg [Re: wfaulk]
fede
journeyman

Registered: 31/01/2002
Posts: 89
Loc: Texas
Thanks Bitt. That worked. Now I just have to find a better internet NTP address. The one I was using for SNTP apparently does not work for this.

empeg:/# /usr/local/bin/timesync.sh 208.14.208.19
empeg:/# 31 Jul 15:53:42 ntpdate[3320]: no server suitable for synchronization found


I will take a look on the web for some listings.
_________________________
'a stock car stereo is a beautiful thing to waste' MKIIa 60gb MKIIa 20gb

Top
#172775 - 31/07/2003 12:07 Re: SNTP on the Empeg [Re: fede]
djc
enthusiast

Registered: 08/08/2000
Posts: 351
Loc: chicago
if you're in the US, try time.nist.gov.

--dan.

Top
#172776 - 31/07/2003 12:34 Re: SNTP on the Empeg [Re: fede]
julf
veteran

Registered: 01/10/2001
Posts: 1307
Loc: Amsterdam, The Netherlands
Does anyone have any suggestions for a Linux newbie

Well, the nice thing about UNIX (of which Linux is a dialect) is that it ( unlike Windows) takes a few core ideas (such as "everything is a file") and stretches them pretty far. Despite being almost 20 years old, I would still recomend The UNIX Programming Environment by Brian Kernighan and Rob Pike.

Top
#172777 - 31/07/2003 16:22 Re: SNTP on the Empeg [Re: wfaulk]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5682
Loc: London, UK
You can use tar xfz on the empeg itself -- no need to gunzip the file first.

I keep the base.tar.gz and configs.tar.gz in /drive0, so that they're not overwritten by applying a .upgrade file. Then I just:

# cd /
# tar xvfz drive0/base.tar.gz
# tar xvfz drive0/configs.tar.gz
# exit
(restart the player)
Ctrl+C
(the scripts run for the first time and sort themselves out)
# exit
Ctrl+C
(to remount the disks read-only)
# exit
(to restart the player)
_________________________
-- roger

Top
#172778 - 31/07/2003 18:07 Re: SNTP on the Empeg [Re: Roger]
fede
journeyman

Registered: 31/01/2002
Posts: 89
Loc: Texas
OK,

I got it working. I think I had finally gotten the configuration right at work but the firewall there was not letting out NTP traffic. I brought it home and it worked the first time.

That was when I noticed something else. After adjusting the time, my player is now precisely 3 hours fast. Is there an argument for time zone offsets with ntpdate?

Thanks
_________________________
'a stock car stereo is a beautiful thing to waste' MKIIa 60gb MKIIa 20gb

Top
#172779 - 31/07/2003 22:40 Re: SNTP on the Empeg [Re: fede]
image
old hand

Registered: 28/04/2002
Posts: 770
Loc: Los Angeles, CA
it sets the UTC time. the time offset is in the player's settings somewhere

Top
#172780 - 01/08/2003 09:42 Re: SNTP on the Empeg [Re: djc]
pim
addict

Registered: 14/11/2000
Posts: 474
Loc: The Hague, the Netherlands
if you're in the US, try time.nist.gov


The Windows Time Service in Windows 2000/2003/XP is also based on NTP.
Only the server variants operate as NTP servers, though. So if you have a Windows 2000/2003 Active Directory Domain Controller in your network, you can use that as an NTP server, without having to configure anything.

You may, however, prefer to sync this server itself to a reliable NTP source using

net time /setsntp:your.real.ntp.server


Pim

Top