Documentation

This is a draft page currently used to make notes to myself

Hardware

Software

TODO Notes on

  • /dev/rtc (acess rights)
  • /dev/pcan* (create)
  • /dev/mxser (create) Moxa
  • /dev/ttyM* (create) Moxa
  • /dev/atifts (create, build module)
  • /dev/genrci (create, build module)

Kernel 2.4.x configuration

Arcnet

The SH-ARC SoHard ARCnet card shows up as:

Bridge: PLX Technology, Inc. PCI <-> IOBus Bridge (rev 02)

Support is included in the linux kernel source. The modules arcnet, arcnet_raw and com20020 need to be activated in the kernel configuration:

CONFIG_ARCNET=m
CONFIG_ARCNET_RAW=m
CONFIG_ARCNET_COM20020=m
CONFIG_ARCNET_COM20020_PCI=m

The file /etc/modules.conf contains:

# by Torsten Scherer
probeall arc0 com20020-pci arc-rawmode
options com20020-pci backplane=1 clockm=1

On Debian with a kernel 2.4 the options can be put into a seperate file like /etc/modutils/robot. The script update-modules merges all configurations into /etc/modules.conf.
The file /etc/modules contains:

# arcnet
arcnet
com20020
com20020-pci
arc-rawmode

After booting the machine, the kernel or dmesg should report something like:

arcnet: v3.93 BETA 2000/04/29 - by Avery Pennarun et al.
arcnet: COM20020 chipset support (by David Woodhouse et al.)
arcnet: COM20020 PCI support
PCI: Found IRQ 3 for device 02:0e.0
  arc0: SOHARD
  arc0: PLX Technology, Inc. PCI <-> IOBus Bridge: station FFh found at AC00h, IRQ 3.
  arc0: Using backplane mode.
  arc0: Using CKP 64 - data rate 5 Mb/s.
arcnet: raw mode (`r') encapsulation support loaded.

Afterwards the Arcnet device can be brought up as root:

marvin:~# ifconfig arc0 up

or by a startup script.

TODO: /etc/modules
TODO: /etc/init.d/arcnet

Ethernet

The onboard Intel ethernet adapter:

Ethernet controller: Intel Corporation 82801BA/BAM/CA/CAM Ethernet Controller (rev 03)

is well supported by linux system kernels. The following options are enabled in the kernel configuration:

CONFIG_NET_ETHERNET=y
CONFIG_NET_PCI=y
CONFIG_E100=m

To bring up the network device automatically on boot time the file /etc/network/interfaces contains:

# The primary network interface
auto eth0
iface eth0 inet dhcp

The file /etc/modules contains:

# ethernet
e100

Wireless LAN

The robot’s D-Link DWL G650 network adapter has the firmware version B2 and therefore an Atheros 5212 chipset. It is identified as:

Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)

Linux support for the Atheros chipset is contained in the madwifi package http://www.madwifi.org/.

The network adapter is inserted into a CardBus adapter with the Ricoh RL5c475 chipset:

CardBus bridge: Ricoh Co Ltd RL5c475 (rev 80)

which is supported by the Linux-kernels yenta driver.

Kernel CardBus support

The kernel was compiled with the following PCMCIA/CardBus options:

CONFIG_PCMCIA=m
CONFIG_CARDBUS=y
# CONFIG_TCIC is not set
# CONFIG_I82092 is not set
# CONFIG_I82365 is not set

Additionaly the pcmcia-cs package needs to be installed, which is available for most linux distributions or athttp://pcmcia-cs.sourceforge.net/.

Installation of the madwifi driver

There are two madwifi driver trunks available: madwifi-old and madwifi-ng. Seehttp://www.madwifi.org/wiki/UserDocs/GettingMadwifi for details. Both were tested and seemed to work with the network adapter, however a WPA encrypted connection utilising the wpa_supplicant driver to the Linksys WRT54G access point could only be established using the old trunk. According to http://hostap.epitest.fi/cgi-bin/viewcvs.cgi/*checkout*/hostap/wpa_supplicant/ChangeLog?rev=HEAD&content-type=text/plain wpa_supplicant will support the madwifi-ng driver with version 0.4.7.

The driver was downloaded into the modules source directory, built and installed:

cd /usr/src/modules
svn checkout http://svn.madwifi.org/trunk madwifi-old
cd /usr/src/modules/madwifi-old
export KERNELRELEASE=2.4.37.1-custom
make
make install

After the installation of the madwifi driver it seemed that there was still a memory allocation error:

ath_pci: cannot reserve PCI memory region

According to http://www.linuxquestions.org/questions/archive/41/2004/08/4/189870 I modified the file /usr/src/linux/drivers/pcmcia/yenta.c in function yenta_allocate_res from:

mask = ~0xfff;

to:

mask = ~0xffff;

to increase the granularity of the memory allocation. Afterwards the ath0 device came up properly:

ath_hal: 0.9.14.9 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413)
wlan: 0.8.6.0 (EXPERIMENTAL)
ath_rate_onoe: 1.0
ath_pci: 0.9.6.0 (EXPERIMENTAL)
ath0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
ath0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
ath0: turboG rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
ath0: H/W encryption support: WEP AES AES_CCM TKIP
ath0: mac 7.9 phy 4.5 radio 5.6
ath0: Use hw queue 1 for WME_AC_BE traffic
ath0: Use hw queue 0 for WME_AC_BK traffic
ath0: Use hw queue 2 for WME_AC_VI traffic
ath0: Use hw queue 3 for WME_AC_VO traffic
ath0: Use hw queue 8 for CAB traffic
ath0: Use hw queue 9 for beacons
Debugging version (ATH)
ath0: Atheros 5212: mem=0x10400000, irq=5

iwconfig showed:

ath0      IEEE 802.11  ESSID:""
          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:00:00:00:00:00
          Bit Rate:0 kb/s   Tx-Power:20 dBm   Sensitivity=0/3
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=0/94  Signal level=-95 dBm  Noise level=-95 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

To let hotplug bring up/down the Atheros ath0 device properly everytime the network adapter is inserted into the CardBus slot or taken out of it, the following lines are necessary in the /etc/network/interfaces file on a Debian system:

# The wireless network device
# The following line should be used instead of the other 3 lines if hotplug
# is 20050329-25 or newer
# allow-hotplug ath0
mapping hotplug
        script grep
        map ath0

Installation of the wpa_supplicant driver

The wpa_supplicant driver was installed as it comes with Debian. The version, the debian package relies on is 0.4.4. DHCP didn’t work, so the IP was set up statically in /etc/network/interfaces:

iface ath0 inet static
        address 192.168.1.110
        essid "Robot Project"
        up /usr/sbin/wpa_supplicant -B -w -i ath0 -D madwifi -c /etc/wpa_supplicant.conf

The file /etc/default/wpasupplicant.conf needs to contain:

ENABLED=1

The file /etc/wpa_supplicant.conf file contains:

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0

eapol_version=1
ap_scan=0       # This is important! It didn't work with ap_scan=1
fast_reauth=1

network={
        scan_ssid=0
        proto=WPA
        key_mgmt=WPA-PSK
        pairwise=CCMP TKIP
        group=CCMP TKIP WEP104 WEP40
        ssid="Robot Project"
        #psk="<key>"
        psk=<key>
}

The interface is started with WPA encryption by executing:

/usr/sbin/wpa_supplicant -B -d -w -i ath0 -D madwifi -c /etc/wpa_supplicant.conf
iwconfig ath0 essid "Robot Project"
ifconfig ath0 192.168.1.110

TODO upload

* /etc/defaults/wpasupplicant
* /etc/wpa_supplicant
* /etc/init.d/ath0

References

Graphics Adapter

The onboard graphics adapter is identiefied as:

VGA compatible controller: Silicon Integrated Systems [SiS] 315PRO PCI/AGP VGA Display Adapter

Support is included in the linux kernel source. The following modules have been activated:

# Direct Rendering Manager (XFree86 DRI support)
CONFIG_DRM=y

# DRM 4.1 drivers
CONFIG_DRM_NEW=y
CONFIG_DRM_SIS=m

# Frame-buffer support
CONFIG_FB=y
CONFIG_DUMMY_CONSOLE=y
CONFIG_VIDEO_SELECT=y
CONFIG_FB_SIS=m
CONFIG_FB_SIS_315=y
CONFIG_FBCON_CFB8=m
CONFIG_FBCON_CFB16=m
CONFIG_FBCON_CFB32=m
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y

# AGP
CONFIG_AGP=m
CONFIG_AGP_INTEL=y
CONFIG_AGP_SIS=y

Although there is no support for hardware 3D acceleration for the SiS 315Pro, DRM and Framebuffer support were activated to be able to load the X-server’s dri and glx modules to support mesa software rendering. Framebuffer support is necessary because of some memory management functions in the kernel’s sisfb module.

References

Sound Card

Support for the integrated sound card:

Multimedia audio controller: Intel Corporation 82801BA/BAM AC'97 Audio (rev 05)

is included in the linux kernel source. It is enabled by providing the following kernel configuration lines:

CONFIG_SOUND=m
CONFIG_SOUND_ICH=m

Framegrabber

The analog camera is connected to a Matrox Meteor 1 Framegrabber. The drivers were placed in the modules source directory /usr/src/modules/meteor-2.2.x. They were built and installed by executing:

cd /usr/src/modules/meteor-2.2.x
make
make install
./MAKEDEV

The following lines were added to the file /etc/modutils/robot:

#
# matrix meteor framegrabber
#
alias char-major-122 himemfb
alias char-major-40 meteor

Furthermore the linux kernel needs to be booted with the option mem=252m. Otherwise you might see the error message:

ioctl(METEORSETGEO): Cannot allocate memory

The whole line in the /boot/grub/menu.lst file is as follows:

kernel          /vmlinuz-2.4.31-custom root=/dev/hda7 ro mem=252m

[Update]
The Matrox meteor + lipstick camera have been replaced by an IEEE1394 Firewire camera: AVT Marlin.

Serial Card

Both SICK laserscanners are connected to a Moxa serial board with a modified quartz. The board shows up as:

Serial controller: Moxa Technologies Co Ltd: Unknown device 1320 (rev 02)

The driver is placed in the modules source directory /usr/src/modules/mxser-1.3. It was built and installed by executing:

cd /usr/src/modules/mxser-1.3
make
make install
cd driver
./msmknod

msmknod creates the neccessary device files /dev/ttyM0 – /dev/ttyM7.

/etc/modutils/robot was extended by:

#
# ++itschere20030820: moxa serial card
#
# alias char-major-172 rt_com_moxa
alias char-major-30 mxser
options mxser verbose=1

CAN Bus

The CAN Bus is supported by the PEAK Linux driver http://www.peak-system.com/linux/.

It is placed in /usr/src/modules/peak-linux-driver-1.40 and was installed by executing:

cd /usr/src/modules/peak-linux-driver-1.40
make
make install

The following lines were added to the /etc/modutils/robot file:

#
# "pcan" parallel port can bus dongle
#
alias char-major-253 pcan
options parport_pc io=0x378 irq=7
options pcan type=epp

# Martin Wojtczyk: The following 4 lines were added by the
# peak-linux-driver-1.40 installation routine
# pcan - automatic made entry, begin --------
# options pcan type=isa,epp           # see documentation
post-install pcan /usr/local/bin/pcan_make_devices 2
# pcan - automatic made entry, end ----------

[Update]
I did not get the 1.4 pcan drivers to work anymore – even with the old debian 3.1 distribution. However the peak-linux-driver.6.7.tar.gz worked fine. Instructions are the same.

ATI force-/torque sensor

The driver for the ATI force-/torque-sensor is located in /usr/src/modules/fts-3.1.

It was built and installed by executing:

cd /usr/src/modules/fts-3.1
make
make install

# make sure the kernel module is built
cd /usr/src/modules/fts-3.1/arc/ati
make all
make install

The following lines were added to the /etc/modutils/robot file:

#
# ati force/torque sensor
#
alias char-major-42 atifts

TODO modifications for compile

GENRCI

GENRCI is an additional kernel module which is necessary for rccl. The source can be found in a subdirectory of rccl: rccl.5.1.4/sys/Linux/rciext. It is installed by executing:

cd rccl.5.1.4/sys/Linux/rciext
make
make install

and by adding the following lines to /etc/modutils/robot:

#
# generic rccl and pa10 driver
#
alias char-major-60 genrci
alias char-major-61 genrci

TODO modifications for compile

RCCL

To install Torsten Scherer’s RCCL library:
Set the environment variables appropriately: see .bashrc
Install X11 dev/header files (debian 3.1: libx11-dev)

svn co https://.../rccl.5.1.4/trunk rccl.5.1.4
cd rccl.5.1.4
make
su
make install

Kernel 2.6.x configuration

Arcnet

Make sure the the kernel supports arcnet, arcnet_raw and the com20020 chipset:

CONFIG_ARCNET=m
CONFIG_ARCNET_RAW=m
CONFIG_ARCNET_COM20020=m
CONFIG_ARCNET_COM20020_PCI=m

Load the com20020-pci with the appropriate options by creating a file like /etc/modprobe.d/robot:

options com20020-pci backplane=1 clockm=1

The file /etc/modules should contain the following lines:

 # arcnet: load arcnet related modules for pa10
arcnet
com20020
com20020-pci
arc-rawmode

After booting the machine, the kernel or dmesg should report something like:

arcnet: v3.93 BETA 2000/04/29 - by Avery Pennarun et al.
arcnet: COM20020 chipset support (by David Woodhouse et al.)
arcnet: COM20020 PCI support
PCI: Found IRQ 3 for device 0000:02:0e.0
 arc%d: SOHARD
 arc%d: PCI COM20020: station FFh found at AC00h, IRQ 3.
 arc%d: Using backplane mode.
 arc%d: Using CKP 64 - data rate 5 Mb/s.
arcnet: raw mode (`r') encapsulation support loaded.

Afterwards you can bring up the Arcnet device as root:

marvin:~# ifconfig arc0 up

or let it be done by a startup script.

Important configuration files

kernel 2.4 and 2.6 TODO: upload the following files

  • /etc/modutils/robot
  • /etc/init.d/arcnet
  • /usr/src/linux/drivers/pcmcia/yenta.c (optional or patch)
  • /etc/network/interfaces
  • /etc/defaults/wpasupplicant
  • /etc/wpa_supplicant
  • /etc/modules
  • /etc/X11/xorg.conf

kernel 2.4 specific

kernel 2.6 specific