contents
Install
Referring to the installation guide in the Igh maunal. It's pretty simple to install the Igh EtherCAT on raspi. Below records my steps to install Igh.
1. update kernel and download kernel source
$ sudo rpi-update
$ reboot
$ git clone https://github.com/notro/rpi-source
$ python rpi-source
2. If rpi-source failed because of complier version, you need to change to the one that compile kernel. e.g.
$ sudo apt-get install -y gcc-4.8
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 20
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
3. download ethercat
$ wget https://etherlab.org/download/ethercat/ethercat-1.5.2.tar.bz2
$ tar jxf ethercat-1.5.2.tar.bz2
4. intall automake and kernel source
$ sudo apt-get install automake autoconf libtool
$ sudo apt-get install linux-source
5. start install IgH EtherCAT
$ ./bootstrap
$ ./configure
$ make all modules
$ sudo make modules_install install
$ sudo depmod
Note here: ifmake install
failed due to FPU problem (softfp ABI?), usetouch
on the failed target.
6. create soft link
$ sudo ln -s /opt/etherlab/etc/init.d/ethercat /etc/init.d/ethercat
$ sudo mkdir /etc/sysconfig
$ sudo cp /opt/etherlab/etc/sysconfig/ethercat /etc/sysconfig/ethercat
7. config ethercat, you need to fill in MASTER0_DEVICE with eth0 MAC address, and fill in DEVICE_MODULES with "generic"
$ ifconfig
$ sudo vim /etc/sysconfig/ethercat
8. finish up
$ sudo echo KERNEL==\"EtherCAT[0-9]*\", MODE=\"0664\" > /etc/udev/rules.d/99-EtherCAT.rules
$ ln -s /opt/etherlab/bin/ethercat /usr/local/bin/ethercat
Backup
After we install the Igh EtherCAT, it might be faster that we use the backup image on the new raspi machine.
Find out which devices are currently available:
$ df -h
use command dmesg
to confirm that new device you inserted is SD card.
Always make sure that if is the device to read and of is the device to write.
To backup SD card: (it might take a while)
$ sudo dd if=/dev/sdc of=/SDCardBackup.img
To restore the image:
$ sudo dd bs=4M if=/SDCardBackup.img of=/dev/sdc
Before ejecting the SD card, make sure that your Linux PC has completed writing:
$ sudo sync
Don't forget to fill in MAC address of the new machine.