darrylb123 / usbrelay

Control usb relay - based on hidapi
GNU General Public License v2.0
315 stars 98 forks source link

usbrelay in proxmox lxc container "unable to open device" #89

Closed malu-reflact-ag closed 2 years ago

malu-reflact-ag commented 2 years ago

hi, maybe anyone has a clue, i am running ubuntu 22 in a LXC container but i can't control the relays here some detail: `root@ioBroker:~# lsusb Bus 001 Device 009: ID 16c0:05df Van Ooijen Technische Informatica HID device except mice, keyboards, and joysticks ...

root@ioBroker:~# lsusb -v -d 16c0:05df

Bus 001 Device 009: ID 16c0:05df Van Ooijen Technische Informatica HID device except mice, keyboards, and joysticks Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x16c0 Van Ooijen Technische Informatica idProduct 0x05df HID device except mice, keyboards, and joysticks bcdDevice 1.00 iManufacturer 1 www.dcttech.com iProduct 2 USBRelay2 iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x0022 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 20mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.01 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 22 Report Descriptors: UNAVAILABLE Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0008 1x 8 bytes bInterval 20 Device Status: 0x0000 (Bus Powered)`

but when i try to control the relais i does not work. i tryed with without sudo, i am not shure if i do something wrong. or maybe it does not work within containers. Any clue? ` root@ioBroker:~# usbrelay Device Found type: 16c0 05df path: /dev/hidraw0 serial_number: Manufacturer: www.dcttech.com Product: USBRelay2 Release: 100 Interface: 0 Number of Relays = 2 unable to open device

root@ioBroker:~# sudo usbrelay Device Found type: 16c0 05df path: /dev/hidraw0 serial_number: Manufacturer: www.dcttech.com Product: USBRelay2 Release: 100 Interface: 0 Number of Relays = 2 unable to open device `

wentasah commented 2 years ago

If you have usbrelay from the official Ubuntu package, you have very old version. Next Ubuntu release will have an up-to-date version, which should work. You can try using the new package from Ubuntu Kinetic. If you're on a PC, download it here and install with dpkg -i usbrelay...deb.

If it cannot be installed from the package, download the source code from this repo and compile it (run make).