The KiraPi system was created as part of the Seminar Geodata Analysis. It currently monitors air temperature as well as the relative humidity of the air through a DHT22 sensor. Furthermore, the collected data is represented in graphs. The project is built on top of a Raspberry Pi system and coded in Python3.
Explore the wiki »
Report Bug
·
Request Feature
Table of Contents
This project has been created as part of the course Geodata Analysis and Modelling, having taken place during 2021 at the University Bern. Big thank go to Pascal Horton and Andreas Paul Zischg for leading the seminar.
Generally, use this README.md file for instructions on the installation and usage of the scripts. Additional info may be found in the wiki. The latter, however is nowhere near complete. Furthermore, GitHub functions such as Projects or Milestones have been used by me in order to learn about them. Do not rely on them, though!
The project which was handed in is released as V1.0. To replicate the environment, install Python 3.7.3 and use the Pipfile in this repo.
To get a local copy up and running follow these simple steps.
Using Raspbian, you will need the pigpio packages in order to be able to access the GPIO pins from the python script. The most recent version can be found on the Github project page pigpio. Further installation instructions can be found on the project's web page abyz.me.uk
Alternatively, you may use the apt package manager from a bash shell to install the packages.
sudo apt-get update
sudo apt-get install pigpio python-pigpio python3-pigpio
You will additionally need pigpiod to run the pigpio library as a daemon:
sudo apt-get install pigpiod
Either run pigpiod
with superuser rights before using the KiraPi scripts or add the daemon to the startup applications.
For the purposes of the geodata seminar, KiraPi was set up with v79 of pigpio
, installed through the apt package manager.
- Set up the Raspberry Pi with Python3
- Connect the DHT22 sensor with the Raspberry Pi. Take a note of the BCM pin where the sensor is attached.
- Clone the repo and cd into it:
git clone https://github.com/networkscientist/KiraPi.git cd KiraPi
- Create the pipenv environment and install the packages from the Pipfile:
pipenv shell pipenv install
- Update the BCM pin number in
main.py
to match your setting## Initial Values gpio = 4 # BCM Numbering
- Update the path where your log file should be stored in
dht22.py
## Initial Values csv_path = "/home/pi/KiraPi/output/sens.txt" # Where the measurements will be stored
To start a measurement batch, simply start the script with python in your environment. In the example below, you would use the bash shell and python3:
pipenv run python3 main.py
Without error, you will get two files: sens.txt
and figure.png
.
The resulting table
If you want to call the functions provided in the KiraPi folder, simply load the files into your favourite editor and call the desired function. Since my Raspi3 lacked the power to run PyCharm, I used IdleX on Raspbian through a remote desktop session.
For a detailed documentation of the functions, please use the wiki
- Read from DHT22 sensor
- Plot measurements
- Save measurements/plot to files
- [~] Read from soil moisture sensor: In development branch 2-soil-moisture-data
- [~] Store config values in external YAML file: In development branch 12-outsource-config
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the GNU Affero General Public License v3.0. See LICENSE.txt
for more information.
Peter Zweifel - [email protected]
Project Link: https://github.com/networkscientist/KiraPi
- For a great README.md template: README Template
- For the Geodata Seminar and feedback on the code: Pascal Horton & Andreas Paul Zischg - University Bern
- My cat: For allowing me to use her name and portrait