Inappropriate ioctl for device

More
13 Jun 2023 17:50 #273502 by Transint
Good day!
Installed Linuxcnc 2.8.4, started configuring EtherCAT, everything went well, all devices were defined, installed the driver, rebooted, EtherCAT started, but when I enter the "ethercat master" command, I see an error
Failed to get master information: Inappropriate ioctl for device
Where to look for a problem?

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

More
14 Jun 2023 14:07 #273544 by tommylight
What are you using to edit the files?
Only simple text editors should be used, be it xed, leafpad, geany, gedit. Never use office suite or word processors .

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

More
15 Jun 2023 08:48 #273591 by Transint
Only Geany and Mousepad

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

More
19 Jun 2023 11:32 #273841 by bt12g
Hello, Did you find any solution for this?
I'm stuck with same error for days..

If you find any info to get things fixed please share with me..

Thanks..

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

More
19 Jun 2023 12:52 #273851 by rodw
Replied by rodw on topic Inappropriate ioctl for device
Can you type these commands?
cd /lib/modules/$(uname r)
ls

Do you see an ethercat folder? If not, its broken

I found out today that the repository we have been using deploys broken deb files for  Bookworm. Not sure if the same applies for Buster.
I just posted some instructiosn in the sticky in this section with a solution.
 

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

More
19 Jun 2023 17:22 #273865 by cncLab
I found today the same issue after Ethercat - Linuxcnc-ethercat installation on existing Bullseye rip. The response to the command ethercat master and/or ethercat slaves is : 'Failed to get master information: Inappropriate ioctl for device'

Thanks in advance for any help on this
Note : for Bullseye and in older (one month ago) successful installation, the commandscd /lib/modules/$(uname -r)
ls

indicate no existence of any ethercat folder, although the response to the command 'ethercat master' is OK and the whole system seems operational.



 

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

More
19 Jun 2023 20:59 #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
21 Jun 2023 20:04 - 21 Jun 2023 20:21 #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.
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: 21 Jun 2023 20:21 by jjdege.

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

More
22 Jun 2023 03:09 #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
22 Jun 2023 21:14 #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.

Time to create page: 0.326 seconds
Powered by Kunena Forum