Skip to content

ronen25/rpiweatherd

Repository files navigation

rpiweatherd

rpiweatherd is a small daemon for the Raspberry Pi, written in C99, that records weather data using temperature sensors. It can be used as a weather data server, returning JSON-formatted data via a normal HTTP request.

The daemon is designed to be small, efficient and portable, so even though it has some dependencies, most of them are probably already installed on your Raspberry Pi.

Repository Structure

The repository contains all code and submodules needed to successfully compile and run the daemon.

Directory Description
src/ Source directory containing C source files
include/ C Header files
skel/ Templates for configuration files and initialization scripts/units
devices/ Device drivers
extra/ Administration script and an Example CLI client
deps/ Dependencies required for building the daemon

Installation

As of version 1.1.1, binary ARMHF debian packages are available on the Releases page. The .deb package will take care of all dependencies needed. You may also compile the daemon from source.

Dependencies and Requirements

  1. Raspberry Pi
    Tested on Model A+ and RPi 2/3 Model B
  2. Raspbian (late 2015 or newer)
    Ubuntu 14.04 or newer
    Arch Linux
    Other distributions are not officialy supported but might also work.
  3. A Temperature sensor connected to the Pi.
    See the list of supported devices for more information.
  4. GCC version 4.6 or newer
    Required for some GNU extensions and the C99 standard.
  5. CMake version 3.0 or newer
  6. SQLite3 development libraries version 3.5 or newer
  7. WiringPi version 1.1 or newer
  8. Python version 3.2 or newer

Quick Setup Guide

Installing Dependencies

Several development libraries must be installed in order to successfully compile rpiweatherd.

Distribution Name Command to Install
Raspbian/Ubuntu $ sudo apt-get install cmake python3 gcc make git libsqlite3-dev wiringpi
Arch Linux ARM $ sudo pacman -S cmake python gcc git make sqlite wiringpi

Building and Installing

  1. Clone the repository:
    $ git clone https://github.com/ronen25/rpiweatherd
  1. Create a bin directory, switch to it, and initiate compilation using CMake.
    $ cd rpiweatherd
    $ mkdir bin && cd bin
    $ cmake -DCMAKE_BUILD_TYPE=RELEASE ..
    $ make
  1. Finally, install the daemon:
    $ sudo make install
  1. Configure rpiweatherd according to the configuration guide.

  2. Run the program using the appropriate init tool, either as root or with sudo:

Distribution Name Command to Install
Raspbian/Ubuntu # service start rpiweatherd
Arch Linux ARM # systemctl enable rpiweatherd
  1. Test the installation by issuing the current command from any web browser:
    http://[ip-of-pi]/current
  1. Daemon administration and a reference client can be found in the extra/ folder.

Clients

The repository provides the rpiweatherd-cli.py client, which is a very simple, proof-of-concept client using a command-line interface.

I also provide a Qt-based GUI client, developed as a separate project - rpiweatherd-qtclient.

Manual Sections


License

This software is licensed under the GNU GPLv3 License.