Commit 7a95452f authored by Hermann Mayer's avatar Hermann Mayer

[Docs] Added a readme. (See #1)

parent e8d76691
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]( (>=2.20)
* [openssl]( (>=1.0.1.l)
* [libconfig]( (>=1.5)
* [libbcm2835]( (>=1.46)
* [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]( (>=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
### 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]:
[.editorconfig file]: .editorconfig
[standard directory variables]:
[Raspberry Pi Model B rev2]:
[Arch Linux ARM]:
[2 Channel 5V Relays]:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment