Skip to content

Commit

Permalink
Update compile-ethercat.md
Browse files Browse the repository at this point in the history
  • Loading branch information
grotius-cnc authored Mar 22, 2021
1 parent fa4f5aa commit 57d5e84
Showing 1 changed file with 54 additions and 49 deletions.
103 changes: 54 additions & 49 deletions compile-ethercat.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,55 @@
For info only, this code compiles on Linux debian 5.10.0-4-rt-amd64, is info only to make a future patch set :
[master.zip](https://github.com/grotius-cnc/debian_distro_live_build_post_tweaking/files/6154607/master.zip)

$ sudo apt-get install mercurial

Edit the file : /etc/mercurial/hgrc
Add :

[extensions]
mq =

Get the source : https://sourceforge.net/u/uecasm/etherlab-patches/ci/default/tree/
Follow the steps.

$ hg clone -u 33b922ec1871 http://hg.code.sf.net/p/etherlabmaster/code etherlab
$ hg clone http://hg.code.sf.net/u/uecasm/etherlab-patches etherlab/.hg/patches # set invisible files to view.
$ cd etherlab
$ hg qpush -a
$ ./bootstrap
$ ./configure --enable-generic --disable-8139too
$ make
$ make all modules
$ sudo make modules_install install
$ sudo depmod

copy the /etc/init.d/ethercat to system dir.
copy the /etc/sysconfig/ethercat to system dir.

Add mac adres + generic driver to the etc/sysconfig/ethercat file.

$ cat /sys/class/net/enp0s25/address # retrieve mac adres.


$ chmod go+rwx /etc/udev/rules.d/99-ethercat.rules
$ echo "KERNEL=="\"EtherCAT[0-9]*\"", MODE="\"777\"", GROUP=""\"ethercat\"" > /etc/udev/rules.d/99-ethercat.rules

System command to restart some things:

$ systemctl restart systemd-modules-load.service

Now you can start the EtherCAT master:

$ sudo /etc/init.d/ethercat start # Make this file executable first.

Additional commands :

$ sudo /etc/init.d/ethercat stop
$ sudo /etc/init.d/ethercat restart



https://www.etherlab.org -> "report typo in INSTALL, =>./bootstrap"

#### Add sources to /etc/apt/sources.list

echo "deb http://ftp.de.debian.org/debian bullseye main contrib non-free" >> /etc/apt/source.list
echo "deb-src http://ftp.de.debian.org/debian bullseye main contrib non-free" >> /etc/apt/source.list
echo "deb http://security.debian.org/debian-security/ bullseye-security main" >> /etc/apt/source.list
echo "deb-src http://security.debian.org/debian-security/ bullseye-security main" >> /etc/apt/source.list
echo "deb http://deb.debian.org/debian buster main contrib non-free" >> /etc/apt/source.list
echo "deb-src http://deb.debian.org/debian buster main contrib non-free" >> /etc/apt/source.list
echo "deb http://security.debian.org/debian-security buster/updates main contrib" >> /etc/apt/source.list
echo "deb-src http://security.debian.org/debian-security buster/updates main contrib" >> /etc/apt/source.list
apt-get update

apt-get install git autoconf libtool linux-headers-$(uname -r)
git clone https://gitlab.com/etherlab.org/ethercat.git
cd ethercat
git checkout stable-1.5
./bootstrap
./configure --help
./configure --enable-generic --disable-8139too
make
make all modules
make modules_install install
depmod

#### Copy ethercat launcher :
cp -f /opt/ethercat/script/init.d/ethercat /etc/init.d/

#### Make ethercat launcher executable :
chmod +x /opt/ethercat/script/init.d/ethercat

#### copy ethercat mac and driver config sheet to system :
mkdir -p /etc/sysconfig/
cp -f /opt/ethercat/script/sysconfig/ethercat /etc/sysconfig/

#### Retrieve mac adres :
echo MASTER0_DEVICE="$(cat /sys/class/net/enp0s25/address)" > /etc/sysconfig/ethercat

#### We choose the generic driver to activate :
echo DEVICE_MODULES="generic" >> /etc/sysconfig/ethercat

#### From etherlab orginal :
chmod go+rwx /etc/udev/rules.d/99-ethercat.rules
echo "KERNEL=="\"EtherCAT[0-9]*\"", MODE="\"777\"", GROUP=""\"ethercat\"" > /etc/udev/rules.d/99-ethercat.rules

#### Start ethercat
/etc/init.d/ethercat start

#### Or if previous start fails :
systemctl restart systemd-modules-load.service
/etc/init.d/ethercat start

0 comments on commit 57d5e84

Please sign in to comment.