- Posts: 1317
- Thank you received: 0
Notes from installation of ethercat on Raspberry Pi 4
5 years 7 months ago #203806
by Hakan
Notes from installation of ethercat on Raspberry Pi 4 was created by Hakan
I just put my notes here from the install of ethercat on the Raspberry Pi 4 B, 4 MB,
if anyone is interested to install ethercat on the Rpi4.
It starts from an empty SD card and will turn the Rpi4 into an ethercat master on eth0
and makes ethercat available in linuxcnc including a basic test.
I have tested to follow the notes a few times and it *should* work without further modifications.
There are no choices to make or questions to answer, more than the occasional "Y" for Yes, continue.
[SIZE=12pt]Prepare SD-card, here is how to do it on another linux computer with sd-card reader
Download www.linuxcnc.org/iso/linuxcnc-2.8.1-pi4.zip
Unzip to 2021-01-20-linuxcnc-pi4.img
# Write to SD-card, check at the end of ”sudo dmesg” for the name, mine was called /dev/sdj
sudo dd if=2021-01-20-linuxcnc-pi4.img of=/dev/sdj bs=1M
# Mount the sd-disk, mine was called /dev/sdj
# Add /boot/ssh and fill in /boot/wpa_supplicant.conf for wireless access
sudo bash
mount/dev/sdj1 /mnt/a; cd /mnt/a
touch ssh[/SIZE]
[SIZE=12pt]cat > wpa_supplicant.conf <<_EOF[/SIZE]
[SIZE=8pt]ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=SE
network={
ssid="WLAN"
psk="password"
}
_EOF
[/SIZE]
[SIZE=12pt]# You need to modify country, ssid and psk in the wpa_supplicant.conf for your situation.
[/SIZE][SIZE=12pt]cd; umount /mnt/a
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# Take the sd-card to the Rpi4 and boot it
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]Upgrade linux[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# Log in on the Rpi4
[/SIZE][SIZE=12pt]# Check for a SMP PREEMPT RT kernel, and upgrade to the latest of everything
[/SIZE][SIZE=12pt]uname -a
[/SIZE][SIZE=12pt]sudo apt update
[/SIZE][SIZE=12pt]sudo apt upgrade
[/SIZE][SIZE=12pt]sudo reboot
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# The system is now ready to run linuxcnc
[/SIZE][SIZE=12pt]# Or go ahead and install ethercat support.
[/SIZE][SIZE=12pt]# There are two packages needed for ethercat in linuxcnc: etherlabmaster and linuxcnc-ethercat
[/SIZE][SIZE=12pt]# Both need to be downloaded, compiled and installed
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]Prepare for ethercat build[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# Need linux kernel header files. Look for the kernel version, here it is xxx-4.19.71-xxx
[/SIZE][SIZE=12pt]uname -a
[/SIZE][SIZE=12pt]apt-cache search 4.19.71
[/SIZE][SIZE=12pt]sudo apt install linux-headers-4.19.71-rt24-v7l
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# Install development tools that are needed
[/SIZE][SIZE=12pt]sudo apt install mercurial build-essential automake tree dkms bison flex
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]Etherlabmaster[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]git clone [/SIZE] [SIZE=12pt] github.com/icshwi/etherlabmaster [/SIZE] [SIZE=12pt]
[/SIZE][SIZE=12pt]cd etherlabmaster
[/SIZE][SIZE=12pt]make init
[/SIZE][SIZE=12pt]echo "ENABLE_CYCLES = NO" > configure/CONFIG_OPTIONS.local
[/SIZE][SIZE=12pt]make build
[/SIZE][SIZE=12pt]make install
[/SIZE][SIZE=12pt]echo "ETHERCAT_MASTER0=eth0" > ethercatmaster.local
make dkms_add
make dkms_build
make dkms_install
make setup
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# It is a pain to have the include files and libraries installed in /opt/etherlab/ , make an ugly fix (until
# someone comes up with a better method)
[/SIZE][SIZE=12pt]sudo mkdir -p /usr/include/linuxcnc
[/SIZE][SIZE=12pt]sudo ln -s /opt/etherlab/include/*.h /usr/include/linuxcnc/
[/SIZE][SIZE=12pt]sudo ln -s /opt/etherlab/lib/lib* /usr/lib/
[/SIZE][SIZE=12pt]# There WILL be build errors later on if this (or something smarter) is omitted
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# Reboot
[/SIZE][SIZE=12pt]sudo reboot
[/SIZE][SIZE=12pt]
# Log in again, ethercat should now be running on eth0
[/SIZE][SIZE=10pt]pi@linuxcnc:~ $ ethercat master
[/SIZE][SIZE=10pt]Master0
[/SIZE][SIZE=10pt] Phase: Idle
[/SIZE][SIZE=10pt] Active: no
[/SIZE][SIZE=10pt] Slaves: 3
[/SIZE][SIZE=10pt] Ethernet devices:
[/SIZE][SIZE=10pt] Main: dc:a6:32:05:7e:65 (attached)
[/SIZE][SIZE=10pt] Link: UP
[/SIZE][SIZE=10pt] Tx frames: 3990
[/SIZE][SIZE=10pt] Tx bytes: 239560
[/SIZE][SIZE=10pt] Rx frames: 3989
[/SIZE][SIZE=10pt] Rx bytes: 239500
[/SIZE][SIZE=10pt] Tx errors: 0
[/SIZE][SIZE=10pt] Tx frame rate [1/s]: 48 51 41
[/SIZE][SIZE=10pt] Tx rate [KByte/s]: 2.8 3.0 2.4
[/SIZE][SIZE=10pt] Rx frame rate [1/s]: 48 51 41
[/SIZE][SIZE=10pt] Rx rate [KByte/s]: 2.8 3.0 2.4
[/SIZE][SIZE=10pt] Common:
[/SIZE][SIZE=10pt] Tx frames: 3990
[/SIZE][SIZE=10pt] Tx bytes: 239560
[/SIZE][SIZE=10pt] Rx frames: 3989
[/SIZE][SIZE=10pt] Rx bytes: 239500
[/SIZE][SIZE=10pt] Lost frames: 0
[/SIZE][SIZE=10pt] Tx frame rate [1/s]: 48 51 41
[/SIZE][SIZE=10pt] Tx rate [KByte/s]: 2.8 3.0 2.4
[/SIZE][SIZE=10pt] Rx frame rate [1/s]: 48 51 41
[/SIZE][SIZE=10pt] Rx rate [KByte/s]: 2.8 3.0 2.4
[/SIZE][SIZE=10pt] Loss rate [1/s]: 0 0 0
[/SIZE][SIZE=10pt] Frame loss [%]: 0.0 0.0 0.0
[/SIZE][SIZE=10pt] Distributed clocks:
[/SIZE][SIZE=10pt] Reference clock: Slave 0
[/SIZE][SIZE=10pt] DC reference time: 0
[/SIZE][SIZE=10pt] Application time: 0
[/SIZE][SIZE=10pt] 2000-01-01 00:00:00.000000000
[/SIZE][SIZE=10pt]pi@linuxcnc:~ $ ethercat slave
[/SIZE][SIZE=10pt]0 0:0 PREOP + EK1100 EtherCAT-Koppler (2A E-Bus)
[/SIZE][SIZE=10pt]1 0:1 PREOP + EL1008 8K. Dig. Eingang 24V, 3ms
[/SIZE][SIZE=10pt]2 0:2 PREOP + EL2008 8K. Dig. Ausgang 24V, 0.5A[/SIZE]
[SIZE=12pt]
[/SIZE][SIZE=12pt]linuxcnc-ethercat[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# Install the development version of linuxcnc
[/SIZE][SIZE=12pt]sudo apt install linuxcnc-uspace-dev
[/SIZE][SIZE=12pt]# Download, build and install linuxcnc-ethercat
[/SIZE][SIZE=12pt]git clone [/SIZE] [SIZE=12pt] github.com/sittner/linuxcnc-ethercat [/SIZE] [SIZE=12pt]
[/SIZE][SIZE=12pt]cd linuxcnc-ethercat
[/SIZE][SIZE=12pt]make configure
[/SIZE][SIZE=12pt]make
[/SIZE][SIZE=12pt]sudo make install
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]Test ethercat with linuxcnc[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# Skip the VNC steps if you are in front of the display
[/SIZE][SIZE=12pt]sudo raspi-config
[/SIZE][SIZE=12pt] 3 Interface options → Enable VNC server
[/SIZE][SIZE=12pt] Exit raspi-config
[/SIZE][SIZE=12pt]# Use VNC Control to connect to the display [/SIZE] [SIZE=8pt] www.realvnc.com/en/connect/download/viewer/windows/ [/SIZE]
[SIZE=12pt]
[/SIZE][SIZE=12pt]# Open a terminal window, start linuxcnc
[/SIZE][SIZE=12pt]linuxcnc
[/SIZE][SIZE=12pt] Select sim→axis→axis, copy the files. Axis should start. Exit axis.
[/SIZE][SIZE=12pt]cd linuxcnc/configs/sim.axis
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# Choose any of the ini files. In your ini file add in the [HAL] section[/SIZE]
[SIZE=9pt]HALFILE = ethercat.hal[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# Make an ethercat.hal file
[/SIZE][SIZE=9pt]loadusr -W lcec_conf ethercat-conf.xml
loadrt lcec
addf lcec.read-all servo-thread
addf lcec.write-all servo-thread[/SIZE]
[SIZE=12pt]
[/SIZE][SIZE=12pt]# Add a minimal ethercat-conf.xml[/SIZE]
[SIZE=9pt]<masters>
[/SIZE][SIZE=9pt] <master idx="0" appTimePeriod="1000000" refClockSyncCycles="5">
[/SIZE][SIZE=9pt] </master>
[/SIZE][SIZE=9pt]</masters>[/SIZE]
[SIZE=12pt]
[/SIZE][SIZE=12pt]# Start linuxcnc
[/SIZE][SIZE=12pt]linuxcnc inifile.ini
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# Check that you have plenty of lcec entries, check with for example (in another terminal window)
[/SIZE][SIZE=12pt]halcmd show all | grep lcec
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# A small real ethercat-conf.xml is[/SIZE]
[SIZE=9pt]<masters>
[/SIZE][SIZE=9pt] <master idx="0" appTimePeriod="1000000" refClockSyncCycles="5">
[/SIZE][SIZE=9pt] <slave idx="0" type="EK1100"/>
[/SIZE][SIZE=9pt] <slave idx="1" type="EL1008"/>
[/SIZE][SIZE=9pt] <slave idx="2" type="EL2008"/>
[/SIZE][SIZE=9pt] </master>
[/SIZE][SIZE=9pt]</masters>[/SIZE]
[SIZE=12pt]
[/SIZE][SIZE=12pt]# With linuxcnc started, a digital output on the EL2008 can be manipulated using standard
[/SIZE][SIZE=12pt]# hal syntax like
[/SIZE][SIZE=12pt]halcmd setp lcec.0.2.dout-7 1
[/SIZE][SIZE=12pt]# will switch on the output 8. The physical hardware is needed for this, of course.
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# Now ethercat works in linuxcnc. Add your own devices...[/SIZE]
Edit: This works also for building on Debian on an Intel computer - with a few modifications when building etherlabmaster. There are choices for network interface hardware and the ETHERCAT_MASTER0 needs another name. Best to check etherlabmaster/README.md for details.
if anyone is interested to install ethercat on the Rpi4.
It starts from an empty SD card and will turn the Rpi4 into an ethercat master on eth0
and makes ethercat available in linuxcnc including a basic test.
I have tested to follow the notes a few times and it *should* work without further modifications.
There are no choices to make or questions to answer, more than the occasional "Y" for Yes, continue.
[SIZE=12pt]Prepare SD-card, here is how to do it on another linux computer with sd-card reader
Download www.linuxcnc.org/iso/linuxcnc-2.8.1-pi4.zip
Unzip to 2021-01-20-linuxcnc-pi4.img
# Write to SD-card, check at the end of ”sudo dmesg” for the name, mine was called /dev/sdj
sudo dd if=2021-01-20-linuxcnc-pi4.img of=/dev/sdj bs=1M
# Mount the sd-disk, mine was called /dev/sdj
# Add /boot/ssh and fill in /boot/wpa_supplicant.conf for wireless access
sudo bash
mount/dev/sdj1 /mnt/a; cd /mnt/a
touch ssh[/SIZE]
[SIZE=12pt]cat > wpa_supplicant.conf <<_EOF[/SIZE]
[SIZE=8pt]ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=SE
network={
ssid="WLAN"
psk="password"
}
_EOF
[/SIZE]
[SIZE=12pt]# You need to modify country, ssid and psk in the wpa_supplicant.conf for your situation.
[/SIZE][SIZE=12pt]cd; umount /mnt/a
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# Take the sd-card to the Rpi4 and boot it
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]Upgrade linux[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# Log in on the Rpi4
[/SIZE][SIZE=12pt]# Check for a SMP PREEMPT RT kernel, and upgrade to the latest of everything
[/SIZE][SIZE=12pt]uname -a
[/SIZE][SIZE=12pt]sudo apt update
[/SIZE][SIZE=12pt]sudo apt upgrade
[/SIZE][SIZE=12pt]sudo reboot
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# The system is now ready to run linuxcnc
[/SIZE][SIZE=12pt]# Or go ahead and install ethercat support.
[/SIZE][SIZE=12pt]# There are two packages needed for ethercat in linuxcnc: etherlabmaster and linuxcnc-ethercat
[/SIZE][SIZE=12pt]# Both need to be downloaded, compiled and installed
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]Prepare for ethercat build[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# Need linux kernel header files. Look for the kernel version, here it is xxx-4.19.71-xxx
[/SIZE][SIZE=12pt]uname -a
[/SIZE][SIZE=12pt]apt-cache search 4.19.71
[/SIZE][SIZE=12pt]sudo apt install linux-headers-4.19.71-rt24-v7l
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# Install development tools that are needed
[/SIZE][SIZE=12pt]sudo apt install mercurial build-essential automake tree dkms bison flex
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]Etherlabmaster[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]git clone [/SIZE] [SIZE=12pt] github.com/icshwi/etherlabmaster [/SIZE] [SIZE=12pt]
[/SIZE][SIZE=12pt]cd etherlabmaster
[/SIZE][SIZE=12pt]make init
[/SIZE][SIZE=12pt]echo "ENABLE_CYCLES = NO" > configure/CONFIG_OPTIONS.local
[/SIZE][SIZE=12pt]make build
[/SIZE][SIZE=12pt]make install
[/SIZE][SIZE=12pt]echo "ETHERCAT_MASTER0=eth0" > ethercatmaster.local
make dkms_add
make dkms_build
make dkms_install
make setup
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# It is a pain to have the include files and libraries installed in /opt/etherlab/ , make an ugly fix (until
# someone comes up with a better method)
[/SIZE][SIZE=12pt]sudo mkdir -p /usr/include/linuxcnc
[/SIZE][SIZE=12pt]sudo ln -s /opt/etherlab/include/*.h /usr/include/linuxcnc/
[/SIZE][SIZE=12pt]sudo ln -s /opt/etherlab/lib/lib* /usr/lib/
[/SIZE][SIZE=12pt]# There WILL be build errors later on if this (or something smarter) is omitted
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# Reboot
[/SIZE][SIZE=12pt]sudo reboot
[/SIZE][SIZE=12pt]
# Log in again, ethercat should now be running on eth0
[/SIZE][SIZE=10pt]pi@linuxcnc:~ $ ethercat master
[/SIZE][SIZE=10pt]Master0
[/SIZE][SIZE=10pt] Phase: Idle
[/SIZE][SIZE=10pt] Active: no
[/SIZE][SIZE=10pt] Slaves: 3
[/SIZE][SIZE=10pt] Ethernet devices:
[/SIZE][SIZE=10pt] Main: dc:a6:32:05:7e:65 (attached)
[/SIZE][SIZE=10pt] Link: UP
[/SIZE][SIZE=10pt] Tx frames: 3990
[/SIZE][SIZE=10pt] Tx bytes: 239560
[/SIZE][SIZE=10pt] Rx frames: 3989
[/SIZE][SIZE=10pt] Rx bytes: 239500
[/SIZE][SIZE=10pt] Tx errors: 0
[/SIZE][SIZE=10pt] Tx frame rate [1/s]: 48 51 41
[/SIZE][SIZE=10pt] Tx rate [KByte/s]: 2.8 3.0 2.4
[/SIZE][SIZE=10pt] Rx frame rate [1/s]: 48 51 41
[/SIZE][SIZE=10pt] Rx rate [KByte/s]: 2.8 3.0 2.4
[/SIZE][SIZE=10pt] Common:
[/SIZE][SIZE=10pt] Tx frames: 3990
[/SIZE][SIZE=10pt] Tx bytes: 239560
[/SIZE][SIZE=10pt] Rx frames: 3989
[/SIZE][SIZE=10pt] Rx bytes: 239500
[/SIZE][SIZE=10pt] Lost frames: 0
[/SIZE][SIZE=10pt] Tx frame rate [1/s]: 48 51 41
[/SIZE][SIZE=10pt] Tx rate [KByte/s]: 2.8 3.0 2.4
[/SIZE][SIZE=10pt] Rx frame rate [1/s]: 48 51 41
[/SIZE][SIZE=10pt] Rx rate [KByte/s]: 2.8 3.0 2.4
[/SIZE][SIZE=10pt] Loss rate [1/s]: 0 0 0
[/SIZE][SIZE=10pt] Frame loss [%]: 0.0 0.0 0.0
[/SIZE][SIZE=10pt] Distributed clocks:
[/SIZE][SIZE=10pt] Reference clock: Slave 0
[/SIZE][SIZE=10pt] DC reference time: 0
[/SIZE][SIZE=10pt] Application time: 0
[/SIZE][SIZE=10pt] 2000-01-01 00:00:00.000000000
[/SIZE][SIZE=10pt]pi@linuxcnc:~ $ ethercat slave
[/SIZE][SIZE=10pt]0 0:0 PREOP + EK1100 EtherCAT-Koppler (2A E-Bus)
[/SIZE][SIZE=10pt]1 0:1 PREOP + EL1008 8K. Dig. Eingang 24V, 3ms
[/SIZE][SIZE=10pt]2 0:2 PREOP + EL2008 8K. Dig. Ausgang 24V, 0.5A[/SIZE]
[SIZE=12pt]
[/SIZE][SIZE=12pt]linuxcnc-ethercat[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# Install the development version of linuxcnc
[/SIZE][SIZE=12pt]sudo apt install linuxcnc-uspace-dev
[/SIZE][SIZE=12pt]# Download, build and install linuxcnc-ethercat
[/SIZE][SIZE=12pt]git clone [/SIZE] [SIZE=12pt] github.com/sittner/linuxcnc-ethercat [/SIZE] [SIZE=12pt]
[/SIZE][SIZE=12pt]cd linuxcnc-ethercat
[/SIZE][SIZE=12pt]make configure
[/SIZE][SIZE=12pt]make
[/SIZE][SIZE=12pt]sudo make install
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]Test ethercat with linuxcnc[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# Skip the VNC steps if you are in front of the display
[/SIZE][SIZE=12pt]sudo raspi-config
[/SIZE][SIZE=12pt] 3 Interface options → Enable VNC server
[/SIZE][SIZE=12pt] Exit raspi-config
[/SIZE][SIZE=12pt]# Use VNC Control to connect to the display [/SIZE] [SIZE=8pt] www.realvnc.com/en/connect/download/viewer/windows/ [/SIZE]
[SIZE=12pt]
[/SIZE][SIZE=12pt]# Open a terminal window, start linuxcnc
[/SIZE][SIZE=12pt]linuxcnc
[/SIZE][SIZE=12pt] Select sim→axis→axis, copy the files. Axis should start. Exit axis.
[/SIZE][SIZE=12pt]cd linuxcnc/configs/sim.axis
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# Choose any of the ini files. In your ini file add in the [HAL] section[/SIZE]
[SIZE=9pt]HALFILE = ethercat.hal[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# Make an ethercat.hal file
[/SIZE][SIZE=9pt]loadusr -W lcec_conf ethercat-conf.xml
loadrt lcec
addf lcec.read-all servo-thread
addf lcec.write-all servo-thread[/SIZE]
[SIZE=12pt]
[/SIZE][SIZE=12pt]# Add a minimal ethercat-conf.xml[/SIZE]
[SIZE=9pt]<masters>
[/SIZE][SIZE=9pt] <master idx="0" appTimePeriod="1000000" refClockSyncCycles="5">
[/SIZE][SIZE=9pt] </master>
[/SIZE][SIZE=9pt]</masters>[/SIZE]
[SIZE=12pt]
[/SIZE][SIZE=12pt]# Start linuxcnc
[/SIZE][SIZE=12pt]linuxcnc inifile.ini
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# Check that you have plenty of lcec entries, check with for example (in another terminal window)
[/SIZE][SIZE=12pt]halcmd show all | grep lcec
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# A small real ethercat-conf.xml is[/SIZE]
[SIZE=9pt]<masters>
[/SIZE][SIZE=9pt] <master idx="0" appTimePeriod="1000000" refClockSyncCycles="5">
[/SIZE][SIZE=9pt] <slave idx="0" type="EK1100"/>
[/SIZE][SIZE=9pt] <slave idx="1" type="EL1008"/>
[/SIZE][SIZE=9pt] <slave idx="2" type="EL2008"/>
[/SIZE][SIZE=9pt] </master>
[/SIZE][SIZE=9pt]</masters>[/SIZE]
[SIZE=12pt]
[/SIZE][SIZE=12pt]# With linuxcnc started, a digital output on the EL2008 can be manipulated using standard
[/SIZE][SIZE=12pt]# hal syntax like
[/SIZE][SIZE=12pt]halcmd setp lcec.0.2.dout-7 1
[/SIZE][SIZE=12pt]# will switch on the output 8. The physical hardware is needed for this, of course.
[/SIZE][SIZE=12pt]
[/SIZE][SIZE=12pt]# Now ethercat works in linuxcnc. Add your own devices...[/SIZE]
Edit: This works also for building on Debian on an Intel computer - with a few modifications when building etherlabmaster. There are choices for network interface hardware and the ETHERCAT_MASTER0 needs another name. Best to check etherlabmaster/README.md for details.
Please Log in to join the conversation.
5 years 7 months ago #203879
by Grotius
Replied by Grotius on topic Notes from installation of ethercat on Raspberry Pi 4
Hi Hakan,
Nice tutorial. Thanks !
Nice tutorial. Thanks !
Please Log in to join the conversation.
5 years 7 months ago #204113
by thang
Replied by thang on topic Notes from installation of ethercat on Raspberry Pi 4
I didnt know you already wrote this :laugh: , so the command make modules_prepare isn't needed, i will link to this tutorial from my post
Please Log in to join the conversation.
- papagno-source
- Offline
- Elite Member
-
Less
More
- Posts: 170
- Thank you received: 0
5 years 7 months ago #204116
by papagno-source
Replied by papagno-source on topic Notes from installation of ethercat on Raspberry Pi 4
Hi. If want install ethercat on actual master , the prodedure is the same ?
Please Log in to join the conversation.
5 years 6 months ago #204265
by Hakan
Replied by Hakan on topic Notes from installation of ethercat on Raspberry Pi 4
Yes, except that when installing linuxcnc-uspace-dev you have to download the sources, compile and do all the right things to install linuxcnc. Make sure the ". ../linuxcnc-dev/scripts/rip-environment" is run. I tested this as well and this should work, maybe some adjustment along the way. I abandoned that way when I saw that it wasn't necessary to build linuxcnc from sources.
I guess the answer is "No" then.
I guess the answer is "No" then.
Please Log in to join the conversation.
5 years 6 months ago #206936
by Hakan
Replied by Hakan on topic Notes from installation of ethercat on Raspberry Pi 4
I now have a basic lathe setup with stepper motors using the ECT60 stepper drivers.
I attach the needed config files for running this minimal config. The axis works, that's all it does.
I use the cia402 component from github.com/dbraun1981/hal-cia402 .
I don't use pid control on the axis. I tried using pid control and it works but it didn't add anything as far as I saw so I removed it.
I attach the needed config files for running this minimal config. The axis works, that's all it does.
I use the cia402 component from github.com/dbraun1981/hal-cia402 .
I don't use pid control on the axis. I tried using pid control and it works but it didn't add anything as far as I saw so I removed it.
Attachment not found
Attachment not found
Attachment not found
Please Log in to join the conversation.
5 years 4 months ago #212048
by Hakan
Replied by Hakan on topic Notes from installation of ethercat on Raspberry Pi 4
Here is a video I made using the info in this thread.
I think I have accomplished a circular reference between this thread and the video now
I think I have accomplished a circular reference between this thread and the video now
Please Log in to join the conversation.
5 years 2 weeks ago #222770
by tuzki
Replied by tuzki on topic Notes from installation of ethercat on Raspberry Pi 4
Hi. I am a novice and I want to ask you a question.
You said that you did not use PID algorithm, why use PID algorithm in the driver? Shouldn't this PID algorithm be implemented in LinuxCNC?
You said that you did not use PID algorithm, why use PID algorithm in the driver? Shouldn't this PID algorithm be implemented in LinuxCNC?
Please Log in to join the conversation.
4 years 3 months ago #247939
by wgn21
Replied by wgn21 on topic Notes from installation of ethercat on Raspberry Pi 4
In the "make build step" I got the following error:
configure: error: Failed to find Linux sources. Use --with-linux-dir!
make[1]: *** [etherlabmaster.Makefile:31: autoconf] Error 1
make[1]: Leaving directory '/home/laserplasma/Desktop/etherlabmaster/etherlabmaster-code'
make: *** [/home/laserplasma/Desktop/etherlabmaster/configure/E3/RULES_ETHERLAB:73: autoconf] Error 2
Can someone please give some insights on how to solve it? I thought it's to do with the header installation but I think I already did that step using sudo apt install linux-headers-4.19.0-19-all
Please help. Thank you
configure: error: Failed to find Linux sources. Use --with-linux-dir!
make[1]: *** [etherlabmaster.Makefile:31: autoconf] Error 1
make[1]: Leaving directory '/home/laserplasma/Desktop/etherlabmaster/etherlabmaster-code'
make: *** [/home/laserplasma/Desktop/etherlabmaster/configure/E3/RULES_ETHERLAB:73: autoconf] Error 2
Can someone please give some insights on how to solve it? I thought it's to do with the header installation but I think I already did that step using sudo apt install linux-headers-4.19.0-19-all
Please help. Thank you
Please Log in to join the conversation.
4 years 3 months ago #247982
by andypugh
Replied by andypugh on topic Notes from installation of ethercat on Raspberry Pi 4
Is that the right linux-headers? It does not seem to be for an RT kernel.
Is that an exact match for the output of uname -a ?
Is that an exact match for the output of uname -a ?
Please Log in to join the conversation.
Time to create page: 0.375 seconds
