A HTTP relay control server

Name Last Update
dist Loading commit data...
docs Loading commit data...
src Loading commit data...
.editorconfig Loading commit data...
.gitignore Loading commit data... Loading commit data... Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
Makefile.shared Loading commit data... Loading commit data...
VERSION Loading commit data...


This project targets the control of mutliple relays via HTTP. With the help of this daemon you can fetch the current status of all relays or just one specific. You are also able to turn a specific relay on and off. More comfort comes with the ability to toggle the state of a relay without knowing the current state.

About the setup

The project runs productive on a Raspberry Pi Model B rev2 with Arch Linux ARM as distribution. It controls multiple 2 Channel 5V Relays.


The project needs the following libraries to build:

The versions behind the libraries are describing the lowest tested versions. Is it possible that lower and/or higher versions will run fine, too.

The project was successfully compiled with the GCC (>=4.9.2).


From Source

For all non-Arch Linux systems you can install the software the old way by building it from source (make build) and fire a make install. The project is not configured by autotools, but the makefiles makes use of the standard directory variables. Forthermore you can specify a DESTDIR variable for packaging. (make DESTDIR=/tmp/xyz install) If you are interessested in changing the default directory variables consider the Makefile.shared file. They are change able the same way as DESTDIR. The uninstall target takes care of the same variables and will cleanup your system if you don't want the software to be installed.

This process expects you to build the software on the same architecture as it will run on. For cross compiling consider a related guide for your target architecture.

Arch Linux Packaging

If you are interessested in building an Arch Linux package, all you have to do is to clone this repository, install/build all the dependencies of the project and run makepkg inside the dist/archlinux directory. Afterwards you will find a fresh package (relayd-*-*.pkg.tar.xz) in the same directory. This process underlies the same cross compiling restrictions as the From Source installation.



The relayd daemon can be configured with a configuration file which follows the format which is described by the relayd.conf man page. On Arch Linux the system wide configuration can be found at /etc/relayd.conf.

Process management

The relayd daemon can be started in different flavors. It is able to run in foreground by adding the -f|--foreground parameters or in background (without additional parameters). While the daemon is running in foreground, all logging outputs will be printed to stdout and/or stderr. The foreground logging is prefixed with the current date/time and the log level for the message. While the daemon runs in background, all logging outputs will be redirected to syslog. For Arch Linux there is a systemd unit file shipped for the daemon. The service can be enabled with: sudo systemctl enable relayd.service.


The project is written in C and comes with a bulk of predefined GNU Make targets to speed up common development tasks. To get in touch just fork and clone the project, install/build the required dependencies and fire a make build.

The most adorable targets are clean build test (in this order :)). While editing the man pages you can easily review the latest state with the docs-* targets. (currently there are: docs-relayd.1 docs-relayd.conf.5)

Please mind the Contribution Guide and the given .editorconfig file if you plan to work on the project.