Closed jdugge closed 7 years ago
Two things you could try:
sudo /etc/init.d/ethercat restart
hg clone http://hg.code.sf.net/p/etherlabmaster/code ethercat-hg
hg pull
might work, too.As a side note: sudo ifconfig eth0 192.168.100.164 up
is just for debugging and development, of the pure (not EtherLab integrated) driver. In EtherCAT operation mode there is no IP traffic on the ccat ethernet device.
Update: MAC address should be fine as it is working with the generic driver.
Thanks for getting back to me so quickly!
Unfortunately, that didn't work. I had actually already been using the current version of Etherlab from the Mercurial repository, the step of downloading the tarball shouldn't have been in my problem description. Sorry for that!
Do I need to update the CCAT firmware (I noticed that there's an update_ccat.sh
script in the CCAT repository)? I guess not, since this is a brand new CX2030, so the firmware is probably already up to date?
Would it help in narrowing down the problem if I got the CCAT unit tests to run? At the moment, the rw_gpio
scripts fail because /sys/class/gpio
only contains an export
and unexport
file, but no gpio<number>
subdirectories. Is this an indicator of something being wrong on my setup?
Ah, I am pretty sure I know what your problem is.
Kernel 3.15 got a new driver ec_bhf and Ubuntu recently upgraded to a newer kernel.
ec_bhf
is a driver for the CCAT FPGA and was developed by Darek Marcinkiewicz, who isn't associated with Beckhoff in any way. Unfortunately his (ec_bhf
) and our (ccat
) driver, were developed at the same time without knowing of each other. So Darek pushed it to the kernel in an very early stage. And by luck it was accepted by upstream kernel.
Unfortunately, ec_bhf
only supports basic ethernet functionality to work with SOEM another open source EtherCAT Master like EtherLab. So you can't use it without adjustments to run with EtherLab. If you are okay by using SOEM, I think you could just use that driver.
If you want to use EtherLab my suggestion would be to get rid of ec_bhf
and replace it with ccat/ec_ccat
.
I would:
# unload ec_bhf
sudo rmmod ec_bhf
# blacklist ec_bhf (beware it might be included in your initramfs)
echo "blacklist ec_bhf" | sudo tee -a /etc/modpobe.d/blacklist.conf
Regards,
Patrick Bruenn
p.s.: Don't get me wrong. My favorite solution would be to advance ec_bhf
so that you cold easily use it with EtherLab. But in practice that's a very very difficult work (at least for us). The first thing is the naming convention. The EtherLab version of ec_bhf would be named ec_ec_bhf. The next thing is ec_bhf only supports the Ethernet functionality of the CCAT FPGA. So ccat
has some amount of infrastructure code, which needs to be ported to kernel FPGA infrastructure. We as Beckhoff just don't have the reputation (and experience) in the Linux kernel community to get such changes into upstream. Of course, in the long run that's what we want to do. But at the moment the reality is that even small changes to add board support for our products to U-Boot are not accepted by the community.
Fantastic, Patrick, that was it! Removing the ec_bhf
module did the trick.
It works like a charm now: The connection is initialised, I can change the slaves' states, and read data from the inputs.
Thank you for your help in resolving this so quickly, and for the detailed explanations!
We are trying to get a Beckhoff CX2030 Industrial PC running Ubuntu to accept input from Beckhoff EL3024 modules using Etherlab with the CCAT modules. However, we haven't been able to initialise the EtherCAT connection, the EtherCAT messages stop at
EtherCAT: 1 master waiting for devices.
Could you give us a hand troubleshooting this issue? Below are the steps we took to install Etherlab and CCAT on a clean Ubuntu 14.04.5 install on the CX2030.
sudo apt install mercurial automake libtool build-essential
The last line raises the following error, but apparently that can be ignored
Continue installation:
Edit
/etc/sysconfig/ethercat
:Pull up the interface
Start ethercat:
Check the status with
dmesg
:And that's where it stops. Ethercat is never able to
If I use the
generic
module instead, ethercat at least recognises that there are slaves on the bus, but the initialisation doesn't complete successfully: