Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ILENIMARIUS opened this issue Oct 31, 2019 · 1 comment

Comments

@ILENIMARIUS
Copy link

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!

@jaketeater
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants