Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connect usb scale in Ubuntu, cdc_acm says failed to set dtr/trs

I am trying to connect an scale (Dibal series 400) in Linux (Ubuntu), and I can not succeed. The scale works on Windows after installing a driver to enable a Virtual Com Port, but when I plug in the scale in Linux, it tries to start, but after a while the scale is power down.

The sys log messages says:

kernel: [ 3202.896355] usb 1-2: new full-speed USB device number 8 using xhci_hcd
kernel: [ 3203.038395] usb 1-2: New USB device found, idVendor=0483, idProduct=5740
kernel: [ 3203.038400] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
kernel: [ 3203.038403] usb 1-2: Product: Dibal G Series
kernel: [ 3203.038405] usb 1-2: Manufacturer: DIBAL S.A
kernel: [ 3203.038407] usb 1-2: SerialNumber: 00000000001A
kernel: [ 3203.039349] cdc_acm 1-2:1.0: ttyACM0: USB ACM device
mtp-probe: checking bus 1, device 8: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2"
mtp-probe: bus: 1, device: 8 was not an MTP device
kernel: [ 3203.081110] [UFW BLOCK] IN=wlp2s0 OUT= MAC= SRC=fe80:0000:0000:0000:8bb6:c943:d1eb:b07f DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=64 TC=0 HOPLIMIT=1 FLOWLBL=400724 PROTO=UDP SPT=8612 DPT=8612 LEN=24 
kernel: [ 3203.081125] [UFW BLOCK] IN=wlp2s0 OUT= MAC= SRC=fe80:0000:0000:0000:8bb6:c943:d1eb:b07f DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=64 TC=0 HOPLIMIT=1 FLOWLBL=123875 PROTO=UDP SPT=8612 DPT=8610 LEN=24 
kernel: [ 3203.091404] [UFW BLOCK] IN=wlp2s0 OUT= MAC= SRC=fe80:0000:0000:0000:8bb6:c943:d1eb:b07f DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=64 TC=0 HOPLIMIT=1 FLOWLBL=400724 PROTO=UDP SPT=8612 DPT=8612 LEN=24 
kernel: [ 3203.091423] [UFW BLOCK] IN=wlp2s0 OUT= MAC= SRC=fe80:0000:0000:0000:8bb6:c943:d1eb:b07f DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=64 TC=0 HOPLIMIT=1 FLOWLBL=123875 PROTO=UDP SPT=8612 DPT=8610 LEN=24 
kernel: [ 3207.543042] usb 1-2: USB disconnect, device number 8
kernel: [ 3207.543169] cdc_acm 1-2:1.0: failed to set dtr/rts
ModemManager[1005]: <warn>  (ttyACM0) could not open serial device (2)
ModemManager[1005]: <warn>  (Plugin Manager) (Nokia) [ttyACM0] error when checking support: '(tty/ttyACM0) failed to open port: Could not open serial device ttyACM0: No such file or directory'
ModemManager[1005]: <warn>  (ttyACM0) could not open serial device (2)
ModemManager[1005]: <warn>  (Plugin Manager) (Iridium) [ttyACM0] error when checking support: '(tty/ttyACM0) failed to open port: Could not open serial device ttyACM0: No such file or directory'
ModemManager[1005]: <warn>  (ttyACM0) could not open serial device (2)
ModemManager[1005]: <warn>  (Plugin Manager) (Cinterion) [ttyACM0] error when checking support: '(tty/ttyACM0) failed to open port: Could not open serial device ttyACM0: No such file or directory'
ModemManager[1005]: <warn>  (ttyACM0) could not open serial device (2)
ModemManager[1005]: <warn>  (Plugin Manager) (Generic) [ttyACM0] error when checking support: '(tty/ttyACM0) failed to open port: Could not open serial device ttyACM0: No such file or directory'
ModemManager[1005]: <info>  Couldn't find support for device at '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2': not supported by any plugin

As additional information, in Windows it is recognized as:

STMicroelectronics Virtual COM Port (COM3) And it has the next configuration: Baudrate: 9600 Parity: None

While the scale is starting (the 3 or 4 secs that keeps running), I have tested:

udevadm test /sys/devices/pci0000:00/0000:00:14.0/usb1/1-1

ACTION=add
BUSNUM=001
DEVNAME=/dev/bus/usb/001/036
DEVNUM=036
DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-1
DEVTYPE=usb_device
DRIVER=usb
ID_BUS=usb
ID_MODEL=Dibal_G_Series
ID_MODEL_ENC=Dibal\x20G\x20Series
ID_MODEL_FROM_DATABASE=STM32F407
ID_MODEL_ID=5740
ID_REVISION=0200
ID_SERIAL=DIBAL_S.A_Dibal_G_Series_00000000001A
ID_SERIAL_SHORT=00000000001A
ID_USB_INTERFACES=:020201:0a0000:
ID_VENDOR=DIBAL_S.A
ID_VENDOR_ENC=DIBAL\x20S.A
ID_VENDOR_FROM_DATABASE=STMicroelectronics
ID_VENDOR_ID=0483
MAJOR=189
MINOR=35
PRODUCT=483/5740/200
SUBSYSTEM=usb
TYPE=0/0/0
USEC_INITIALIZED=9445077321
Unload module index
Unloaded link configuration context.

Could anyone help me?

Thank you very much, Javi.

like image 678
bracana Avatar asked Nov 24 '17 21:11

bracana


1 Answers

Finally I have solved the issue:

Thanks to that link:

https://github.com/dhylands/usb-ser-mon/blob/master/usb_ser_mon/mk-udev-rules-stm32.sh

Create an script with this and execute it.

#!/bin/sh
sudo sh -c 'cat > /etc/udev/rules.d/49-stm32.rules' <<EOF
# 0483:5740 - STM32F4 Dsicovery in USB Serial Mode (CN5)
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", 
ENV{ID_MM_DEVICE_IGNORE}="1"
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", 
ENV{MTP_NO_PROBE}="1"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", 
MODE:="0666"
KERNEL=="ttyACM*", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", 
MODE:="0666"
# 0483:df11 - STM32F4 Discovery in DFU mode (CN5)
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", 
MODE:="0666"
EOF

sudo udevadm control --reload-rules
like image 80
bracana Avatar answered Nov 11 '22 20:11

bracana