#26 Déconnection USB : usb_serial_generic_read_bulk_callback - urb stopped: -32

Закрыто
открыта 4 лет назад maxime-alves · комментариев: 11
maxime-alves прокомментировал 4 лет назад

De temps à autre, lorsque pyHeatpump est activé, le device “ttyUSB0” disparaît et se transforme en “ttyUSB1”. Voici les logs corespondant :

137240.259397] ftdi_sio 1-1.3:1.0: FTDI USB Serial Device converter detected
[137240.260089] usb 1-1.3: Detected FT232BM
[137240.261145] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB0
[137373.375308] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
[137373.375382] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
[137373.431288] usb 1-1.3: USB disconnect, device number 77
[137373.431527] ftdi_sio ttyUSB0: error from flowcontrol urb
[137373.431893] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[137373.431945] ftdi_sio 1-1.3:1.0: device disconnected
[137374.243657] usb 1-1.3: new full-speed USB device number 78 using dwc_otg
[137374.399746] usb 1-1.3: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 2.00
[137374.399770] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[137374.399785] usb 1-1.3: Product: Carel USB-RS485 Converter
[137374.399799] usb 1-1.3: Manufacturer: Carel S.P.A.
[137374.411429] ftdi_sio 1-1.3:1.0: FTDI USB Serial Device converter detected
[137374.412110] usb 1-1.3: Detected FT232BM
[137374.413292] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB1
[137377.015308] usb 1-1.3: USB disconnect, device number 78
[137377.016565] ftdi_sio ttyUSB1: FTDI USB Serial Device converter now disconnected from ttyUSB1
[137377.016704] ftdi_sio 1-1.3:1.0: device disconnected
[137377.563756] usb 1-1.3: new full-speed USB device number 79 using dwc_otg
[137377.719841] usb 1-1.3: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 2.00
[137377.719865] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[137377.719880] usb 1-1.3: Product: Carel USB-RS485 Converter
[137377.719894] usb 1-1.3: Manufacturer: Carel S.P.A.
[137377.731796] ftdi_sio 1-1.3:1.0: FTDI USB Serial Device converter detected
[137377.732974] usb 1-1.3: Detected FT232BM
[137377.734607] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB1
[137412.074089] rpi_firmware_get_throttled: 9 callbacks suppressed
[137412.074097] Voltage normalised (0x00000000)
[137482.795003] rpi_firmware_get_throttled: 10 callbacks suppressed
[137482.795014] Under-voltage detected! (0x00050005)
[137489.034926] Voltage normalised (0x00000000)
De temps à autre, lorsque pyHeatpump est activé, le device "ttyUSB0" disparaît et se transforme en "ttyUSB1". Voici les logs corespondant : ``` 137240.259397] ftdi_sio 1-1.3:1.0: FTDI USB Serial Device converter detected [137240.260089] usb 1-1.3: Detected FT232BM [137240.261145] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB0 [137373.375308] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32 [137373.375382] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32 [137373.431288] usb 1-1.3: USB disconnect, device number 77 [137373.431527] ftdi_sio ttyUSB0: error from flowcontrol urb [137373.431893] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0 [137373.431945] ftdi_sio 1-1.3:1.0: device disconnected [137374.243657] usb 1-1.3: new full-speed USB device number 78 using dwc_otg [137374.399746] usb 1-1.3: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 2.00 [137374.399770] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [137374.399785] usb 1-1.3: Product: Carel USB-RS485 Converter [137374.399799] usb 1-1.3: Manufacturer: Carel S.P.A. [137374.411429] ftdi_sio 1-1.3:1.0: FTDI USB Serial Device converter detected [137374.412110] usb 1-1.3: Detected FT232BM [137374.413292] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB1 [137377.015308] usb 1-1.3: USB disconnect, device number 78 [137377.016565] ftdi_sio ttyUSB1: FTDI USB Serial Device converter now disconnected from ttyUSB1 [137377.016704] ftdi_sio 1-1.3:1.0: device disconnected [137377.563756] usb 1-1.3: new full-speed USB device number 79 using dwc_otg [137377.719841] usb 1-1.3: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 2.00 [137377.719865] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [137377.719880] usb 1-1.3: Product: Carel USB-RS485 Converter [137377.719894] usb 1-1.3: Manufacturer: Carel S.P.A. [137377.731796] ftdi_sio 1-1.3:1.0: FTDI USB Serial Device converter detected [137377.732974] usb 1-1.3: Detected FT232BM [137377.734607] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB1 [137412.074089] rpi_firmware_get_throttled: 9 callbacks suppressed [137412.074097] Voltage normalised (0x00000000) [137482.795003] rpi_firmware_get_throttled: 10 callbacks suppressed [137482.795014] Under-voltage detected! (0x00050005) [137489.034926] Voltage normalised (0x00000000) ```
maxime-alves прокомментировал 4 лет назад
Соавтор

Issue github

Réponse :

I discovered what was causing this ‘error’ for me. My program was leaving the /dev/ttyUSBN serial port open. I rebooted and changed my software to close the port after use (Previously, it was left open in one of the error cases). After doing this, I no longer saw the dmesg or syslog errors. Hopefully this helps.

EDIT : Cette issue semble être très reliée aux cas que nous avons experimentés avec le convertisseur non-carel

[Issue github](https://github.com/raspberrypi/linux/issues/2406) Réponse : > I discovered what was causing this 'error' for me. My program was leaving the /dev/ttyUSBN serial port open. I rebooted and changed my software to close the port after use (Previously, it was left open in one of the error cases). After doing this, I no longer saw the dmesg or syslog errors. Hopefully this helps. EDIT : Cette issue semble être très reliée aux cas que nous avons experimentés avec le convertisseur non-carel
maxime-alves добавил(а) метку
heatpumps
4 лет назад
maxime-alves добавил(а) метку
prioritaire
4 лет назад
maxime-alves добавил(а) метку
system
4 лет назад
maxime-alves прокомментировал 4 лет назад
Соавтор

Ce problème est assez bloquant car il fait planter pyheatpum_fetch.service . Il faudrait voir si l’ont peut timer les services sur l’arrêt d’un autre, quelque chose du style :

t0 - START pyheatpump_fetch
t1 - STOP pyheatpum_fetch
t2 - START pyheatpump_supervise
t3 - STOP pyheatpump_supervise

Une autre voie pour corriger ce problème serait de poser une règle “udev” sur le la signature du matériel attendue pour forcer l’utilisation de ttyUSB0 sur celui ci. Les signatures du matériel peuvent différer selon le chipset, mais à priori, on sera soit sur de la FTDI soit sur de la CH340.

Voir : #61

UDEV rules : https://noctis.de/posts/2006/03/23-howto-fixed-name-for-a-udev-device.html

Ce problème est assez bloquant car il fait planter pyheatpum_fetch.service . Il faudrait voir si l'ont peut *timer* les services sur l'arrêt d'un autre, quelque chose du style : ``` t0 - START pyheatpump_fetch t1 - STOP pyheatpum_fetch t2 - START pyheatpump_supervise t3 - STOP pyheatpump_supervise ``` Une autre voie pour corriger ce problème serait de poser une règle "udev" sur le la signature du matériel attendue pour forcer l'utilisation de ttyUSB0 sur celui ci. Les signatures du matériel peuvent différer selon le chipset, mais à priori, on sera soit sur de la FTDI soit sur de la CH340. Voir : https://git.yannweb.net/nas/Supervision/issues/61 UDEV rules : https://noctis.de/posts/2006/03/23-howto-fixed-name-for-a-udev-device.html
maxime-alves прокомментировал 4 лет назад
Соавтор

FTDI Chip

udevadm info /dev/ttyUSB0

P: /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/ttyUSB0/tty/ttyUSB0
N: ttyUSB0
L: 0
S: serial/by-id/usb-Carel_S.P.A._Carel_USB-RS485_Converter-if00-port0
S: serial/by-path/platform-3f980000.usb-usb-0:1.3:1.0-port0
E: DEVPATH=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/ttyUSB0/tty/ttyUSB0
E: DEVNAME=/dev/ttyUSB0
E: MAJOR=188
E: MINOR=0
E: SUBSYSTEM=tty
E: USEC_INITIALIZED=656579486729
E: ID_VENDOR=Carel_S.P.A.
E: ID_VENDOR_ENC=Carel\x20S.P.A.
E: ID_VENDOR_ID=0403
E: ID_MODEL=Carel_USB-RS485_Converter
E: ID_MODEL_ENC=Carel\x20USB-RS485\x20Converter
E: ID_MODEL_ID=6001
E: ID_REVISION=0200
E: ID_SERIAL=Carel_S.P.A._Carel_USB-RS485_Converter
E: ID_TYPE=generic
E: ID_BUS=usb
E: ID_USB_INTERFACES=:ffffff:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=ftdi_sio
E: ID_VENDOR_FROM_DATABASE=Future Technology Devices International, Ltd
E: ID_MODEL_FROM_DATABASE=FT232 Serial (UART) IC
E: ID_PATH=platform-3f980000.usb-usb-0:1.3:1.0
E: ID_PATH_TAG=platform-3f980000_usb-usb-0_1_3_1_0
E: DEVLINKS=/dev/serial/by-id/usb-Carel_S.P.A._Carel_USB-RS485_Converter-if00-port0 /dev/serial/by-path/platform-3f980000.usb-usb-0:1.3:1.0-port0
E: TAGS=:systemd:


udevadm info -a /dev/ttyUSB0


Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/ttyUSB0/tty/ttyUSB0':
    KERNEL=="ttyUSB0"
    SUBSYSTEM=="tty"
    DRIVER==""

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/ttyUSB0':
    KERNELS=="ttyUSB0"
    SUBSYSTEMS=="usb-serial"
    DRIVERS=="ftdi_sio"
    ATTRS{port_number}=="0"
    ATTRS{latency_timer}=="16"

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0':
    KERNELS=="1-1.3:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="ftdi_sio"
    ATTRS{supports_autosuspend}=="1"
    ATTRS{authorized}=="1"
    ATTRS{bInterfaceClass}=="ff"
    ATTRS{bNumEndpoints}=="02"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bInterfaceSubClass}=="ff"
    ATTRS{bInterfaceNumber}=="00"
    ATTRS{interface}=="Carel USB-RS485 Converter"
    ATTRS{bInterfaceProtocol}=="ff"

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3':
    KERNELS=="1-1.3"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{quirks}=="0x0"
    ATTRS{rx_lanes}=="1"
    ATTRS{bmAttributes}=="80"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{tx_lanes}=="1"
    ATTRS{bcdDevice}=="0200"
    ATTRS{configuration}==""
    ATTRS{bConfigurationValue}=="1"
    ATTRS{urbnum}=="13"
    ATTRS{bMaxPower}=="50mA"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="Carel S.P.A."
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{speed}=="12"
    ATTRS{removable}=="removable"
    ATTRS{devspec}=="(null)"
    ATTRS{maxchild}=="0"
    ATTRS{idVendor}=="0403"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{version}==" 1.10"
    ATTRS{devnum}=="90"
    ATTRS{authorized}=="1"
    ATTRS{bDeviceClass}=="00"
    ATTRS{busnum}=="1"
    ATTRS{devpath}=="1.3"
    ATTRS{product}=="Carel USB-RS485 Converter"
    ATTRS{idProduct}=="6001"
    ATTRS{bMaxPacketSize0}=="8"

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1':
    KERNELS=="1-1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{bcdDevice}=="0200"
    ATTRS{quirks}=="0x0"
    ATTRS{bMaxPower}=="2mA"
    ATTRS{version}==" 2.00"
    ATTRS{ltm_capable}=="no"
    ATTRS{authorized}=="1"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{maxchild}=="5"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{urbnum}=="25718"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{rx_lanes}=="1"
    ATTRS{devnum}=="2"
    ATTRS{idProduct}=="9514"
    ATTRS{configuration}==""
    ATTRS{removable}=="unknown"
    ATTRS{busnum}=="1"
    ATTRS{speed}=="12"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{tx_lanes}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{devpath}=="1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{idVendor}=="0424"
    ATTRS{bDeviceClass}=="09"
    ATTRS{avoid_reset_quirk}=="0"

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1':
    KERNELS=="usb1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{idVendor}=="1d6b"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized_default}=="1"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{manufacturer}=="Linux 5.4.51-v7+ dwc_otg_hcd"
    ATTRS{bmAttributes}=="e0"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{rx_lanes}=="1"
    ATTRS{version}==" 2.00"
    ATTRS{tx_lanes}=="1"
    ATTRS{busnum}=="1"
    ATTRS{idProduct}=="0002"
    ATTRS{urbnum}=="36"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bMaxPower}=="0mA"
    ATTRS{product}=="DWC OTG Controller"
    ATTRS{configuration}==""
    ATTRS{removable}=="unknown"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{maxchild}=="1"
    ATTRS{interface_authorized_default}=="1"
    ATTRS{speed}=="480"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{devpath}=="0"
    ATTRS{bcdDevice}=="0504"
    ATTRS{authorized}=="1"
    ATTRS{serial}=="3f980000.usb"
    ATTRS{devnum}=="1"
    ATTRS{ltm_capable}=="no"

  looking at parent device '/devices/platform/soc/3f980000.usb':
    KERNELS=="3f980000.usb"
    SUBSYSTEMS=="platform"
    DRIVERS=="dwc_otg"
    ATTRS{mode}=="Mode = 0x1"
    ATTRS{guid}=="GUID = 0x2708a000"
    ATTRS{hcddump}=="HCD Dump"
    ATTRS{regoffset}=="0xffffffff"
    ATTRS{rd_reg_test}=="Time to read GNPTXFSIZ reg 10000000 times: 1300 msecs (130 jiffies)"
    ATTRS{gpvndctl}=="GPVNDCTL = 0x00000000"
    ATTRS{regvalue}=="invalid offset"
    ATTRS{buspower}=="Bus Power = 0x1"
    ATTRS{enumspeed}=="Device Enumeration Speed = 0x1"
    ATTRS{wr_reg_test}=="Time to write GNPTXFSIZ reg 10000000 times: 350 msecs (35 jiffies)"
    ATTRS{grxfsiz}=="GRXFSIZ = 0x00000306"
    ATTRS{remote_wakeup}=="Remote Wakeup Sig = 0 Enabled = 0 LPM Remote Wakeup = 0"
    ATTRS{driver_override}=="(null)"
    ATTRS{ggpio}=="GGPIO = 0x00000000"
    ATTRS{rem_wakeup_pwrdn}==""
    ATTRS{gusbcfg}=="GUSBCFG = 0x20001700"
    ATTRS{hsic_connect}=="HSIC Connect = 0x1"
    ATTRS{regdump}=="Register Dump"
    ATTRS{inv_sel_hsic}=="Invert Select HSIC = 0x0"
    ATTRS{srpcapable}=="SRPCapable = 0x1"
    ATTRS{fr_interval}=="Frame Interval = 0xea5f"
    ATTRS{busconnected}=="Bus Connected = 0x1"
    ATTRS{gotgctl}=="GOTGCTL = 0x001c0001"
    ATTRS{mode_ch_tim_en}=="Mode Change Ready Timer Enable = 0x0"
    ATTRS{gsnpsid}=="GSNPSID = 0x4f54280a"
    ATTRS{hnpcapable}=="HNPCapable = 0x1"
    ATTRS{srp}=="SesReqScs = 0x1"
    ATTRS{hnp}=="HstNegScs = 0x0"
    ATTRS{hprt0}=="HPRT0 = 0x00021405"
    ATTRS{spramdump}=="SPRAM Dump"
    ATTRS{bussuspend}=="Bus Suspend = 0x0"
    ATTRS{hptxfsiz}=="HPTXFSIZ = 0x02000406"
    ATTRS{devspeed}=="Device Speed = 0x0"
    ATTRS{gnptxfsiz}=="GNPTXFSIZ = 0x01000306"
    ATTRS{hcd_frrem}=="HCD Dump Frame Remaining"

  looking at parent device '/devices/platform/soc':
    KERNELS=="soc"
    SUBSYSTEMS=="platform"
    DRIVERS==""
    ATTRS{driver_override}=="(null)"

  looking at parent device '/devices/platform':
    KERNELS=="platform"
    SUBSYSTEMS==""
    DRIVERS==""

La partie intéressante semble être celle-ci :

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3':
    KERNELS=="1-1.3"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{quirks}=="0x0"
    ATTRS{rx_lanes}=="1"
    ATTRS{bmAttributes}=="80"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{tx_lanes}=="1"
    ATTRS{bcdDevice}=="0200"
    ATTRS{configuration}==""
    ATTRS{bConfigurationValue}=="1"
    ATTRS{urbnum}=="13"
    ATTRS{bMaxPower}=="50mA"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="Carel S.P.A."
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{speed}=="12"
    ATTRS{removable}=="removable"
    ATTRS{devspec}=="(null)"
    ATTRS{maxchild}=="0"
    ATTRS{idVendor}=="0403"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{version}==" 1.10"
    ATTRS{devnum}=="90"
    ATTRS{authorized}=="1"
    ATTRS{bDeviceClass}=="00"
    ATTRS{busnum}=="1"
    ATTRS{devpath}=="1.3"
    ATTRS{product}=="Carel USB-RS485 Converter"
    ATTRS{idProduct}=="6001"
    ATTRS{bMaxPacketSize0}=="8"

On va donc créer une règle qui match la chaîne suivante :

SUBSYSTEMS=="usb-serial"
DRIVERS=="ftdi_sio"
# FTDI Chip ``` udevadm info /dev/ttyUSB0 P: /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/ttyUSB0/tty/ttyUSB0 N: ttyUSB0 L: 0 S: serial/by-id/usb-Carel_S.P.A._Carel_USB-RS485_Converter-if00-port0 S: serial/by-path/platform-3f980000.usb-usb-0:1.3:1.0-port0 E: DEVPATH=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/ttyUSB0/tty/ttyUSB0 E: DEVNAME=/dev/ttyUSB0 E: MAJOR=188 E: MINOR=0 E: SUBSYSTEM=tty E: USEC_INITIALIZED=656579486729 E: ID_VENDOR=Carel_S.P.A. E: ID_VENDOR_ENC=Carel\x20S.P.A. E: ID_VENDOR_ID=0403 E: ID_MODEL=Carel_USB-RS485_Converter E: ID_MODEL_ENC=Carel\x20USB-RS485\x20Converter E: ID_MODEL_ID=6001 E: ID_REVISION=0200 E: ID_SERIAL=Carel_S.P.A._Carel_USB-RS485_Converter E: ID_TYPE=generic E: ID_BUS=usb E: ID_USB_INTERFACES=:ffffff: E: ID_USB_INTERFACE_NUM=00 E: ID_USB_DRIVER=ftdi_sio E: ID_VENDOR_FROM_DATABASE=Future Technology Devices International, Ltd E: ID_MODEL_FROM_DATABASE=FT232 Serial (UART) IC E: ID_PATH=platform-3f980000.usb-usb-0:1.3:1.0 E: ID_PATH_TAG=platform-3f980000_usb-usb-0_1_3_1_0 E: DEVLINKS=/dev/serial/by-id/usb-Carel_S.P.A._Carel_USB-RS485_Converter-if00-port0 /dev/serial/by-path/platform-3f980000.usb-usb-0:1.3:1.0-port0 E: TAGS=:systemd: udevadm info -a /dev/ttyUSB0 Udevadm info starts with the device specified by the devpath and then walks up the chain of parent devices. It prints for every device found, all possible attributes in the udev rules key format. A rule to match, can be composed by the attributes of the device and the attributes from one single parent device. looking at device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/ttyUSB0/tty/ttyUSB0': KERNEL=="ttyUSB0" SUBSYSTEM=="tty" DRIVER=="" looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/ttyUSB0': KERNELS=="ttyUSB0" SUBSYSTEMS=="usb-serial" DRIVERS=="ftdi_sio" ATTRS{port_number}=="0" ATTRS{latency_timer}=="16" looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0': KERNELS=="1-1.3:1.0" SUBSYSTEMS=="usb" DRIVERS=="ftdi_sio" ATTRS{supports_autosuspend}=="1" ATTRS{authorized}=="1" ATTRS{bInterfaceClass}=="ff" ATTRS{bNumEndpoints}=="02" ATTRS{bAlternateSetting}==" 0" ATTRS{bInterfaceSubClass}=="ff" ATTRS{bInterfaceNumber}=="00" ATTRS{interface}=="Carel USB-RS485 Converter" ATTRS{bInterfaceProtocol}=="ff" looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3': KERNELS=="1-1.3" SUBSYSTEMS=="usb" DRIVERS=="usb" ATTRS{quirks}=="0x0" ATTRS{rx_lanes}=="1" ATTRS{bmAttributes}=="80" ATTRS{bDeviceProtocol}=="00" ATTRS{tx_lanes}=="1" ATTRS{bcdDevice}=="0200" ATTRS{configuration}=="" ATTRS{bConfigurationValue}=="1" ATTRS{urbnum}=="13" ATTRS{bMaxPower}=="50mA" ATTRS{bNumConfigurations}=="1" ATTRS{avoid_reset_quirk}=="0" ATTRS{ltm_capable}=="no" ATTRS{manufacturer}=="Carel S.P.A." ATTRS{bNumInterfaces}==" 1" ATTRS{speed}=="12" ATTRS{removable}=="removable" ATTRS{devspec}=="(null)" ATTRS{maxchild}=="0" ATTRS{idVendor}=="0403" ATTRS{bDeviceSubClass}=="00" ATTRS{version}==" 1.10" ATTRS{devnum}=="90" ATTRS{authorized}=="1" ATTRS{bDeviceClass}=="00" ATTRS{busnum}=="1" ATTRS{devpath}=="1.3" ATTRS{product}=="Carel USB-RS485 Converter" ATTRS{idProduct}=="6001" ATTRS{bMaxPacketSize0}=="8" looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1': KERNELS=="1-1" SUBSYSTEMS=="usb" DRIVERS=="usb" ATTRS{bcdDevice}=="0200" ATTRS{quirks}=="0x0" ATTRS{bMaxPower}=="2mA" ATTRS{version}==" 2.00" ATTRS{ltm_capable}=="no" ATTRS{authorized}=="1" ATTRS{bNumConfigurations}=="1" ATTRS{maxchild}=="5" ATTRS{bNumInterfaces}==" 1" ATTRS{urbnum}=="25718" ATTRS{bDeviceProtocol}=="00" ATTRS{rx_lanes}=="1" ATTRS{devnum}=="2" ATTRS{idProduct}=="9514" ATTRS{configuration}=="" ATTRS{removable}=="unknown" ATTRS{busnum}=="1" ATTRS{speed}=="12" ATTRS{bMaxPacketSize0}=="64" ATTRS{tx_lanes}=="1" ATTRS{bmAttributes}=="e0" ATTRS{devpath}=="1" ATTRS{bConfigurationValue}=="1" ATTRS{bDeviceSubClass}=="00" ATTRS{idVendor}=="0424" ATTRS{bDeviceClass}=="09" ATTRS{avoid_reset_quirk}=="0" looking at parent device '/devices/platform/soc/3f980000.usb/usb1': KERNELS=="usb1" SUBSYSTEMS=="usb" DRIVERS=="usb" ATTRS{bMaxPacketSize0}=="64" ATTRS{idVendor}=="1d6b" ATTRS{quirks}=="0x0" ATTRS{authorized_default}=="1" ATTRS{bDeviceClass}=="09" ATTRS{bConfigurationValue}=="1" ATTRS{manufacturer}=="Linux 5.4.51-v7+ dwc_otg_hcd" ATTRS{bmAttributes}=="e0" ATTRS{avoid_reset_quirk}=="0" ATTRS{rx_lanes}=="1" ATTRS{version}==" 2.00" ATTRS{tx_lanes}=="1" ATTRS{busnum}=="1" ATTRS{idProduct}=="0002" ATTRS{urbnum}=="36" ATTRS{bDeviceSubClass}=="00" ATTRS{bMaxPower}=="0mA" ATTRS{product}=="DWC OTG Controller" ATTRS{configuration}=="" ATTRS{removable}=="unknown" ATTRS{bDeviceProtocol}=="01" ATTRS{bNumConfigurations}=="1" ATTRS{maxchild}=="1" ATTRS{interface_authorized_default}=="1" ATTRS{speed}=="480" ATTRS{bNumInterfaces}==" 1" ATTRS{devpath}=="0" ATTRS{bcdDevice}=="0504" ATTRS{authorized}=="1" ATTRS{serial}=="3f980000.usb" ATTRS{devnum}=="1" ATTRS{ltm_capable}=="no" looking at parent device '/devices/platform/soc/3f980000.usb': KERNELS=="3f980000.usb" SUBSYSTEMS=="platform" DRIVERS=="dwc_otg" ATTRS{mode}=="Mode = 0x1" ATTRS{guid}=="GUID = 0x2708a000" ATTRS{hcddump}=="HCD Dump" ATTRS{regoffset}=="0xffffffff" ATTRS{rd_reg_test}=="Time to read GNPTXFSIZ reg 10000000 times: 1300 msecs (130 jiffies)" ATTRS{gpvndctl}=="GPVNDCTL = 0x00000000" ATTRS{regvalue}=="invalid offset" ATTRS{buspower}=="Bus Power = 0x1" ATTRS{enumspeed}=="Device Enumeration Speed = 0x1" ATTRS{wr_reg_test}=="Time to write GNPTXFSIZ reg 10000000 times: 350 msecs (35 jiffies)" ATTRS{grxfsiz}=="GRXFSIZ = 0x00000306" ATTRS{remote_wakeup}=="Remote Wakeup Sig = 0 Enabled = 0 LPM Remote Wakeup = 0" ATTRS{driver_override}=="(null)" ATTRS{ggpio}=="GGPIO = 0x00000000" ATTRS{rem_wakeup_pwrdn}=="" ATTRS{gusbcfg}=="GUSBCFG = 0x20001700" ATTRS{hsic_connect}=="HSIC Connect = 0x1" ATTRS{regdump}=="Register Dump" ATTRS{inv_sel_hsic}=="Invert Select HSIC = 0x0" ATTRS{srpcapable}=="SRPCapable = 0x1" ATTRS{fr_interval}=="Frame Interval = 0xea5f" ATTRS{busconnected}=="Bus Connected = 0x1" ATTRS{gotgctl}=="GOTGCTL = 0x001c0001" ATTRS{mode_ch_tim_en}=="Mode Change Ready Timer Enable = 0x0" ATTRS{gsnpsid}=="GSNPSID = 0x4f54280a" ATTRS{hnpcapable}=="HNPCapable = 0x1" ATTRS{srp}=="SesReqScs = 0x1" ATTRS{hnp}=="HstNegScs = 0x0" ATTRS{hprt0}=="HPRT0 = 0x00021405" ATTRS{spramdump}=="SPRAM Dump" ATTRS{bussuspend}=="Bus Suspend = 0x0" ATTRS{hptxfsiz}=="HPTXFSIZ = 0x02000406" ATTRS{devspeed}=="Device Speed = 0x0" ATTRS{gnptxfsiz}=="GNPTXFSIZ = 0x01000306" ATTRS{hcd_frrem}=="HCD Dump Frame Remaining" looking at parent device '/devices/platform/soc': KERNELS=="soc" SUBSYSTEMS=="platform" DRIVERS=="" ATTRS{driver_override}=="(null)" looking at parent device '/devices/platform': KERNELS=="platform" SUBSYSTEMS=="" DRIVERS=="" ``` La partie intéressante semble être celle-ci : ``` looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3': KERNELS=="1-1.3" SUBSYSTEMS=="usb" DRIVERS=="usb" ATTRS{quirks}=="0x0" ATTRS{rx_lanes}=="1" ATTRS{bmAttributes}=="80" ATTRS{bDeviceProtocol}=="00" ATTRS{tx_lanes}=="1" ATTRS{bcdDevice}=="0200" ATTRS{configuration}=="" ATTRS{bConfigurationValue}=="1" ATTRS{urbnum}=="13" ATTRS{bMaxPower}=="50mA" ATTRS{bNumConfigurations}=="1" ATTRS{avoid_reset_quirk}=="0" ATTRS{ltm_capable}=="no" ATTRS{manufacturer}=="Carel S.P.A." ATTRS{bNumInterfaces}==" 1" ATTRS{speed}=="12" ATTRS{removable}=="removable" ATTRS{devspec}=="(null)" ATTRS{maxchild}=="0" ATTRS{idVendor}=="0403" ATTRS{bDeviceSubClass}=="00" ATTRS{version}==" 1.10" ATTRS{devnum}=="90" ATTRS{authorized}=="1" ATTRS{bDeviceClass}=="00" ATTRS{busnum}=="1" ATTRS{devpath}=="1.3" ATTRS{product}=="Carel USB-RS485 Converter" ATTRS{idProduct}=="6001" ATTRS{bMaxPacketSize0}=="8" ``` On va donc créer une règle qui match la chaîne suivante : ``` SUBSYSTEMS=="usb-serial" DRIVERS=="ftdi_sio" ```
maxime-alves прокомментировал 4 лет назад
Соавтор

Commande pour “re-plug” le port usb sans avoir à le faire à la main (FTDI) :

modprobe -r ftdi_sio usbserial
modprobe ftdi_sio
Commande pour "re-plug" le port usb sans avoir à le faire à la main (FTDI) : ``` modprobe -r ftdi_sio usbserial modprobe ftdi_sio ```
maxime-alves прокомментировал 4 лет назад
Соавтор

Règle udev pour link vers /dev/rs485

Fichier : /etc/udev/rules.d/42-rs485.rules

SUBSYSTEMS=="usb-serial", DRIVERS=="ftdi_sio", SYMLINK+="rs485"

Recharger les règles udev :

udevadm control --reload
udevadm trigger

Test :

[ -e "/dev/rs485" ] && echo "Device adaptateur 
USB/RS485 : /dev/rs485"
Règle udev pour link vers /dev/rs485 Fichier : /etc/udev/rules.d/42-rs485.rules ``` SUBSYSTEMS=="usb-serial", DRIVERS=="ftdi_sio", SYMLINK+="rs485" ``` Recharger les règles udev : ``` udevadm control --reload udevadm trigger ``` Test : ``` [ -e "/dev/rs485" ] && echo "Device adaptateur USB/RS485 : /dev/rs485" ```
maxime-alves убрал(а) метку
prioritaire
4 лет назад
maxime-alves упомянул эту задачу в коммите 4 лет назад
nas самоназначился 4 лет назад
nas прокомментировал 4 лет назад
Владелец

À testé et à déployer sur mon banc de test

À testé et à déployer sur mon banc de test
nas прокомментировал 4 лет назад
Владелец

Pour les archives, port série non carel :

$ udevadm info /dev/ttyUSB0

P: /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/ttyUSB0/tty/ttyUSB0
N: ttyUSB0
L: 0
S: serial/by-id/usb-1a86_USB2.0-Serial-if00-port0
S: serial/by-path/platform-3f980000.usb-usb-0:1.3:1.0-port0
E: DEVPATH=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/ttyUSB0/tty/ttyUSB0
E: DEVNAME=/dev/ttyUSB0
E: MAJOR=188
E: MINOR=0
E: SUBSYSTEM=tty
E: USEC_INITIALIZED=11993976
E: ID_VENDOR=1a86
E: ID_VENDOR_ENC=1a86
E: ID_VENDOR_ID=1a86
E: ID_MODEL=USB2.0-Serial
E: ID_MODEL_ENC=USB2.0-Serial
E: ID_MODEL_ID=7523
E: ID_REVISION=0254
E: ID_SERIAL=1a86_USB2.0-Serial
E: ID_TYPE=generic
E: ID_BUS=usb
E: ID_USB_INTERFACES=:ff0102:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=ch341
E: ID_USB_CLASS_FROM_DATABASE=Vendor Specific Class
E: ID_VENDOR_FROM_DATABASE=QinHeng Electronics
E: ID_MODEL_FROM_DATABASE=HL-340 USB-Serial adapter
E: ID_PATH=platform-3f980000.usb-usb-0:1.3:1.0
E: ID_PATH_TAG=platform-3f980000_usb-usb-0_1_3_1_0
E: DEVLINKS=/dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0 /dev/serial/by-path/platform-3f980000.usb-usb-0:1.3:1.0-port0
E: TAGS=:systemd:
Pour les archives, port série non carel : ``` $ udevadm info /dev/ttyUSB0 P: /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/ttyUSB0/tty/ttyUSB0 N: ttyUSB0 L: 0 S: serial/by-id/usb-1a86_USB2.0-Serial-if00-port0 S: serial/by-path/platform-3f980000.usb-usb-0:1.3:1.0-port0 E: DEVPATH=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/ttyUSB0/tty/ttyUSB0 E: DEVNAME=/dev/ttyUSB0 E: MAJOR=188 E: MINOR=0 E: SUBSYSTEM=tty E: USEC_INITIALIZED=11993976 E: ID_VENDOR=1a86 E: ID_VENDOR_ENC=1a86 E: ID_VENDOR_ID=1a86 E: ID_MODEL=USB2.0-Serial E: ID_MODEL_ENC=USB2.0-Serial E: ID_MODEL_ID=7523 E: ID_REVISION=0254 E: ID_SERIAL=1a86_USB2.0-Serial E: ID_TYPE=generic E: ID_BUS=usb E: ID_USB_INTERFACES=:ff0102: E: ID_USB_INTERFACE_NUM=00 E: ID_USB_DRIVER=ch341 E: ID_USB_CLASS_FROM_DATABASE=Vendor Specific Class E: ID_VENDOR_FROM_DATABASE=QinHeng Electronics E: ID_MODEL_FROM_DATABASE=HL-340 USB-Serial adapter E: ID_PATH=platform-3f980000.usb-usb-0:1.3:1.0 E: ID_PATH_TAG=platform-3f980000_usb-usb-0_1_3_1_0 E: DEVLINKS=/dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0 /dev/serial/by-path/platform-3f980000.usb-usb-0:1.3:1.0-port0 E: TAGS=:systemd: ```
nas прокомментировал 4 лет назад
Владелец

Sur le raccord usb non carel :

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/ttyUSB0':
    KERNELS=="ttyUSB0"
    SUBSYSTEMS=="usb-serial"
    DRIVERS=="ch341-uart"
    ATTRS{port_number}=="0"

Il faudra bien une règle UDEV défférente

Sur le raccord usb non carel : ``` looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/ttyUSB0': KERNELS=="ttyUSB0" SUBSYSTEMS=="usb-serial" DRIVERS=="ch341-uart" ATTRS{port_number}=="0" ``` Il faudra bien une règle UDEV défférente
nas прокомментировал 4 лет назад
Владелец

Comme indiqué, la règle udev :

/etc/udev/rules.d/42-rs485.rules

SUBSYSTEMS=="usb-serial", DRIVERS=="ch341-uart", SYMLINK+="rs485"

Comme indiqué, la règle udev : /etc/udev/rules.d/42-rs485.rules ``` SUBSYSTEMS=="usb-serial", DRIVERS=="ch341-uart", SYMLINK+="rs485" ```
nas упомянул эту задачу в коммите 4 лет назад
nas прокомментировал 4 лет назад
Владелец

Sur le banc de test :

$ ls -l
rs485 -> ttyUSB0

La modification est effective

Sur le banc de test : ``` $ ls -l rs485 -> ttyUSB0 ``` La modification est effective
maxime-alves прокомментировал 4 лет назад
Соавтор

Il semble que le problème vienne de l’alimentation, il suffit d’alimenter la machine connectée par une alimentation d’origine raspberry pi.

Il semble que le problème vienne de l'alimentation, il suffit d'alimenter la machine connectée par une alimentation d'origine raspberry pi.
Войдите, чтобы присоединиться к обсуждению.
Нет этапа
Нет назначенных лиц
2 участников
Срок выполнения

Срок выполнения не установлен.

Зависимости

В настоящее время эта задача не имеет зависимостей.

Загрузка…
Отмена
Сохранить
Пока нет содержимого.