Here is a short tutorial to install linuxcnc ethercat, thank Hakan and Grotius for making my life easier :laugh:
1. Installing linuxcnc image:
Code:
Download official image: www.linuxcnc.org/iso/linuxcnc-2.8.1-pi4.zip
Flash SD card.
setting up system
2. Installing etherlab master
Code:
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install bison flex libssl-dev
sudo apt-get install linux-headers-4.19.71-rt24-v7l+
sudo wget -P /usr/include/tools/ https://raw.githubusercontent.com/raspberrypi/linux/rpi-4.19.y/tools/include/tools/be_byteshift.h
sudo wget -P /usr/include/tools/ https://raw.githubusercontent.com/raspberrypi/linux/rpi-4.19.y/tools/include/tools/le_byteshift.h
cd /usr/src/linux-headers-4.19.71-rt24-v7l+/
sudo make -i modules_prepare
sudo apt install -y build-essential libtool automake tree dkms git mercurial
cd
mkdir ethercat
cd ethercat
git clone http://github.com/icshwi/etherlabmaster
make init
echo "ENABLE_CYCLES = NO" > configure/CONFIG_OPTIONS.local
make build
make install
echo "ETHERCAT_MASTER0=eth0" > ethercatmaster.local
make dkms_add
make dkms_build
make dkms_install
make setup
# Reboot or start manually by
sudo systemctl start ethercat
# Checking ethercat
sudo systemctl status ethercat.service
3. Installing linuxcnc-ethercat
Code:
sudo apt-get install linuxcnc-uspace-dev
sudo ln -s /opt/etherlab/include/*.h /usr/include/linuxcnc/
sudo ln -s /opt/etherlab/lib/lib* /usr/lib/
git clone http://github.com/sittner/linuxcnc-ethercat.git
cd linuxcnc-ethercat
make
4. You are now can use lcec_conf and lcec.so in linuxcnc-ethercat/src folder
Code:
Copy lcec_conf to config folder
Copy lcec.so to usr/lib/linuxcnc/modules
5. If you are using linuxcnc-dev
Code:
git clone github.com/grotius-cnc/linuxcnc-ethercat
# Set your includepath in the /configure.mk file to point to halcompile
cd linxucnc-ethercat
make
make install
Reference:
forum.linuxcnc.org/10-advanced-configura...at-on-raspberry-pi-4