Note: This section was copied over from the P3Upgrade section:
--
Main.SirhanChaudhry - 01 Mar 2008
P3
Robot Upgrade to Debian GNU/LINUX
Reason for upgrade:
After a quick review of the current
state of the bot it was found that the software was very old – this
includes both the kernel (2.2.xx) and for example the gcc compiler
and its associated libraries. There was also an issue in getting the
firewire board to work properly.
As a solution it seemed reasonable to
upgrade the software on the P3 – one immediate benefit would be a
newer kernel which would provide more robust support for hardware
including the firewire board and associated firewire devices. Another
benefit would be an all around upgrade of the software (both OS as
well as software from mobile robots) on the controller, a better
configured disk setup, a fix on the now non-function power management
(the robot was not shutting down cleanly on low battery power), and
best of all the ability to compile apps on a similar install
elsewhere and port them to the robot later.
Backup:
Seeing as we had no previous
documentation on anyone else doing this we decided to play it safe.
So step one was to preserve the current install. To be on the safe
side we used 'dd' to make a bit copy of the robot disk and place it
on the workstation as follows:
- Open the robot and connect a USB IDE adapter to the robot disk
- Connected the USB adapter to the lab workstation and mounted the disk as '/dev/sdb*'
- Using 'dd' the drive was backed up; 'dd if=/dev/sdb of=/home/robot conv=sync,noerror'
- Using default block size which is '512'
In retrospect, we could have run
'zerofree' to mark non-used blocks on the disk and then done some
nifty compression of the image.
Restore:
This was actually done after we had
finished installing the new OS but its here to keep a link between
the backup. To test if our image was successfully copied we used a
blank disk and copied the 'dd' file back as follows:
- Connect blank disk to USB IDE adapter
- Using 'sdd' the image was copied back: 'dd if=/home/robot of=/dev/sda -noerror -pg'
- We introduced 'sdd' which behaves exactly like 'dd' but has the option '-pg' which provides an output on the screen to let you know that process is running. Useful, since this is a bit of time consuming operation
- The blank disk was connected to the robot and the robot was then booted up. This operation was successful and various function on the robot were tested like network connectivity, wheel motion, etc.
So
now we had a good backup we were ready to proceed
File Backup:
In
addition to the 'dd' backup, we needed a way to get information from
configuration files while installing the new OS. Since space was not
an issue on the workstation a folder was created under '/home/Robot'
and following partitions were mounted and copied:
- Partitions mounted:
- /dev/sdb3 on /media/-home type ext3 (rw,noexec,nosuid,nodev,sync,data=ordered)
- /dev/sdb2 on /media/-usr type ext3 (rw,noexec,nosuid,nodev,sync,data=ordered)
- /dev/sdb5 on /media/disk type ext3 (rw,noexec,nosuid,nodev,sync,data=ordered)
- /dev/sdb7 on /media/-tmp type ext3 (rw,noexec,nosuid,nodev,sync,data=ordered)
- /dev/sdb6 on /media/-var type ext3 (rw,noexec,nosuid,nodev,sync,data=ordered)
- /dev/sdb1 on /media/-boot type ext2 (rw,noexec,nosuid,nodev,sync)
- Backup:
- cp -rp /media/-home/* /home/Robot/home/
- cp -rp /media/-usr/* /home/Robot/usr/
- cp -rp /media/disk/* /home/Robot/disk/
- cp -rp /media/-tmp/* /home/Robot/tmp/
- cp -rp /media/-var/* /home/Robot/var/
- cp -rp /media/-boot/* /home/Robot/boot/
Install:
- The following software packages are needed by the robot, the newest versions were downloaded and saved under /home/Robot/SW:
- arcos – ver 2.2
- aria – ver 2.5-1 – note dependency files in Aria download folder (python and java)
- arnl - libarnl_1.5.1_i386.deb
- sonarnl - libsonarnl_1.5.1_i386.deb
- biclops
- mobile sim - mobilesim_0.4.0_i386.deb
- mobile eyes - mobileeyes_1.4.14-2_i386.deb
- mapper 3 - mapper3_1.3.10-2_i386.deb
- mapper 3 basic – mapper3-basic_1.3.10-2_i386.deb
- Using debian net install disk – version 4.0 (debian etch)
- A CD-ROM drive was connected to the IDE 2 controller. This motherboard does not support cable select so all drives need to be clearly set as master or slave. In this case there were only two drives, one on each controller, so they were both master.
- The drive setting in basic CMOS settings: IDE 2 to CD (IDE 0 remains the harddisk, 1 and 3 are empty)
- The vesalogic board only uses “El torrito” boot and so cannot boot from CD without some emulation. So software downloaded from vesalogic and was put under “/home/Robot/SW/Motherboard” and a boot disk was setup:
- dd if=sbm.bin of=/dev/fd0 bs=1440k
- A floppy disk was connected to the motherboard
- Changed Boot order in basic CMOS settings (1 floppy, 2 CDROM, 3 Drive C)
- Cisco Aironet 350
- The installer automatically picked up the PCMCIA board and the PCMCIA Cisco AeroNet? wireless card. The card was configured to connect to the lab wireless
- Network configurations:
- hostname = “rambot2”
- domain = “cis.fordham.edu”
-
- Network nics discovered:
- eth0 – firewire
- eth1 eepro 100
- eth2 wifi
- wifi0 – proabably wifi – hal aliases this to eth2
- eth0 configuration:
- Static
- IP 150.108.68.201
- Netmask 255.255.255.0
- Route 150.108.68.1
- DNS 150.108.2.11 150.108.4.11
- eth1 – wireless configuration:
- essid: “visionrobot”
- dhcp
- no encryption
- Disk partitions on 40GB disk:
PART SIZE (GB) Loc P/S / 4 /dev/hda1 P /usr 6 /dev/hda2 P /var 4 /dev/hda3 P /home 24 /dev/hda4 P
- Swapfiles:
- 4 x 1024 swapfiles named swap0 – 4 located under /home/swaps/swap0 – 4
- apt sources were updated to 'testing' and 'non-free' and 'contrib' were added. A system update was performed
- powergend
- Pending – this was not working on the old install – so it can be fixed a little slower
Wireless Issue:
After the debian
install, the wireless card and the PCMCIA bus did not load, meaning
that not all the drivers necessary were being loaded. The following
modules in bold are needed but are not being loaded so those needed
to be added:
~$: lsmod
airo_cs 1
airo airo_cs
e100
mii
nls_iso8859_1
eth1394
pcmcia
firmware_class
i82365
rsrc_nonstatic i82365
*pcmcia_core airo_cs,
pcmcia, i82365,rsrc_nonstatic*
isofs
sbp2
ieee1394 eth1394,ohci1394,sbp2
usbcore
Swaps:
Including a swap
file (instead of a swap partition):
Determine the size of the new swap
file and multiple by 1024 to determine the block size. For example,
the block size of a 256 MB swap file is 262144.
At a shell prompt as root, type the following command with
count
being equal to the desired block size:
=dd if=/dev/zero of=/home/swap0 bs=1024 count=262144=
Setup the swap file with the command:
=mkswap /swap0=
To enable the swap file immediately but not automatically at boot
time:
=swapon /swapfile=
To enable it at boot time, edit
/etc/fstab to include:
=/swapfile swap swap defaults 0 0=
Software:
Package
Installations (src downloaded to /home/Robot/SW/:
- Aria
- libaria_2.5.1_i386.deb – no problems
- libaria-python_2.5.1_i386.deb
- Biclops (libBiclops downloaded from svn @ https://www.traclabs.com/svn/Biclops/)
- requires make, g++,
- requires libs
- Not needed because they are for laser mapping systems and we do not have one
- libarnl_1.5.1_i386.deb
- mapper3_1.3.10-2_i386.deb
- libsonarnl_1.5.1_i386.deb
- mapper3-basic_1.3.10-2_i386.deb
- Mobileeyes
- mobileeyes depends on libfontconfig1 (>= 2.2.1)
- mobileeyes depends on libfreetype6 (>= 2.1.5-1)
- mobileeyes depends on libice6 | xlibs (>> 4.1.0)
- mobileeyes depends on libsm6 | xlibs (>> 4.1.0)
- mobileeyes depends on libstdc++5 (>= 1:3.3.4-1)
- mobileeyes depends on libx11-6 | xlibs (>> 4.1.0)
- mobileeyes depends on libxcursor1 (>> 1.1.2)
- mobileeyes depends on libxext6 | xlibs (>> 4.1.0)
- mobileeyes depends on libxft2 (>> 2.1.1)
- mobileeyes depends on libxrandr2 | xlibs (>> 4.3.0)
- mobileeyes depends on libxrender1
- Mobilesim
- mobilesim depends on libatk1.0-0 (>= 1.7.2)
- mobilesim depends on libglib2.0-0 (>= 2.4.7)
- mobilesim depends on libgtk2.0-0 (>= 2.4.4)
- mobilesim depends on libpango1.0-0 (>= 1.6.0)
Biclops stuff:
BiclopsBareBones?.mak
Biclops.cpp libBiclops.dsp libBiclops.mak Makefile
make libUtils
with no problems libUtils/src
make libPMD
with no problems libPMD/src
make -
/home/bot/Desktop/libBiclops/src/
make
BiclopsBareBones? - /home/bot/Desktop/libBiclops/src/
sudo cp
libBiclops.so /usr/lib
sudo cp
lib/libPMD.so /usr/lib
sudo cp
libUtils.so /usr/lib
then run program
and it works
todo:
- find script to signal complete start-up and halt with beeps
- aria java
- power management – powergend
--
AlexDorey - 17 Mar 2008