Skip to content

unibe-geodata-modelling/2021-plant-health-raspberrypi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues AGPL License


Logo

KiraPi

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
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

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.

(back to top)

Built With

(back to top)

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

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.

Installation

Environment

  1. Set up the Raspberry Pi with Python3
  2. Connect the DHT22 sensor with the Raspberry Pi. Take a note of the BCM pin where the sensor is attached.
  3. Clone the repo and cd into it:
    git clone https://github.com/networkscientist/KiraPi.git
    cd KiraPi
  4. Create the pipenv environment and install the packages from the Pipfile:
    pipenv shell
    pipenv install

Customize setting

  1. Update the BCM pin number in main.py to match your setting
    ## Initial Values
    gpio = 4 # BCM Numbering
  2. 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

(back to top)

Usage

Main Script

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 plot

The resulting table

Functions

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

(back to top)

Roadmap

  • 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).

(back to top)

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the GNU Affero General Public License v3.0. See LICENSE.txt for more information.

(back to top)

Contact

Peter Zweifel - [email protected]

Project Link: https://github.com/networkscientist/KiraPi

(back to top)

Acknowledgments

(back to top)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages