Inappropriate ioctl for device

More
3 years 4 months ago #273874 by rodw
Replied by rodw on topic Inappropriate ioctl for device
I think the problem is the debs did not install correctly and EtherCAT is unable to find a driver which should be under
/lib/modules/<your kernel>/ethercat/master (and other folders under the ethercat folder mentioned)
I think the solution is to build EtherCAT master from source. I documented how to do this last night and roughly documented it  here.
forum.linuxcnc.org/ethercat/45336-etherc...step?start=80#273846

Please try this and let me know how you go. Note these instructions do not cover how to install the hal driver described in the first post of the thread I linked to.

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

More
3 years 4 months ago - 3 years 4 months ago #274004 by jjdege
Hi rodw
I followed your procedure. forum.linuxcnc.org/ethercat/45336-etherc...step?start=80#273846
From the terminal the master is displayed, but the slave is not seen.
I tried the procedure used in the past with Bullseye and it works: from the terminal you can see the EtherCAT master and slave.

Note: For Bullseye I installed the dependencies before building the master from source.
I didn't do it here because I think the dependencies already installed with yesterday's .deb, and it's correct because it works
This is the procedure I followed.
I hope it can be useful.
Code:
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 /git/ethercat/script/init.d/ethercat /etc/init.d/ #Make ethercat launcher executable :     chmod +x /git/ethercat/script/init.d/ethercat #copy ethercat mac and driver config sheet to system :     mkdir -p /etc/sysconfig/     cp -f /git/ethercat/script/sysconfig/ethercat /etc/sysconfig/      #Retrieve mac adres :     echo MASTER0_DEVICE="$(cat /sys/class/net/enp1s0/address)" > /etc/sysconfig/ethercat #We choose the generic driver to activate :     echo DEVICE_MODULES="generic" >> /etc/sysconfig/ethercat #From etherlab orginal :          echo "KERNEL=="\"EtherCAT[0-9]*\"", MODE="\"777\"", GROUP=""\"ethercat\"" > /etc/udev/rules.d/99-ethercat.rules          chmod go+rwx /etc/udev/rules.d/99-ethercat.rules              sudo systemctl enable ethercat.service     sudo systemctl start ethercat.service     sudo systemctl status ethercat.service     sudo chmod 666 /dev/EtherCAT0     /etc/init.d/ethercat start  
Last edit: 3 years 4 months ago by jjdege.

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

More
3 years 4 months ago #274026 by rodw
Replied by rodw on topic Inappropriate ioctl for device
I got an update on this. Etherlabmaster have been able to replicate the issue and have told me they will share a new .deb file via their repo in due course.  Compiling from source seems to solve the problem if you can't wait for them.
The following user(s) said Thank You: tommylight

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

More
3 years 4 months ago #274087 by jjdege
HI,
I installed the .deb packages that Etherlab made available today. Work!
I started with a fresh install of Bookworm.
Thank You very much

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

More
3 years 4 months ago #274126 by rodw
Replied by rodw on topic Inappropriate ioctl for device
Yes, they reverted to an older version of the code. I tested it as working this morning but I had to reinstall Debian as I could not cleanly delete the broken config. Great to have confirmation from someone else.

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

More
3 years 4 months ago - 3 years 4 months ago #274190 by jjdege
HI
EtherCAT works, but every system reboot gave me "/dev/EtherCAT0: Permission denied"
I solved with
Code:
echo "KERNEL=="\"EtherCAT[0-9]*\"", MODE="\"777\"", GROUP=""\"ethercat\"" > /etc/udev/rules.d/99 -ethercat.rules chmod go+rwx /etc/udev/rules.d/99-ethercat.rules
I believe it puts "EtherCAT0" in the ethercat group with the necessary permissions
I don't know if it's the right way, it works
Thank You very much
Last edit: 3 years 4 months ago by jjdege.

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

Time to create page: 0.284 seconds
Powered by Kunena Forum