Getting TiVo to use a serial line for program lineup downloads

Quick reset

If the power to the box dies, you need to reboot, login and start up the firewall script and the tivo PPP script:

sh tivo_firewall.sh 
sh ppp_tivo.sh

History and Installation Instructions

on 28th april 2007, the external HD for my slug died and furthermore I killed the system by using ipkg upgrade WITHOUT the external HD plugged in. Bye bye System.

ACTUALLY Debian/NSLU2 and OpenOS/NSLU2 are two different beasts. I'm trying the Debian/NSLU2.

http://www.nslu2-linux.org/wiki/SlugOS/UsingTheBinary

I need upslug2 running on a Linux laptop to do thre reflash.

Booting up laptop with ubuntu on it...

Ubuntu (Edgy): sudo aptitude install upslug2

hey, it worked!

Put the NSLU2 into Upgrade Mode

  1. Disconnect any disks and/or devices from the USB ports.
  2. Power off the NSLU2
  3. Press and hold the reset button (accessible through the small hole on the back just above the power input).
  4. Press and release the power button to power on the NSLU2.
  5. Wait for 10 seconds watching the ready/status LED. After 10 seconds it will change from amber to red. Immediately release the reset button.
  6. The NSLU2 ready/status LED will flash alternately red/green (there is a 1 second delay before the first green).

Flash the NSLU2 by using UpSlug or the Win32 Sercomm Utility

Check that we can see the slug in upgrade mode:

upslug2

Nothing is seen! Remember that ubuntu has wireless card on eth2, so...

# upslug2 --device eth2
NSLU2   00:04:5a:0f:e0:b2 product ID: 1 Protocol ID: 0 Firmware
Version: R23V63 [0x2363]

http://www.cyrius.com/debian/nslu2/install.html

Following this, I can see that this is a potentially dangerous job sigh Well, it'll be a learning experience. Now I need an external USB drive to carry on this install, so it's off to Best Buy for a 6Gb drive I go.... or maybe I can use the 4Gb drive I have? Muhahahah!

upslug2 --device eth2 -i di-nslu2.bin

I am using debian-4.0r0.zip from the http://www.slug-firmware.net site.

When it finished, it rebooted, and I plugged in a 4Gb memory stick. It beeped with a low beep three times, indicating that the sshd is up and running.

ssh installer@192.168.1.77 password: install

following the menu that popped up do not resize the window!

Select install image components...

then selected Guided Partitioning:

SCSI1 (sda) 4Gb disk all in one partition it selected 90.4Mb as swap...

so manually partitioning disk.

3.75Gb as / ext3 system second remaining partition as swap

In order for the installation to succeed, you need to select the following modules:

If you have a USB stick with only 1 GB the current version of the installer will by default create a swap partition that is too small and your system will run out of memory during the installation and fail (the symptom of this is that your SSH connection will be closed). On such systems, you therefore have to manually partition your hard drive instead of using the guided partition option. Make sure that you have at least a swap partition with at least 128 MB.

I added a web server to the default of base software, then went to lunch. After getting back, it prompted that the installation is finished. Rebooting takes a while, but I'm back online with a full Debian system, FWIW.

Rebooting the computer takes a loooong time

Hint are given on this page, including a list of what the LEDs indicate:

http://svn.debian.org/wsvn/pkg-nslu2-utils/trunk/debian/README.Debian?op=file

A few hints for futher configuration of Debian on your slug

DONE

It's a good idea to enable bootlogd, by editing /etc/default/bootlogd. Then you can see boot logs in /var/log/boot.

DONE

You might want to move the ssh server startup closer to the beginning of the init sequence so that you can ssh in earlier. You can do that by moving /etc/rc2.d/S20ssh to /etc/rcS.d/S41ssh. (Anything after networking is brought up will do.) You can also move /etc/rcS.d/S40networking to S21networking to make the network come up a lot earlier, and run ssh in /etc/rcS.d/S21ssh; this will let root log in while the system is still booting, which can be useful if something goes wrong.

DONE and DONE

If you want the power button to turn the system off, instead of rebooting it like it does by default, edit /etc/inittab and change the shutdown command to run shutdown -h now

If you want openslug's behavior of coming up on address 192.168.1.77 if there is no dhcp server, edit /etc/dhclient.conf and add a default lease, such as this:

Prdefined default lease for networks w/o dhcp.

lease { interface "eth0"; fixed-address 192.168.1.77; option broadcast-address 192.168.1.255; option routers 192.168.1.1; }

Bloody hell! It takes 50 minutes to boot up... it turns out that it is the hardware clock script dying and hanging for this length of time.

Here is the symptom:

fishpool:~# more /var/log/boot
Sat Sep 30 06:02:38 2006: .
Sat Sep 30 06:02:38 2006: Activating swap...done.
Sat Sep 30 06:02:38 2006: Checking root file system...fsck 1.40-WIP (14-Nov-2006)
Sat Sep 30 06:02:38 2006: e2fsck 1.40-WIP (14-Nov-2006)
Sat Sep 30 06:02:38 2006: /dev/sda1: clean, 22671/457856 files, 140112/915697 blocks
Sat Sep 30 06:02:38 2006: done.
Sat Sep 30 06:02:38 2006: Setting the system clock..
Sat Sep 30 06:56:52 2006: Timed out waiting for time change.
Sat Sep 30 06:56:53 2006: Cleaning up ifupdown....
Sat Sep 30 06:56:53 2006: Loading kernel modules...done.
Sat Sep 30 06:56:54 2006: Configuring network interfaces...done.
Sat Sep 30 06:56:54 2006: Starting OpenBSD Secure Shell server: sshd.
Sat Sep 30 06:56:56 2006: Loading device-mapper support.
Sat Sep 30 06:56:57 2006: Checking file systems...fsck 1.40-WIP (14-Nov-2006)
Sat Sep 30 06:56:57 2006: done.
Sat Sep 30 06:56:57 2006: Setting kernel variables...done.

http://www.nslu2-linux.org/wiki/Debian/FAQ details the suggestion of removing the script that starts it up...

The slug hangs during reboot (status and ethernet LED green)

If the activity light on the USB hard disk is flashing every few seconds, and the network is not yet up, this could be due to hwclock hanging. Sometimes the internal RTC on the slug does not work. In this case the hwclock init script hangs trying to read the RTC. To fix, remove and replace the battery to reset the RTC. As a temporary fix, can connect the disk to another computer and delete the hwclock script link from /etc/rcS.d.

lrwxrwxrwx  1 root root   20 Sep 30 06:38 S11hwclock.sh -> ../init.d/hwclock.sh
rm S11hwclock.sh

lrwxrwxrwx  1 root root   20 Sep 30 06:38 K25hwclock.sh -> ../init.d/hwclock.sh
fishpool:/etc/rc0.d# rm K25hwclock.sh

I want to install:

ntpd
ppp
screen

So....

running 'aptitude' and then selecting ppp

Plugging in the USB dongle, I check dmesg and see:

usb 1-1: new full speed USB device using ohci_hcd and address 2
usb 1-1: configuration #1 chosen from 1 choice
usbcore: registered new driver usbserial
drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
usbcore: registered new driver usbserial_generic
drivers/usb/serial/usb-serial.c: USB Serial Driver core
drivers/usb/serial/usb-serial.c: USB Serial support registered for pl2303
pl2303 1-1:1.0: pl2303 converter detected
usb 1-1: pl2303 converter now attached to ttyUSB0
usbcore: registered new driver pl2303
drivers/usb/serial/pl2303.c: Prolific PL2303 USB to serial adaptor driver

Cool! It's found and now working.

Tivo scripts

Trying the scripts for the tivo, the ppp_tivo.sh script logs that

fishpool:~# more ppp_tivo.log 
Couldn't set tty to PPP discipline: Interrupted system call
Couldn't set tty to PPP discipline: Interrupted system call

It turns out that the ppp_tivo.sh script is trying /dev/ttyS0, which is a classic serial port address. I am using a USB to serial dongle, and this device is called /dev/ttyUSB0.

It now works.

Here is a successful connection from the tivo through the slug - tail -f /root/ppp_tivo.log says

sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xbc5a6f08> <pcomp> <accomp>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xbc5a6f08> <pcomp> <accomp>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xbc5a6f08> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xffffa841> <pcomp> <accomp>]
sent [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0xffffa841> <pcomp> <accomp>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xbc5a6f08> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0xbc5a6f08> <pcomp> <accomp>]
sent [LCP EchoReq id=0x0 magic=0xbc5a6f08]
sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>]
sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 192.168.10.1>]
rcvd [LCP EchoRep id=0x0 magic=0xffffa841]
rcvd [IPCP ConfReq id=0x1 <addr 0.0.0.0> <compress VJ 0f 01>]
sent [IPCP ConfNak id=0x1 <addr 192.168.10.2>]
rcvd [CCP ConfReq id=0x1]
sent [CCP ConfAck id=0x1]
rcvd [CCP ConfRej id=0x1 <deflate 15> <deflate(old#) 15>]
sent [CCP ConfReq id=0x2 <bsd v1 15>]
rcvd [IPCP ConfAck id=0x1 <compress VJ 0f 01> <addr 192.168.10.1>]
rcvd [IPCP ConfReq id=0x2 <addr 192.168.10.2> <compress VJ 0f 01>]
sent [IPCP ConfAck id=0x2 <addr 192.168.10.2> <compress VJ 0f 01>]
Cannot determine ethernet address for proxy ARP
local  IP address 192.168.10.1
remote IP address 192.168.10.2
Script /etc/ppp/ip-up started (pid 3056)
rcvd [CCP ConfRej id=0x2 <bsd v1 15>]
sent [CCP ConfReq id=0x3]
rcvd [CCP ConfAck id=0x3]
Script /etc/ppp/ip-up finished (pid 3056), status = 0x0

Old writeup from installing and debugging the tivo scripts

Load usb modules

Check dmesg for usb install

lsmod:

Module Size Used by afpacket 18376 0 ixp400eth 24156 0 ixp400 949188 1 ixp400_eth pl2303 15588 0 usbserial 23632 1 pl2303 ext3 109864 2 jbd 45940 1 ext3 mbcache 5540 1 ext3

load iptables through tivo_firewall.sh

lsmod:

Module                  Size  Used by
ipt_MASQUERADE          1888  1
iptable_nat             5764  1
ip_nat                 10802  2 ipt_MASQUERADE,iptable_nat
ip_conntrack           33716  3 ipt_MASQUERADE,iptable_nat,ip_nat
iptable_filter          1440  0
ip_tables              11528  2 iptable_nat,iptable_filter
x_tables                8068  3 ipt_MASQUERADE,iptable_nat,ip_tables
af_packet              18376  0
ixp400_eth             24156  0
ixp400                949188  1 ixp400_eth
pl2303                 15588  0
usbserial              23632  1 pl2303
ext3                  109864  2
jbd                    45940  1 ext3
mbcache                 5540  1 ext3

Check that iptables looks good

Load modules for ppp kernel

insmod /lib/modules/2.6.16/kernel/lib/crc-ccitt.ko

root@fishpool:~# lsmod Module Size Used by crcccitt 1024 0 pppgeneric 22516 0 slhc 4576 1 ppp_generic

and then...

insmod /lib/modules/2.6.16/kernel/drivers/net/ppp_async.ko

Module Size Used by pppasync 9088 1 crcccitt 1024 1 pppasync pppgeneric 22516 5 pppasync slhc 4576 1 pppgeneric

Check that the ppp modules are loaded correctly

usbserial.sh:

#!/bin/sh
# 
modprobe usbserial
modprobe pl2303
return 1

sh /etc/init.d/usbserial.sh

ipkg files kernel-module-ppp-async
ipkg files kernel-module-crc-ccitt

Correctly working modules modprobe pppasync modprobe ppp modprobe pppasync insmod /lib/modules/2.6.16/kernel/lib/crc-ccitt.ko insmod /lib/modules/2.6.16/kernel/drivers/net/ppp_async.ko

lsmod

Module                  Size  Used by
ppp_async               9088  0 
crc_ccitt               1024  1 ppp_async
ppp_generic            22516  1 ppp_async
slhc                    4576  1 ppp_generic
ipt_MASQUERADE          1888  1 
iptable_nat             5764  1 
ip_nat                 10802  2 ipt_MASQUERADE,iptable_nat
ip_conntrack           33716  3 ipt_MASQUERADE,iptable_nat,ip_nat
iptable_filter          1440  0 
ip_tables              11528  2 iptable_nat,iptable_filter
x_tables                8068  3 ipt_MASQUERADE,iptable_nat,ip_tables
af_packet              18376  0 
ixp400_eth             24156  0 
ixp400                949188  1 ixp400_eth
pl2303                 15588  0 
usbserial              23632  1 pl2303
ext3                  109864  2 
jbd                    45940  1 ext3
mbcache                 5540  1 ext3

Last updated: Wednesday January 02, 2008

Valid HTML