johannes.krude.de
Projectsusb-Relay

usb-Relay

usb-Relay is a small hardware device to turn other devices on and off, using your computer. It is connected to your computer via usb.

GNU Affero General Public License usb-Relay is licensed under a GNU Affero General Public License.

Hardware

Firmware

The firmware is based on the avr-usb firmware. The avr-usb firmware implements usb completely in software. The device presents itself as a classless device. The device is controlled by vendor type commands. The protocol supports up to 256 relays. But the current implementation supports only one. There are two commandos. The device 2 host command 0 returns the number of relays on this device as one byte. In this implementation this is aways 1. The host 2 device command 1 sets the value of one relay. The upper byte of the value in the command is the relay to set, the lower byte is the desired state of the relay. This implementation knows only the relay number 0.

Software

The software includes a library some command line tools and a small gui. The software depends on libusb.

All parts except the included library use the included library to communicate with the device. If you want to integrate usb-Relay into your own software, The included library is all you need.

There are two command line utilities for usb-Relay. “count” returns the number of relays on the device. “set” set’s the status of one relay.

The small gui allows the user to set all relays using only his mouse. The gui is not really useful.

All the software runs on Linux. libusb runs also on FreeBSD, NetBSD, OpenBSD, Darwin, MacOS X, and Windows. I never tested it on another OS than Linux, but it should run on any OS where libusb runs.

cc-by-saExcept where otherwise noted, content on this page is licensed under a Creative Commons Attribution-Share alike 3.0 Germany License.