Ethercat installation from repositories - how to step by step

More
1 year 10 months ago #316150 by rodw
If it has a mokutil error, that implies that you are using secure boot and need to enroll dkms into the security model. It is briefly explained in the first post.

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago #316592 by Sockheaven
@Rkatts
I think I have identified the issue you're struggling with.  I have been struggling to get the Kollmorgen AKD servo drives to communicate with LinuxCNC 2.9.X ethercat and been stuck on version 2.8.X for a while now.

I have long suspected that the choice to make EoE default to On is the root cause, and believe I have confirmed this.
It appears you need to compile the IGH master yourself with the --disable-eoe option, once this is successfully installed, the problems go away.

From some additional searches, it sounds like if EoE is turned on you need to have the specific function handlers to handle the EoE packets, otherwise the drive will get bungled up trying to process EoE packets with the CoE handler (this is my hand wavy explanation in my head, not sure its exactly what is happening).

I am using the generic controller and using generic XML configuration for the run up script, so this would make sense.

I am also very green with Linux so this took me quite a while to figure out, but I have put together a install guide for those wishing to do the same, hopefully it is adequate:
  1. Download the LinuxCNC Debian 12 iso (with LinuxCNC 2.9.3 preinstalled)
    image the iso onto a thumb drive using Rufus, install onto PC
    linuxcnc.org/downloads/
  2. Install extra tools:
    $ sudo apt-get install git
    $ sudo apt-get install caja

  3. Manually compile/install the IGH Master
    Following official guide: docs.etherlab.org/ethercat/1.5/pdf/ethercat_doc.pd

    Open a terminal and clone the master repo
    $ sudo git clone gitlab.com/etherlab.org/ethercat.git /etherlab

    Change directory to /etherlab
    $ sudo ./bootstrap
    $ sudo ./configure --sysconfdir=/etc/ --disable-eoe
    $ sudo make
    $ sudo make modules
    $ sudo make install
    $ sudo make modules_installMark the EtherCAT config file editable:
    $ sudo chmod 777 /etherlab/script/ethercat.conf

    Open EtherCAT config and set the adapter Mac ADDR
    Retrieve mac address of adapter you with to use:
    $ ip addr

    In the /etherlab/script/ethercat.conf, update mag addr and devices:
    Enter that mac address on the master0 device lineMASTER0_DEVICE="00:e0:4c:f1:b9:af"   (where the highlighted string is the mac address of your adapter
    Set the DEVICES = “generic” (do not leave blank)

    Enable / Start the EtherCAT service
    $ sudo systemctl enable ethercat.service
    $ sudo systemctl start ethercat.service Verify Master is running/working
    $ ethercat master

    You should get an output (not that no master can be found)

  4. Install EtherCAT support for LinuxCNC
    $ sudo apt update
    $ sudo apt install -y linux-headers-$(uname -r) linuxcnc-ethercatTrying to install without installing the package “ethercat-master” but watching the above build progress it appears to install that anyways.
    At the end of this build process it will notice you have already installed EtherCAT. It appears the user needs to answer “NO” to this prompt to maintain the manually installed version without EoE.
  5. Note Location of LCEC configuration      
    This process installed the lcec object/config file in a new locationNeed to update the LinuxCNC project hal file to use the new location: loadusr -W /usr/bin/lcec_conf ethercat-conf.xml
  6. Update ethercat-conf.xml based on network/device topology and start LinuxCNC

I think that was all the steps, let me know if that helps out or I missed some steps

For anyone that may know the process of updating the official releases, I would make a suggestion that EoE is disabled by default due to the requirements of having compiled driver for your specific EtherCAT device.
If the goal is to make LinuxCNC work out of the box, I'd argue that the configuration released with 2.8.X was easier to use than the default configuration of 2.9.X (so far) since the enabling of EoE appears to require the use of non-generic devices.

I've noticed others having better luck than I had with EtherCAT on LinuxCNC 2.9.X, so maybe I just need to learn how to compile those device drivers, but my lack of experience in linux is holding me back at the moment.

Best Regards,
Paul

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago #316617 by rodw
the Ethercat code is managed by etherlabmaster not this project. 

If you read their docs, this appears to be a buggy implementation on your hardware as it says:

During bus scanning (see section 5.4), the master determines the supported mailbox protocols for each slave. This is done by examining the “Supported Mailbox Protocols” mask field at word address 0x001C of the SII. If bit 1 is set, the slave supports the EoE protocol. In this case, an EoE handler is created for that slave.

Perhaps this flag can be disabled on your drive.

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago - 1 year 10 months ago #316765 by Sockheaven
Rodw,
I tried disabling support in the Sii params to indicate EoE was not even available, and unfortunately this did not alleviate my problem (I tried this before I figured out how to compile the master manually).

However, you bring up a good point - if all of the other drives appear to work fine and only the Kollmorgen one is not, then perhaps it is a poor implementation of EoE on the drive.

I did notice that when getting the IGH sources there are quite a few devies that seem to have direct support - whereas I am operating in "generic" mode. I do wonder if an official device support code/object was in there things would be different.

In your opinion/observations are most people using devices that appear to come with the IGH release, or are most people using the generic mode? 

I will submit a ticket to Kollmorgen to see if they will investigate that.
BTW is there a way to send direct messages to people? I wanted to reach out to ask you something on the side, but can't seem to find a way to send personal messages on the LinuxCNC forum.

Best Regards,
Paul
Last edit: 1 year 10 months ago by Sockheaven.

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago #316892 by Tntmold
does the step-by-step still work? I get multiple 'failed to fetch' errors for ethercat-dkms, ethercat-master, libethercat, libethercat-dev and linuxcnc-ethercat

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago #316899 by rodw
Yes, I just tested it and it gets everything

Please Log in or Create an account to join the conversation.

Time to create page: 2.475 seconds
Powered by Kunena Forum