USB relay commands
Asked Answered
I

2

4

I have this USB Relay: http://www.ebay.com/itm/5V-USB-Relay-2-Channel-Programmable-Computer-Control-For-Smart-Home-/141097843081?pt=LH_DefaultDomain_0&hash=item20da163989 Al I need is to send close/open to the device (to turn on & off an LED light)

How can I do that using C# or C++?

Thanks Boaz

Ischium answered 26/3, 2014 at 16:27 Comment(2)
According to the info on the eBay listing they supply a library that you can use with C/C++.Oz
You can use libusbrelaymodule from github.com/nkh-lab/usb-relay-module or setrelay CLI app from this project as well. This project supports both Linux and Windows.Misappropriate
S
2

Here's what you need (tested on Linux) :

Use it like :

  • usbrelay ZG4HU_1=1
  • usbrelay ZG4HU_1=0

to switch the first relay on and off. ZG4HU_2 addresses the second relay and without arguments you even get the relay status.

-- Hans

Sukkoth answered 2/6, 2014 at 19:45 Comment(1)
A couple more comments because I've been playing with it today: (1) I think the ID (ZG4HU in post above) is specific to your device. (2) The HIDAPI library is in the package libhidapi-dev on Ubuntu.Occasionally
A
-2

The 26484 26483.rar is what I needed for Windows. .exe files for graphic and for command line for testing and .dll for my own development. Found here: http://files.elektroda.net/794975,26484++26483+usbrelayextlib.html

Avesta answered 24/1, 2017 at 16:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.