-
Notifications
You must be signed in to change notification settings - Fork 99
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
How to use in script if two one channel usb relay with same ID #18
Comments
Well that's a problem. I can't think of any way to discriminate other than
buying another. They should have unique id.
Try having the supplier replace it.
…On Fri., 26 Jan. 2018, 2:27 am combat007, ***@***.***> wrote:
Your program works great on one channel relay
But I am stuck with the problem that I have two 1 channel relays attached
to two usb ports of my laptop.
Following is the output of the command ./usbrelay
Device Found
type: 16c0 05df
path: /dev/hidraw2
serial_number:
Manufacturer: www.dcttech.com
Product: USBRelay1
Release: 100
Interface: 0
Number of Relays = 1
959BI_1=0
Device Found
type: 16c0 05df
path: /dev/hidraw0
serial_number:
Manufacturer: www.dcttech.com
Product: USBRelay1
Release: 100
Interface: 0
Number of Relays = 1
959BI_1=0
When I provide the command "./usbrelay 959BI_1=1" it works on both the
relays simultaneously, but I want that only one must work at a time. Wht
both channels device showing same ID?
How can I differentiate between those two relay channel in the command
./usbrelay
??
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#18>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGcqVdAMpYSqdu45JQgSXgbDpjdnxmdfks5tOKt1gaJpZM4RtHia>
.
|
ID is provided as a parameter to ./usbrelay. Can't we provide the device path instead?? |
well I followed this link and got the solution then I wrote the script "mycmd" ---------Bash Script start here -------if [ $1 == "small" ] if [ $1 == "big" ] ---------Bash Script end here -------Now this helped me out to start two machines one by one the rest of the job was done by your utility and it worked like a charm. Regards |
Thanks. It really should not be necessary. The ID should be unique.
I'd be careful as the USB bus instantiates the device addresses non
predictably. Try a few power cycled to make sure the devices come up as
expected.
…On Sat, 27 Jan 2018, 05:32 combat007 ***@***.***> wrote:
well I followed this link and got the solution
https://www.quora.com/How-do-I-enable-and-disable-USB-port-using-terminal-in-Ubuntu
then I wrote the script "mycmd"
---------Bash Script start here -------
if [ $1 == "small" ]
then
echo '2-1' | tee /sys/bus/usb/drivers/usb/unbind
./usbrelay 959BI_1=1;./usbrelay 959BI_1=0
echo '2-1' | tee /sys/bus/usb/drivers/usb/bind
fi
if [ $1 == "big" ]
then
echo '2-3' | tee /sys/bus/usb/drivers/usb/unbind
./usbrelay 959BI_1=1;./usbrelay 959BI_1=0
echo '2-3' | tee /sys/bus/usb/drivers/usb/bind
fi
---------Bash Script end here -------
Now this helped me out to start two machines one by one
./mycmd small
./mycmd big
the rest of the job was done by your utility and it worked like a charm.
Kindly share this solution to those who are seeking it like I was.
Regards
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGcqVWpf2FxzMKt8jamJXPlksqJHRa_xks5tOhpEgaJpZM4RtHia>
.
|
I'm having the same problem -- except I can't use the solution that combat007 provides. I can't turn any of them off as I have to potentially trigger channels simulataneously... Would it be possible to somehow provide device path + ID to the usbrelay command? I currently have 3 boards and they are all given the same buf IDs (6QMBS_1 - 6QMBS_8). I feel it is highly unlikely that getting a replacement will enumerate unique IDs, but if it really is the only chance I guess i'll try! |
Well that's very slack of the vendors. The trouble with device ID is that
it will depend how the USB devices are enumerated could result in
unpredictable device IDs. Not a good situation when connected to real
equipment.
I will have a look at it.
…On Thu., 15 Mar. 2018, 7:23 am danbayona, ***@***.***> wrote:
I'm having the same problem -- except I can't use the solution that
combat007 provides. I can't turn any of them off as I have to potentially
trigger channels simulataneously... Would it be possible to somehow provide
device path + ID to the usbrelay command?
I currently have 3 boards and they are all given the same buf IDs (6QMBS_1
- 6QMBS_8). I feel it is highly unlikely that getting a replacement will
enumerate unique IDs, but if it really is the only chance I guess i'll try!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGcqVXsC2IeTSoaxZoOtK15_KjhWsa-Fks5teYpVgaJpZM4RtHia>
.
|
Would it change anything if I use udev rules so that the USB relay devices are enumerated statically? I currently set rules for other USB devices so they can be referred to by a non-dynamic path. PS. Thanks for your time and your timely responses I rly appreciate it! |
That would probably work.
…On Thu., 15 Mar. 2018, 8:03 am danbayona, ***@***.***> wrote:
Would it change anything if I use udev rules so that the USB relay devices
are enumerated statically? I currently set rules for other USB devices so
they can be referred to by a non-dynamic path.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGcqVZfKwtD7tzj32SaCPz0XSW07iKmKks5teZOkgaJpZM4RtHia>
.
|
The problem is -- even with different /dev/ paths the channel ID's are still identical. Am I missing something? When you refer to 'device ID' do you mean the ID '16c0:05df'? |
that's the problem. The manufacturer isn't randomising the HID ID and the
device type is fixed. The only way of doing it is to point to the USB port.
Should at least complain to the vendor about randomising the HID ID. Their
software won't work either.
…On Thu, Mar 15, 2018 at 8:32 AM danbayona ***@***.***> wrote:
The problem is -- even with different /dev/ paths the channel ID's are
still identical. Am I missing something? When you refer to 'device ID' do
you mean the ID '16c0:05df'?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGcqVTuVBnQuCx9c8uUvgX1th2Ky20lOks5teZphgaJpZM4RtHia>
.
|
Found the author of replacement firmware for the board. It is possible to
change the serial. I'll look at the windows code to see if it can do it.
Otherwise, I'll see if I can add the functionality to usbrelay.
…On Thu., 15 Mar. 2018, 12:15 pm Darryl Bond, ***@***.***> wrote:
that's the problem. The manufacturer isn't randomising the HID ID and the
device type is fixed. The only way of doing it is to point to the USB port.
Should at least complain to the vendor about randomising the HID ID. Their
software won't work either.
On Thu, Mar 15, 2018 at 8:32 AM danbayona ***@***.***>
wrote:
> The problem is -- even with different /dev/ paths the channel ID's are
> still identical. Am I missing something? When you refer to 'device ID' do
> you mean the ID '16c0:05df'?
>
> —
> You are receiving this because you commented.
>
>
> Reply to this email directly, view it on GitHub
> <#18 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AGcqVTuVBnQuCx9c8uUvgX1th2Ky20lOks5teZphgaJpZM4RtHia>
> .
>
|
Wow thank you so much for your efforts! fyi I am running this on linux Ubuntu 16.04 |
Hold your thanks until I get it to work :)
…On Fri, 16 Mar 2018, 08:25 danbayona ***@***.***> wrote:
Wow thank you so much for your efforts! fyi I am running this on linux
Ubuntu 16.04
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGcqVd7AiB6JReMUCmf1BHTVoAokFRXVks5teupjgaJpZM4RtHia>
.
|
Ok, please test the new version. I have added the capability to change the serial. I have updated the documentation to show how to do it. |
Can you test my changes. I have updated the doco to show how to change the
serial. You will need to pull the latest version and recompile.
…On Fri, Mar 16, 2018 at 12:12 PM Darryl Bond ***@***.***> wrote:
Hold your thanks until I get it to work :)
On Fri, 16 Mar 2018, 08:25 danbayona ***@***.***> wrote:
> Wow thank you so much for your efforts! fyi I am running this on linux
> Ubuntu 16.04
>
> —
> You are receiving this because you commented.
>
>
> Reply to this email directly, view it on GitHub
> <#18 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AGcqVd7AiB6JReMUCmf1BHTVoAokFRXVks5teupjgaJpZM4RtHia>
> .
>
|
My apologies! I was on travelling/on vacation until today. Will give it a test run today and let you know.
Sent via the Samsung Galaxy Note5, an AT&T 4G LTE smartphone
-------- Original message --------From: Darryl Bond <[email protected]> Date: 3/21/18 2:47 AM (GMT-08:00) To: darrylb123/usbrelay <[email protected]> Cc: danbayona <[email protected]>, Comment <[email protected]> Subject: Re: [darrylb123/usbrelay] How to use in script if two one channel usb
relay with same ID (#18)
Can you test my changes. I have updated the doco to show how to change the
serial. You will need to pull the latest version and recompile.
On Fri, Mar 16, 2018 at 12:12 PM Darryl Bond ***@***.***> wrote:
Hold your thanks until I get it to work :)
On Fri, 16 Mar 2018, 08:25 danbayona ***@***.***> wrote:
> Wow thank you so much for your efforts! fyi I am running this on linux
> Ubuntu 16.04
>
> —
> You are receiving this because you commented.
>
>
> Reply to this email directly, view it on GitHub
> <#18 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AGcqVd7AiB6JReMUCmf1BHTVoAokFRXVks5teupjgaJpZM4RtHia>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/darrylb123/usbrelay","title":"darrylb123/usbrelay","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/darrylb123/usbrelay"}},"updates":{"snippets":[{"icon":"PERSON","message":"@darrylb123 in #18: Can you test my changes. I have updated the doco to show how to change the\nserial. You will need to pull the latest version and recompile.\n\nOn Fri, Mar 16, 2018 at 12:12 PM Darryl Bond \[email protected]\u003e wrote:\n\n\u003e Hold your thanks until I get it to work :)\n\u003e\n\u003e On Fri, 16 Mar 2018, 08:25 danbayona \[email protected]\u003e wrote:\n\u003e\n\u003e\u003e Wow thank you so much for your efforts! fyi I am running this on linux\n\u003e\u003e Ubuntu 16.04\n\u003e\u003e\n\u003e\u003e —\n\u003e\u003e You are receiving this because you commented.\n\u003e\u003e\n\u003e\u003e\n\u003e\u003e Reply to this email directly, view it on GitHub\n\u003e\u003e \u003chttps://github.com/darrylb123/usbrelay/issues/18#issuecomment-373542417\u003e,\n\u003e\u003e or mute the thread\n\u003e\u003e \u003chttps://github.com/notifications/unsubscribe-auth/AGcqVd7AiB6JReMUCmf1BHTVoAokFRXVks5teupjgaJpZM4RtHia\u003e\n\u003e\u003e .\n\u003e\u003e\n\u003e\n"}],"action":{"name":"View Issue","url":"#18 (comment)"}}}
|
Hey! The IDs for each channel are now able to be enumerated uniquely and will work for my purposes, thank you so much for your time! |
Tested by danbayona, tested by myself on 2 way and 8 way relay. $ ./usbrelay 86UXU_0=86UXV $ ./usbrelay 86UXV_0=86UXU |
Hi, I was working with Dan on the issue above. I built your new changes using Docker so I didn't have to install any dependencies locally. Would you be interested in adding the Dockerfile, a build script and an updated Readme to the project? I have branch ready to push. This way, anyone can build from source once they install Docker and not have to fuss with setting up their host machine. Thanks for the help! |
Sure
…On Sun., 25 Mar. 2018, 10:33 am ImXron, ***@***.***> wrote:
Hi,
I was working with Dan on the issue above. I built your new changes using
Docker so I didn't have to install any dependencies locally. Would you be
interested in adding the Dockerfile, a build script and an updated Readme
to the project? I have branch ready to push. This way, anyone can build
from source once they install Docker.
Thanks for the help!
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGcqVSksEXQc7j28xm-HMCWDeXY8h1hgks5thuXygaJpZM4RtHia>
.
|
Your program works great on one channel relay
But I am stuck with the problem that I have two 1 channel relays attached to two usb ports of my laptop.
Following is the output of the command ./usbrelay
Device Found
type: 16c0 05df
path: /dev/hidraw2
serial_number:
Manufacturer: www.dcttech.com
Product: USBRelay1
Release: 100
Interface: 0
Number of Relays = 1
959BI_1=0
Device Found
type: 16c0 05df
path: /dev/hidraw0
serial_number:
Manufacturer: www.dcttech.com
Product: USBRelay1
Release: 100
Interface: 0
Number of Relays = 1
959BI_1=0
When I provide the command "./usbrelay 959BI_1=1" it works on both the relays simultaneously, but I want that only one must work at a time. Why both channels device showing same ID?
How can I differentiate between those two relay channel in the command
./usbrelay
??
The text was updated successfully, but these errors were encountered: