Very-Simple-USB-Relay icon indicating copy to clipboard operation
Very-Simple-USB-Relay copied to clipboard

Using 2 identical modules with 2 relays (like in image) into the same Ubuntu system

Open ILENIMARIUS opened this issue 5 years ago • 1 comments

There is no serial number when i run the usb linux command.

We have to add a device attribute (ATTR) like serial number or something unique for each device in to /etc/udev/rules.d/50-dct-tech-usb-relay-2.rules.

EX: SUBSYSTEM=="usb", ATTR{idVendor}=="16c0",ATTR{idProduct}=="05df", MODE="0666" KERNEL=="hidraw*", ATTRS{busnum}=="1", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05df", MODE="0666"

For arduino or other usb connected devices the best options is to run a linux command "_udevadm_xxx etc to check all the attributes of a usb device" and add the attribute to the ubuntu dev rules.

How can i solve this problem with the identical modules? TX!

ILENIMARIUS avatar Oct 31 '19 12:10 ILENIMARIUS

That's a good question.

As is, the software can't do this.

However, you may be able to use the output from the shell command udevadm info -q path -n /dev/hidraw0. This gives you info about the USB port the device is plugged in to.

You will need to change the index of the device to match what your setup. ex: /dev/hidraw1 or /dev/hidraw2

The different paths should be constant and will allow you to differentiate between the devices.

jaketeater avatar Nov 01 '19 13:11 jaketeater