CAN Driver Installation Procedure + Current allocation
by
Martin Mohan
—
last modified
2010-06-09 11:44
This procedure describes the step-by-step installation of the CAN driver on a Linux box.
Existing drivers levels and machine allocations
Currently the machine driver level and application allocation is as follow:olserver33: Driver level ethercan-3.1.5 (latest ones): IMMS
olserver34: Driver level ethercan-3.0.7 (old ones): CoilRelaySever
Precondition
- virgoApp is mounted
- use CanAPI v3r6p4.
Installation Procedure
- Compile the driver
# cd /virgo/ext/ethercan/ethercan-3.0.7/<OS_NAME>
# installEthercanLibs (run ./cantest to check they are installed).
# cd psys_linux
# uname -r (check kernel)
# make -f Makefile.k24 - Makefile for PSYS-driver for kernel 2.4.x
# make -f Makefile.k26 - Makefile for PSYS-driver for kernel 2.6.x
- Create the device node
# cd /etc/udev/devices
# mknod --mode=a+rw psys c 61 0
- Test the module by loading it
# cd /virgo/ext/ethercan/ethercan-3.0.7/<OS_NAME>/psys_linux/src/
# /sbin/insmod ./psysdrv.ko
# dmesg | grep psysdrv
The last line of the kernel messages shold be:
esd PSYS driver: version 0.4.6 16:52:06 Feb 5 2009
- Install the driver
# cd ..
# make install
- Clean-up by issuing:
# /sbin/rmmod psysdrv
Automatic Startup at Boot Time
- Update module dependencies
# /sbin/depmod -A
- Add the module at modprobe.conf
# vim /etc/modprobe.confAdd the following line at the end:
alias psys psysdrv
- Modify rc.sysinit:
# vim /etc/rc.sysinit
Add the following lines at the end:
# psysdrv module loading
modprobe psysdrv > /dev/null 2>&1
- Reboot the WS and check if the driver module has been loaded via:
# /sbin/lsmod | grep psys
# /lib/modules/2.6.9-55.ELxenU/kernel/drivers/char/psysdrv.ko
- You can check your applcation is using the correct libraries. e.g.
# ldd ../v2r1p1/Linux-i686-SL4/IMMSApp.exe | grep libntcan.so
# libntcan.so.3 => ../ethercan-3.0.7/../libntcan.so.3
# ldd ../v2r2/Linux-i686-SL4/IMMSApp.exe | grep libntcan.so
# libntcan.so.3 => ../ethercan-3.1.5/../libntcan.so.3
CAN Network Configuration
In order to define the involved CAN networks a configuration file (/etc/esd-plugin) should be set accordingly.IMMS CAN Network (see /etc/esd-plugin in olserver33)
##Central building
PeerName[0]= "192.168.101.17"
Net[0]= 0
KeepAliveTime[0]= 25000 # increase keep-alive timeout
ConnTimeout[0]= 8000 # increase connection timeout
CmdTimeout[0]= 5000 # increase command timeout
##Technical building
PeerName[1]= "192.168.101.10"
Net[1]= 1
KeepAliveTime[1]= 25000 # increase keep-alive timeout
ConnTimeout[1]= 8000 # increase connection timeout
CmdTimeout[1]= 5000 # increase command timeout
##North End building
PeerName[2]= "192.168.101.14"
Net[2]= 2
KeepAliveTime[2]= 25000 # increase keep-alive timeout
ConnTimeout[2]= 8000 # increase connection timeout
CmdTimeout[2]= 5000 # increase command timeout
##West End building
PeerName[3]= "192.168.101.15"
Net[3]= 3
KeepAliveTime[3]= 25000 # increase keep-alive timeout
ConnTimeout[3]= 8000 # increase connection timeout
CmdTimeout[3]= 5000 # increase command timeout
##Intermediate West End building
PeerName[4]= "192.168.101.16"
Net[4]= 4