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.
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
-
Create
server.key
andserver.crt
. -
For each client create
<hostname>.key
andserver_<hostname>.crt
. (FIXME) -
Create
clients.crt
.
-
The base platform is Debian Jessie with Python 3.4.2.
-
1-Wire temperature sensor:
sudo echo dtoverlay=w1-gpio >> /boot/config.txt sudo reboot sudo modprobe w1-gpio sudo modprobe w1-therm
-
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
-
Usage:
./client.py
-
The base platform is CentOS 6.7 with Python 3.4.3.
-
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. -
Generate an API token for each client:
pwgen 32 2 > api_token
Copy one unique token to every client.
-
Python module installation on hoster Uberspace:
pip3 install matplotlib pysolar pytz --user
-
Usage:
./server.py
- Seven Segment Optical Character Recognition by Erik Auerswald under license GPLv3
- fswebcam by Philip Heron under license GPLv2
- Pysolar Python 3 module by pingswept for sunrise/sunset calculation under license GPLv3
- Measurement Units Temperature icon by VisualPharm under license Free for non-commercial use
- Simple HTTPS Server In Python Using Self Signed Certs by Pankaj Malhotra
- HTTP API Design by interagent
Copyright © 2015 Stefan Schindler
Licensed under the GNU General Public License version 3