Skip to content
This repository has been archived by the owner on May 1, 2019. It is now read-only.

stefs/home-sensor

Repository files navigation

Kaloix Sensor System

Notice: This project was made with only personal use by me in mind. Code is not commentated and the user interface is in German language.

Installation

Certificates

Both the server and all clients need x509 certificates for authentication with the HTTP API. They can be generated with the following commands:

openssl genrsa -out <name>.key 4096
openssl req -new -key <name>.key -out <name>.csr
openssl x509 -req -days 1460 -in <name>.csr -signkey <name>.key -out <name>.crt
rm <name>.csr
  1. Create server.key and server.crt.

  2. For each client create <hostname>.key and server_<hostname>.crt. (FIXME)

  3. Create clients.crt.

Client

  1. The base platform is Debian Jessie with Python 3.4.2.

  2. 1-Wire temperature sensor:

     sudo echo dtoverlay=w1-gpio >> /boot/config.txt
     sudo reboot
     sudo modprobe w1-gpio
     sudo modprobe w1-therm
    
  3. Optical character recognition of seven segment display:

     sudo apt-get install fswebcam libimlib2 libimlib2-dev python3-numpy python3-scipy python3-pil
     wget "https://www.unix-ag.uni-kl.de/~auerswal/ssocr/ssocr-2.16.3.tar.bz2"
     bzip2 --decompress ssocr-2.16.3.tar.bz2
     tar --extract --file ssocr-2.16.3.tar
     rm ssocr-2.16.3.tar
     make --directory ssocr-2.16.3/ ssocr
     ln --symbolic ssocr-2.16.3/ssocr
    
  4. Usage:

     ./client.py
    

Server

  1. The base platform is CentOS 6.7 with Python 3.4.3.

  2. Create self signed certificate for HTTP API:

     openssl genrsa -out server.key 4096
     openssl req -new -key server.key -out server.csr
     openssl x509 -req -days 1460 -in server.csr -signkey server.key -out server.crt
     rm server.csr
    

    Copy server.crt to clients.

  3. Generate an API token for each client:

     pwgen 32 2 > api_token
    

    Copy one unique token to every client.

  4. Python module installation on hoster Uberspace:

     pip3 install matplotlib pysolar pytz --user
    
  5. Usage:

     ./server.py
    

Acknowledgements

Copyright

Copyright © 2015 Stefan Schindler
Licensed under the GNU General Public License version 3

About

Read and serve sensor data

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published