Loading README.md +107 −0 Original line number Diff line number Diff line  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](#about-the-setup) - [Requirements](#requirements) - [Installation](#installation) - [From Source](#from-source) - [Arch Linux Packaging](#arch-linux-packaging) - [Configuration](#configuration) - [Service](#service) - [Process management](#process-management) - [Development](#development) ## 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][]. ## Requirements The project needs the following libraries to build: * [glibc](https://www.gnu.org/software/libc/) (>=2.20) * [openssl](https://www.openssl.org/) (>=1.0.1.l) * [libconfig](http://www.hyperrealm.com/libconfig/) (>=1.5) * [libbcm2835](http://www.airspayce.com/mikem/bcm2835/) (>=1.46) * [libmicrohttpd](https://www.gnu.org/software/libmicrohttpd/) (>=0.9.44) 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](https://gcc.gnu.org/) (>=4.9.2). ## Installation ### 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](Makefile.shared). 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. :warning: 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](#from-source) installation. ## Configuration ### Service 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`. ## Development 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. [relayd]: ../../wikis/man/relayd.1.html [relayd.conf]: ../../wikis/man/relayd.conf.5.html [Contribution Guide]: CONTRIBUTING.md [.editorconfig file]: .editorconfig [standard directory variables]: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html [Raspberry Pi Model B rev2]: https://www.raspberrypi.org [Arch Linux ARM]: http://archlinuxarm.org/ [2 Channel 5V Relays]: http://www.amazon.de/gp/product/B00AE1P8KM?psc=1&redirect=true&ref_=oh_aui_detailpage_o04_s00 Loading
README.md +107 −0 Original line number Diff line number Diff line  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](#about-the-setup) - [Requirements](#requirements) - [Installation](#installation) - [From Source](#from-source) - [Arch Linux Packaging](#arch-linux-packaging) - [Configuration](#configuration) - [Service](#service) - [Process management](#process-management) - [Development](#development) ## 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][]. ## Requirements The project needs the following libraries to build: * [glibc](https://www.gnu.org/software/libc/) (>=2.20) * [openssl](https://www.openssl.org/) (>=1.0.1.l) * [libconfig](http://www.hyperrealm.com/libconfig/) (>=1.5) * [libbcm2835](http://www.airspayce.com/mikem/bcm2835/) (>=1.46) * [libmicrohttpd](https://www.gnu.org/software/libmicrohttpd/) (>=0.9.44) 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](https://gcc.gnu.org/) (>=4.9.2). ## Installation ### 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](Makefile.shared). 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. :warning: 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](#from-source) installation. ## Configuration ### Service 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`. ## Development 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. [relayd]: ../../wikis/man/relayd.1.html [relayd.conf]: ../../wikis/man/relayd.conf.5.html [Contribution Guide]: CONTRIBUTING.md [.editorconfig file]: .editorconfig [standard directory variables]: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html [Raspberry Pi Model B rev2]: https://www.raspberrypi.org [Arch Linux ARM]: http://archlinuxarm.org/ [2 Channel 5V Relays]: http://www.amazon.de/gp/product/B00AE1P8KM?psc=1&redirect=true&ref_=oh_aui_detailpage_o04_s00