Hi,
Ec debianize is just a script for autostart the ethercat bus at pc startup.
But if ec debianize is not working, follow this steps and start your bus by a terminal command.
For info, this example has nothing involved with linuxcnc. The steps are showing how to install the ethercat bus on a linux pc and
then how to insert a ethercat kernel module EL2124 into the golden ring.
Info:
etherlab.org/en/ethercat/index.php
in terminal :
hg clone
hg.code.sf.net/p/etherlabmaster/code
ethercat-hg
cd ethercat-hg
hg update stable-1.5
Then in the ethercat-hg directory open the textfile INSTALL with text editor. Follow this steps.
In terminal:
./bootstrap
./configure --disable-8139too (this disables the 8139 driver, we will use generic driver)
make all modules
sudo make modules_install install
sudo depmod
--x--
sudo ln -s ${PREFIX}/etc/init.d/ethercat /etc/init.d/ethercat
sudo cp ${PREFIX}/etc/sysconfig/ethercat /etc/sysconfig/ethercat
--x--
if the steps between x are a problem. open directory ethercat-hg/script/
copy the ethercat-hg/sysconfig map to c:etc/ result = c:etc/sysconfig/ethercat
copy the ethercat-hg/inti.d/ethercat to c:etc/init.d/.. result = etc/init.d/etercat
Then in terminal :
ip link show (for your mac adres, used by next step)
open file as root : (sudo thunar, or sudo apt-get install thunar)
/etc/sysconfig/ethercat ( insert mac adress and generic driver )
MASTER0_DEVICE="yo:ur:ma:c:ad:re"
DEVICE_MODULES="generic"
Ok close file.
This one i did not use :
echo KERNEL=

"EtherCAT[0-9]*\", MODE=\"0664\" > /etc/udev/rules.d/99-EtherCAT.rules
Restart your system.
I started the ethercat by terminal command :
/etc/init.d/ethercat start
or
sudo /etc/init.d/ethercat start
You can do also : ethercat start / ethercat stop / ethercat status / etc.
Now the lights on the busterminal are flickering.
To test a kernel module, in terminal :
goto :
ethercat-hg/examples/mini/ (open terminal here)
In terminal :
sudo insmod ec_mini.ko
dmesg
My output : [ 6256.088425] ec_mini: AL states: 0x0A.
Ok now we make a custom kernel module for the EL2124. See attached mini.c file
Rename your current ethercat-hg/examples/mini.c file
Copy the attached mini.c file into ethercat-hg/examples
1.
open terminal in : ethercat-hg/examples/mini/
in terminal :
sudo make clean
2.
open terminal in : ethercat-hg/
in terminal :
make modules all
3.
open terminal in : ethercat-hg/examples/mini/
in terminal :
sudo insmod ec_mini.ko
4.
In terminal type : dmesg
Output dmesg :
[ 6647.436412] EtherCAT 0: Domain 0: Working counter changed to 1/1
[ 6647.436413] .
[ 6647.436414] ec_mini: Domain1: WC 1.
[ 6647.436415] ec_mini: Domain1: State 2.
[ 6647.508440] EtherCAT 0: Slave states on main device: OP.
[ 6647.804426] ec_mini: AL states: 0x08.
Ok the EL2124 is flickering 5 volts outputs. So now we are sure the ethercat bus is working oke.
to unload the kernel module : sudo rmmod ec_mini.ko
then : dmesg
Terminal output:
[ 7365.583838] ec_mini: Stopping...
[ 7365.583841] ec_mini: Releasing master...
[ 7365.583842] EtherCAT 0: Releasing master...
[ 7365.583868] EtherCAT 0: Master thread exited.
[ 7365.583875] EtherCAT 0: Starting EtherCAT-IDLE thread.
[ 7365.583916] EtherCAT 0: Released.
[ 7365.583916] ec_mini: Unloading.
[ 7365.592445] EtherCAT 0: Slave states on main device: PREOP, OP.
[ 7365.616433] EtherCAT 0: Slave states on main device: PREOP.
In the map /ethercat-hg/examples/user/main.c
This example is also working nice with QT programming. But it's at userland level.