2

I'm connecting a Legrand Keor SP UPS device via USB to my Debian linux. The problem is that /dev/ttyUSB0 is not created therefore I cannot communicate with the device.

After connecting I can see it added in lsusb:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 005: ID 1cb0:0032                                  <<— THIS ONE
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0627:0001 Adomax Technology Co., Ltd
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

I can see the related dmesg messages:

[Jul19 12:03] usb 3-1: new low-speed USB device number 5 using uhci_hcd
[  +0.201170] usb 3-1: New USB device found, idVendor=1cb0, idProduct=0032, bcdDevice= 0.02
[  +0.000002] usb 3-1: New USB device strings: Mfr=3, Product=1, SerialNumber=5
[  +0.000001] usb 3-1: Product: Legrand UPS
[  +0.000000] usb 3-1: Manufacturer: Legrand
[  +0.183988] hid-generic 0003:1CB0:0032.0005: hiddev0,hidraw1: USB HID v1.11 Device [Legrand   Legrand UPS  ] on usb-0000:00:1d.0-1/input0

I can see the related udev messages:

UDEV  [1188.303843] add      /devices/pci0000:00/0000:00:1d.0/usb3/3-1 (usb)
UDEV  [1188.304636] add      /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0 (usb)
UDEV  [1188.305475] add      /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/0003:1CB0:0032.0005 (hid)
UDEV  [1188.306728] add      /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/0003:1CB0:0032.0005/hidraw/hidraw1 (hidraw)
UDEV  [1188.307283] add      /class/usbmisc (class)
UDEV  [1188.307957] bind     /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/0003:1CB0:0032.0005 (hid)
UDEV  [1188.308732] add      /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/usbmisc/hiddev0 (usbmisc)
UDEV  [1188.309241] bind     /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0 (usb)
UDEV  [1188.310003] bind     /devices/pci0000:00/0000:00:1d.0/usb3/3-1 (usb)
UDEV  [1191.140181] remove   /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/usbmisc/hiddev0 (usbmisc)
UDEV  [1191.140554] remove   /usbmisc (class)
UDEV  [1191.141072] remove   /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/0003:1CB0:0032.0005/hidraw/hidraw1 (hidraw)
UDEV  [1191.141419] unbind   /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/0003:1CB0:0032.0005 (hid)
UDEV  [1191.141618] remove   /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/0003:1CB0:0032.0005 (hid)
UDEV  [1191.142072] unbind   /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0 (usb)

I also tried this trick to see whether the device is mapped to another /dev node but it isn't, nothing appears in /dev unfortunately: How to allow software access to any USB devices?

A small note although I don't think it's relevant is that my Debian is running inside of a Proxmox VE. The USB port is shared entirely with the Debian VM therefore I think it should be fine:

enter image description here

The device shows up exactly the same in lsusb of the Proxmox virtualization host:

Bus 004 Device 002: ID 0bda:8153 Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 004: ID 1058:25a2 Western Digital Technologies, Inc. Elements 25A2
Bus 002 Device 005: ID 1058:1140 Western Digital Technologies, Inc. My Book Essential (WDBACW)
Bus 002 Device 003: ID 0bda:0411 Realtek Semiconductor Corp.
Bus 002 Device 002: ID 0bda:0411 Realtek Semiconductor Corp.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 8087:0a2b Intel Corp.
Bus 001 Device 003: ID 05c8:0815 Cheng Uei Precision Industry Co., Ltd (Foxlink)
Bus 001 Device 011: ID 1cb0:0032                                           <<— THIS ONE
Bus 001 Device 004: ID 0bda:5411 Realtek Semiconductor Corp.
Bus 001 Device 002: ID 0bda:5411 Realtek Semiconductor Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

UPDATE 2020-07-20:

Updating udevadm monitor -u messages to eliminate confusion about device removal. The following gets printed every time I plug in the UPS into the USB port:

UDEV  [316.998469] remove   /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/0003:1CB0:0032.0002/hidraw/hidraw1 (hidraw)
UDEV  [316.998941] remove   /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/usbmisc/hiddev0 (usbmisc)
UDEV  [316.999325] remove   /usbmisc (class)
UDEV  [317.000298] unbind   /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/0003:1CB0:0032.0002 (hid)
UDEV  [317.000534] remove   /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/0003:1CB0:0032.0002 (hid)
UDEV  [317.001022] unbind   /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0 (usb)
UDEV  [317.001219] remove   /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0 (usb)
UDEV  [317.001737] unbind   /devices/pci0000:00/0000:00:1d.0/usb3/3-1 (usb)
UDEV  [317.001902] remove   /devices/pci0000:00/0000:00:1d.0/usb3/3-1 (usb)

UPDATE 2020-07-22: New dump of dmesg when connecting the device to the host machine:

https://pastebin.com/raw/uFUUHGz6

UPDATE 2020-07-30: New dump of lsusb -v added:

https://paste.ee/p/56Lgl

16
  • One more note: the device shows up under /dev/bus/usb/003/003 in the Debian VM, I am able to cat /dev/bus/usb/003/003 but creating a symlink `ln -s /dev/bus/usb/003/003 /dev/ttyUSB0' does not help, the UPS is still not recognized by its software, therefore I think this is not the right way to go. Jul 19, 2020 at 10:31
  • Update: it behaves exactly the same (i.e. doesn't work) when connected to a second Debian box directly (without virtualization) -> I think we can rule out Proxmox causing the problem. Jul 19, 2020 at 10:39
  • 1
    The UPS might not use a serial protocol, in which case /dev/ttyUSB0 wouldn’t be needed; the device identifies as a HID device, not a serial device. Have you tried nutdrv_qx? Jul 19, 2020 at 12:03
  • @StephenKitt According to Legrand's manual it should be /dev/ttyUSBx or /dev/ttySx (ups.legrand.com/media/software/UpsComm_en.pdf). In Legrand's software you can only choose between those devices. I tried to install nut configure it with nutdrv_qx a moment ago but it says "No supported devices found. Please check your device availability with 'lsusb' …". Jul 19, 2020 at 14:09
  • 1
    @mario It is very sad but no one from Legrand was willing to help me :( I haven't been able to solve the particular issue with the driver but I did solve my core problem by buying a different UPS device and I'm very happy now. I went with a Cyberpower VP1600ELCD instead and it works like charm natively with 'nut' on Linux. No issues with the USB device whatsoever. This is the best advise I have, I'm sorry :( Mar 22, 2022 at 15:57

1 Answer 1

2

Legrand does not use ttyUSB, in upssrv settings select "USB".

I use UPS Communicator 1.32, but this has a bug for linux version and can't initialize connection to ups correctly.

Solution:

  • Stop upssrv on Debian
  • Start VM with Windows
  • Forward USB port to VM
  • Install UPS Communicator for Windows, run it and connect to ups

Now you can stop the VM and start upssrv on Debian - all will work fine until you unplug usb cabel or hard reset pc.

3
  • Wow, ths is almost embarassing from Legrand and genius from you! I can't verify this right now but I'll definitely try! Thanks! Dec 18, 2020 at 7:15
  • "..embarassing from Legrand" - that is right. Few months ago I collected pcap from usb data transfer from Debian and Windows, sent it to Legrand it-support and still I dont get any answer. Last night I have tested latest version UPS Communicator from Legrand website (1.34) - the bug still stay. Dec 18, 2020 at 16:21
  • Yes, I've contacted Legrand support in several countries months ago and still waiting for the answer. They really-really should open-source this tool, put it on GitHub and some of us would fix it. Dec 19, 2020 at 6:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .