×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Port failure Error: Inappropriate ioctl for device.

  • Posts: 2247
  • Thank you received: 223
I have been using the following udev rule for a while now, working great until very recently.
# HEQ5 mount
SUBSYSTEMS=="usb", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", ATTR{manufacturer}=="Prolific Technology Inc.", MODE="0777", SYMLINK+="Mount"

It does create /dev/Mount as expected.
lrwxrwxrwx 1 root root          15 Aug 12 22:32 Mount -> bus/usb/001/079
crw-rw---- 1 root dialout 188,   1 Aug 12 22:32 ttyUSB1

My EQmod is set to connect to that device, so far so good until recently where I get the following issue:
[ERROR] Failed to connect to port (/dev/Mount). Error: Port failure Error: Inappropriate ioctl for
device. Check if device is connected to this port.

dmesg:
[398112.100972] pl2303 1-1.2.3.2:1.0: pl2303 converter detected
[398112.102629] usb 1-1.2.3.2: pl2303 converter now attached to ttyUSB1

However, if I select /tty/USB1 directly in Eqmod, it connects without a fuss.


Any help is appreciated, thanks

root@heidenrod-obs:/home# udevadm info -n /dev/Mount 
P: /devices/lm1/usb1/1-1/1-1.2/1-1.2.3/1-1.2.3.2
N: bus/usb/001/079
S: Mount
E: BUSNUM=001
E: DEVLINKS=/dev/Mount
E: DEVNAME=/dev/bus/usb/001/079
E: DEVNUM=079
E: DEVPATH=/devices/lm1/usb1/1-1/1-1.2/1-1.2.3/1-1.2.3.2
E: DEVTYPE=usb_device
E: DRIVER=usb
E: ID_BUS=usb
E: ID_MODEL=USB-Serial_Controller
E: ID_MODEL_ENC=USB-Serial\x20Controller
E: ID_MODEL_FROM_DATABASE=PL2303 Serial Port
E: ID_MODEL_ID=2303
E: ID_REVISION=0300
E: ID_SERIAL=Prolific_Technology_Inc._USB-Serial_Controller
E: ID_USB_INTERFACES=:ff0000:
E: ID_VENDOR=Prolific_Technology_Inc.
E: ID_VENDOR_ENC=Prolific\x20Technology\x20Inc.
E: ID_VENDOR_FROM_DATABASE=Prolific Technology, Inc.
E: ID_VENDOR_ID=067b
E: MAJOR=189
E: MINOR=78
E: PRODUCT=67b/2303/300
E: SUBSYSTEM=usb
E: TYPE=0/0/0
E: USEC_INITIALIZED=398115350936
 
root@heidenrod-obs:/home# udevadm info -n /dev/ttyUSB1 
P: /devices/lm1/usb1/1-1/1-1.2/1-1.2.3/1-1.2.3.2/1-1.2.3.2:1.0/ttyUSB1/tty/ttyUSB1
N: ttyUSB1
S: serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0
E: DEVLINKS=/dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0
E: DEVNAME=/dev/ttyUSB1
E: DEVPATH=/devices/lm1/usb1/1-1/1-1.2/1-1.2.3/1-1.2.3.2/1-1.2.3.2:1.0/ttyUSB1/tty/ttyUSB1
E: ID_BUS=usb
E: ID_MODEL=USB-Serial_Controller
E: ID_MODEL_ENC=USB-Serial\x20Controller
E: ID_MODEL_FROM_DATABASE=PL2303 Serial Port
E: ID_MODEL_ID=2303
E: ID_REVISION=0300
E: ID_SERIAL=Prolific_Technology_Inc._USB-Serial_Controller
E: ID_TYPE=generic
E: ID_USB_DRIVER=pl2303
E: ID_USB_INTERFACES=:ff0000:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=Prolific_Technology_Inc.
E: ID_VENDOR_ENC=Prolific\x20Technology\x20Inc.
E: ID_VENDOR_FROM_DATABASE=Prolific Technology, Inc.
E: ID_VENDOR_ID=067b
E: MAJOR=188
E: MINOR=1
E: SUBSYSTEM=tty
E: TAGS=:systemd:
E: USEC_INITIALIZED=398115364254
 
root@heidenrod-obs:/home#
Last edit: 5 years 7 months ago by Gonzothegreat.
5 years 7 months ago #28513

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

  • Posts: 1029
  • Thank you received: 301
These are clearly not the same device, see the major/minor? Another device is detected as a prolific serial converter and is taking the symlink. You need to be more restrictive on the device selection in the udev rule.

-Eric
5 years 7 months ago #28537

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

  • Posts: 2247
  • Thank you received: 223
Hello Eric,

I only have one adapter plugged in, it's a symlink through udev rules.
Something has changed, I need to figure it out. yes I agree the major an minor are different.
5 years 7 months ago #28568

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

  • Posts: 1029
  • Thank you received: 301
Change logging level of the udev daemon with "udevadm control --log-priority=info". Plug out, run "dmesg -Hw", plug in. You should see what is happening perhaps.

-Eric
5 years 7 months ago #28571

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

  • Posts: 1029
  • Thank you received: 301
Oh sorry now I see it! You need to filter the "tty" subsystem in your udev rule, not the "usb" subsystem. What you are interested in is the device that offer serial transfer features...

-Eric
5 years 7 months ago #28572

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

  • Posts: 2247
  • Thank you received: 223
ok, I shall amend the rule and see how it goes. Will report soon.
Last edit: 5 years 7 months ago by Gonzothegreat.
5 years 7 months ago #28575

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

  • Posts: 1
  • Thank you received: 0
Just FYI for the people googling this in the future: I had this exact same problem with a CP201x usb-serial adapter. The solution is to change all the "ATTR" references to "ATTRS" in the udev rules. That's it. That's the magic incantation. I hoped this helped someone.
In this case changing ATTR{manufacturer}=="Prolific Technology Inc." to ATTRS{manufacturer}=="Prolific Technology Inc." most likely would have fixed OP's issue.

Also, here's a link to a pile of udev rules at work:
raw.githubusercontent.com/platformio/pla...latformio-udev.rules
It was through examining the differences between those rules and my own that fixed the issue.
3 years 10 months ago #53459

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

Time to create page: 0.448 seconds