PDA

View Full Version : Tivo Time Set



gabiwabi
20-08-2004, 06:36 PM
Hi all,

Well thanks to you all, I managed to get my new Tivo up and running.Absolutly GREAT!!
Problem, how and what do I set the time to, as the time on the shedule is wrong.
I have read, set it to GMT,Auckland or Pacific time.
Which one is correct?

Many thanks for all your continued support.

Cheers,
Gabi

fixxer37
21-08-2004, 08:03 AM
From the new wiki site I'm working on:
Download http://www.tjv.org.nz/tivo/postcodezones and http://www.tjv.org.nz/tivo/Auckland
FTP to Tivo in binary mode (bin). cd /hack and put the files.
Quit FTP and telnet to Tivo.
rw (change filesystem to read/write)
cp /etc/postcodezones /etc/postcodezones.bak
cp /hack/postcodezones /etc/postcodezones
cd /hack/zoneinfo
mkdir Pacific
cp /hack/Auckland /hack/zoneinfo/Pacific/
fixtivotime

That should find the postcode for Auckland, synchronize time with an internet time server and correct your time. Make sure there isn't any trailing spaces/characters on the Auckland file by typing in the /hack/zoneinfo/Pacific directory:
cp Auck<tab> Auckland The <tab> key should fill in the rest of the Auckland filename, including any trailing rubbish, and the second Auckland filename makes sure it's the correct name.
Also, use timezoneadj30.tcl to make sure you're on 7, GMT.
You should now reboot. (You can just type reboot at the prompt after you've finished copying etc). Before you reboot you may find that your timezone is out by 5 hours (minus). This should fix after a reboot.
If you have problems with any text files you've transferred, run them through dos2unix on tivo: dos2unix filename


If you are having problems using postcodes etc you can set the clock with this, and it should stay good until the next Daylight Savings shift, at which point you'll need to set it correctly:br> settime yyyymmddhhmmss
eg. settime 20041231235900
settime -rtc

gabiwabi
21-08-2004, 12:20 PM
Thanks very much for the advice.
Works just great!
I have a nother question if you dont mind.
I have a Motorolla Sky decoder.I am trying to modify the IR codes on the Tivo.
I downloaded the Motorola DTH325-4.tcl file from Tim's site, but not knowing too much about Linux ,am having problems loading it via Pico.

Do you have an short script on how to change the IR code.
I also understand that only one line in the existing stb.tcl file has to be alterd to 88887 wich is the IR code for the Motorolla box.

Many thanks in advance.
Cheers

thomson
02-10-2004, 05:46 PM
I guess those of you on the emulator have NTP or some other way of correcting the time for Daylight Savings. I have only just found out that it is happening "tonight" and as I run mine standalone (no internet access) I have made an attempt to automate it using cron.

I have created a script called Daylight_Savings.sh whose code has been included below.


# ===========================
# Adjust for Daylight Savings
# ===========================
# Daylight Time commences at 2.00am Standard Time on the last
# Sunday in September each year. It ends at 2.00am Standard
# Time (3.00am Daylight Time) on the first Sunday in April of
# the following year.
#
# ===============
# Crontab Entries
# ===============
# Correct time for Daylight Saving
# 0 2 * 9 0 /var/hack/DST/DST_Adjust.sh >> /var/hack/DST/log 2>&1 &
# 0 3 * 4 0 /var/hack/DST/DST_Adjust.sh >> /var/hack/DST/log 2>&1 &


PATH=/bin:/sbin:/tvbin:/devbin:/var/hack/bin:/var/hack/scripts

StartDST() {
time=`date -d "now +1 hour" "+%Y%m%d%H%M%S"`
settime $time
}

StopDST() {
time=`date -d "now -1 hour" "+%Y%m%d%H%M%S"`
settime $time
}

date "+%w %e %b %k" |\
while read day dom mon hour; do
# Check if it is the last Sunday in September
if [ $dom -ge 22 -a $day -eq 0 -a "$mon" = "Sep" -a $hour -eq 2 ]; then
StartDST
fi

# Check if it is the first Sunday in April
if [ $dom -le 7 -a $day -eq 0 -a "$mon" = "Apr" -a $hour -eq 3 ]; then
StopDST
fi
done


The following is my crontab entry whose first line will trigger the script to run at 2am every Sunday during September... the script will check that it is the last Sunday before performing an action (sorry but this is a limitation of the cron scheduler). The second line will trigger the script to run at 3am every Sunday during April... the script will check that it is the first Sunday before performing an action.


# Correct time for Daylight Saving
0 2 * 9 0 /var/hack/DST/DST_Adjust.sh >> /var/hack/DST/log 2>&1 &
0 3 * 4 0 /var/hack/DST/DST_Adjust.sh >> /var/hack/DST/log 2>&1 &


Note: You may think that the script may loop in April as the time will be adjusted from 3am back to 2am... but the cron scheduler is smart enough to only run the script once (otherwise it would get stuck in a continuous one-hour loop).

tarx
02-10-2004, 07:25 PM
Please keep in mind, the current version of the example postcode file on http://www.tjv.org.nz/tivo/postcodezones has the Auckland postcode value incorrectly listed as:

00800 Pacific/Auckland

which needs to changed to:

02113 Pacific/Auckland

to work correctly

Cheers, Gabe

zollymonsta
02-10-2004, 07:28 PM
From the new wiki site I'm working on:
Download http://www.tjv.org.nz/tivo/postcodezones and http://www.tjv.org.nz/tivo/Auckland
FTP to Tivo in binary mode (bin). cd /hack and put the files.
Quit FTP and telnet to Tivo.
rw (change filesystem to read/write)
cp /etc/postcodezones /etc/postcodezones.bak
cp /hack/postcodezones /etc/postcodezones
cd /hack/zoneinfo
mkdir Pacific
cp /hack/Auckland /hack/zoneinfo/Pacific/
fixtivotime


You only need to do this if you are not connecting to Ed's emulator (NZ).

Ie: if you are using loadguide and connecting to the OZ emulator, use the above. Otheriwse ignore.

zollymonsta
03-10-2004, 12:18 AM
Ed,

My TiVo connected to the emulator this morning ( I did a manual daily call at 4am) as the time was still 3am. The emulator didn't set the time forward to 4am when setting the clock. Should it do this, or do I need to do the Auckland timezone tweak?

ehintz
03-10-2004, 04:24 AM
Dunno what the TZ tweak does... Guide data is in localtime, but Tivo thinks it's GMT, so if you actually set the tivo properly (GMT adjusted to NZ, as NTP would do) you get a schedule off by 12ish hours. Because of this, the emulator tells the tivo to get time from localhost (if I set it up to point at an NTP server we get the data offset). For now anyway, it's just a manual process:

[TiVo [p0] ~]# settime 20041003081520
Time set to: Sun Oct 3 08:15:20 2004
Have a nice day.
[TiVo [p0] ~]# settime -rtc
Time set to: Sun Oct 3 08:15:29 2004
Have a nice day.
[TiVo [p0] ~]# reboot

I've thought of setting up a dummy NTP server which dishes out localtime as GMT; if somebody wants to set one up, do it and I'll point the emulator at it, and the time issues will be automagic. Meanwhile, for those who want to automate it, Thomson's script below would do a very good job. Personally, I think I'll just leave it. I have to reset all the bloody clocks in the house anyway, it's just one more thing I have to reset... :)

clive
03-10-2004, 10:10 AM
Please keep in mind, the current version of the example postcode file on http://www.tjv.org.nz/tivo/postcodezones has the Auckland postcode value incorrectly listed as:

00800 Pacific/Auckland

which needs to changed to:

02113 Pacific/Auckland

to work correctly

Cheers, Gabe
I did this but no matter which time server IP I try, I get a "Connection refused" error when rtimetz runs inside of fixtime.cron or fixtivotime. Which server are you able to successfully connect to?

Clive

zollymonsta
03-10-2004, 04:13 PM
Im having no end of trouble..

Our postcode is 02115. Found matching timezone Pacific/Auckland
Offset 0 for timezone GMT, daylight saving is 0
Connecting to time server 207.126.98.204
t was 3305776250 from server
t is now 1096787450
Time is 2004-10-03 07:10:50
Time set to: Sun Oct 3 07:10:50 2004
Have a nice day.
Time set to: Sun Oct 3 07:10:50 2004
Have a nice day.


I've set the timezone to 7... but whenever I run fixtivotime it wants to set it to 7am (when in fact it's 8pm).

Any ideas? This TiVo is running on Eds emulator.
I've also manually set it and issued settime -rtc but whenever I run fixtivotime it puts it back to the am - 1 hour again.

ehintz
03-10-2004, 05:22 PM
I've also manually set it and issued settime -rtc but whenever I run fixtivotime it puts it back to the am - 1 hour again.Don't run fixtivotime? :D

I don't...

zollymonsta
03-10-2004, 06:03 PM
Heh.. but, from memory, when it made the daily call it set the time incorrect once again.

ehintz
03-10-2004, 07:47 PM
Hmmm, it shouldn't... the daily call tells it to synchronize with the NTP server at 127.0.0.1, which of course will just time out (or sync with an NTP daemon on the tivo itself, but unless you've installed one it won't be there).

thomson
04-10-2004, 05:13 AM
Our postcode is 02115. Found matching timezone Pacific/Auckland
Offset 0 for timezone GMT, daylight saving is 0
Connecting to time server 207.126.98.204
...
I've set the timezone to 7... but whenever I run fixtivotime it wants to set it to 7am (when in fact it's 8pm).

Okay... firstly I do not run fixtivotime (hehe... need one of those Internet thingies for that :)) but I do notice a couple of things wrong in the above output. Firstly the daylight saving setting should be 1 as we are in DST rather than 0... and secondly you are running at a 0 offset from GMT, which is incorrect... it should be 43200.

I would suggest you check your postcodezones file to make sure it is in the correct format (can use the dos2unix command to correct this) as follows:


dos2unix postcodezones


That should fix up the offset problem (should display an offset of 43200) but not sure how to fix the daylight saving recognition. You might like to check that you have the zone info file installed (/var/hack/zoneinfo/Pacific/Auckland).

zollymonsta
04-10-2004, 08:05 AM
ahh thanks thomson... tried that, but it said segmentation fault.

However, I looked at it via the joe editor and it appears there were ^M at the end of line (stupid notepad on windows).

Removed those and resaved and now I get the appropriate output. (see below) So, it was obviously seeing I was in Auckland timezone, but couldnt do the rest because of the invalid characters... first time it's caught me out.


Our postcode is 02115. Found matching timezone Pacific/Auckland
Offset 46800 for timezone NZDT, daylight saving is 1
Connecting to time server 207.126.98.204
t was 3305833438 from server
t is now 1096891438
Time is 2004-10-04 12:03:58
Time set to: Mon Oct 4 12:03:58 2004
Have a nice day.
Time set to: Mon Oct 4 12:03:58 2004
Have a nice day.

ehintz
04-10-2004, 08:09 AM
Hmm, so you're syncing via NTP and the guide data is OK? We may want to add this set of steps to the setup instructions and set the emulator to dish real NTP addys...

zollymonsta
04-10-2004, 08:46 AM
I have loadguide runnning via a cronjob on my other TiVo, which seems to do the same thing once it's run (connects to remote time server and syncs time up) and I've had no problems with time and the guides. Will confirm this tonight.

I'll also check the TiVo on the emulator now that that's working and see if it's still ok with the guide data.

zollymonsta
04-10-2004, 03:47 PM
Yep, TiVo and TiVo guide data is fine after doing this.

If it can't be done when connecting to the emulator, it could be added manually via a cronjob each day?

ehintz
05-10-2004, 07:50 AM
Cron is probably the best solution for now. If I point the emulator ntp setting to a real ntp server, 63 tivos will suddenly be 12 hours off. ;-) Perhaps if we generate a NZ image (as discussed in the guide section today) we could set it up with these TZ files installed and config'd, and once critical mass is reached flip the switch...

zollymonsta
05-10-2004, 09:39 AM
Ok.. Sounds like a plan stan (er, Ed) :)
fixtivotime via cron it is for now.

thomson
05-10-2004, 10:13 AM
Ok.. Sounds like a plan stan (er, Ed) :)

Completely off topic... but I had a discussion a while back with some friends over the origin of "That's the plan, Stan" along with "What's the plan, Stan". The closest we got was a Sesame Street scetch (The Golden An). I have included a section below. Might be wrong... be interested if anyone knows for sure where we all might have picked it up from :)



"I take the Golden "An", and I put it in the tan van. I take
it to Dan, who takes it to Fran. Yeah, that's the plan."

"That's the plan?"

"What, who said that?"

"My name is Stan, I'm the man. You just got 15 years in the
can for stealing the Golden "An". Let's go."

"Aw, I shoulda ran."

ehintz
05-10-2004, 10:21 AM
Hah! I remember that sketch! Good times... :D

zollymonsta
05-10-2004, 10:21 AM
You're full of interesting information :)

thomson
22-10-2004, 01:09 PM
As I have recently acquired an Internet connection I have been playing around with time synchronisation. There are a few tools on the oztivo image that deal with this (ntpdate/rtimetz), but they have a few shortcomings (especially for those of us that do not use the emulator) so I have put together an rdate implementation.

Note: This is likely to only be of use to a very select few... If you have a working setup that you are happy with, then there is little need to read any further...

This program supports a “set time” option as well as being friendly to DOS CR's that are sometimes found within peoples /etc/postcodezones file :) It will use the TZ/TZDIR environment variables (if defined) rather than performing database lookups.

There are many ways of executing it. By adding an ‘–s’ it will set both the hardware (CMOS) and the software (O/S) time on the TiVo. If the '-s' option is not used, then it will output the time in a format that is suitable for use by settime (to remain compatable with rtimetz).

Example 1
The following will lookup the postalcode in the database and then lookup your timezone in the /etc/postcodezones file and using that information attempt to find the timezone information by looking in /var/hack/zoneinfo.



# rdate –v 129.6.15.28 132.163.4.101 128.138.140.44
# rdate –vs 129.6.15.28 132.163.4.101 128.138.140.44


Example 2
The following does not require the /etc/postcodezones file as we have specified which timezone to use, it will look in TZDIR for the information files (TZDIR defaults to /var/hack/zoneinfo).



# TZ=Pacific/Auckland rdate –v 129.6.15.28 132.163.4.101
# TZ=Pacific/Auckland rdate –vs 129.6.15.28 132.163.4.101


Example 3
The following tells the application the exact location of the zoneinfo file (take note of the the colon ':'), thus allowing you to place the zoneinfo file where-ever you wish.



# TZ=:/var/hack/zoneinfo/Pacific/Auckland rdate –v 129.6.15.28
# TZ=:/var/hack/zoneinfo/Pacific/Auckland rdate –vs 129.6.15.28



QUICK INSTALLATION FOR NEW ZEALAND USERS



1. Make the rdate program executable

# chmod 755 rdate

2. Move it into the /var/hack/bin directory

# mv rdate /var/hack/bin

3. Create a directory to hold the "Auckland" zoneinfo file

# mkdir -p /var/hack/zoneinfo/Pacific

4. Move the provided "Auckland" zoneinfo file into this directory

# mv Auckland /var/hack/zoneinfo/Pacific

5. Run the command and check that things look okay

# TZ=Pacific/Auckland rdate –v 129.6.15.28

6. Run the command with the "set" (-s) option to change the date/time

# TZ=Pacific/Auckland rdate –vs 129.6.15.28

thomson
25-09-2006, 07:58 AM
It's that time of year again. Daylight Savings starts this weekend so your TiVo may be running out of sync until your next daily call occurs on Sunday. If you notice that the time is incorrect on Sunday then you might like to force a daily call (this can be done via the "phone" module in the web interface).

I script I have used for the last few years to perform the adjustment via cron can be found here (http://www.forums.oztivo.net/showthread.php?p=2184#post2184).