Skip to content
Pavel A edited this page Mar 8, 2016 · 2 revisions

Command-line utility

The utility supports multiple 1-, 2- 4- or 8-relays USB boards.

Usage and examples: see the readme file in the "commandline" project.

It works on Windows (XP and up, 32 and 64-bit), Linux (via libusb 0.1), Apple OS X 10.9+.

Note: I do not have 4 and 8-relays devices, so these not tested yet.

On Windows and OS X it uses the built-in HID support, there are no other run time dependencies at all, and no admin rights needed.

On Linux: to allow non-root users access to the devices, tweaking of udev scripts may be needed.

On Linux or other platforms that use libusb, the libusb dynamic library must be installed (currently v.0.1; the newer 1.x packages usually install the 0.1 lib as well).

Unless the software is built statically, the C runtime libraries (libc or Visual C++ runtime) must be installed.

Dynamic Library for C/C++

The library, usb_relay_device.dll, is a reproduction of the Windows DLL provided by E-Bay merchants.
The interface .h file is lib/usb_relay_device.h

On Mac OS X the name of the library is usb_relay_device.dylib, on Linux - usb_relay_device.so.

Library reference: see doc/Readme_USB-Relay-DLL.md

Python interface for the dynamic library:

  • test2m.py - simple test for 1- and 2-relay devices: enumerate, switch on/off ...

This test uses the CTYPES Python library for dynamically loading the library. It does not define any extra layers, classes etc.

We tested it with CPython 2.7 and 3.x on Windows and OS X 10.10.

The file test2m.py is in Releases.

WARNING

WE DO NOT TAKE RESPONSIBILITY FOR ANY DAMAGE. Use the software on your own risk.

Hardware-&-electrical-notes