{"id":19952697,"url":"https://github.com/tob1as/rpi-sensors","last_synced_at":"2025-07-09T07:09:35.398Z","repository":{"id":58471307,"uuid":"326190744","full_name":"Tob1as/rpi-sensors","owner":"Tob1as","description":"Raspberry Pi Sensors (DHT22 / AM2302)","archived":false,"fork":false,"pushed_at":"2024-10-29T21:37:13.000Z","size":42,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T20:21:22.891Z","etag":null,"topics":["am2302","dht22","docker","docker-compose","dockerfile","gpio","humidity","humidity-sensor","iot","python","python3","raspberry-pi","raspberry-pi-gpio","raspberrypi","sensor","sensors","temperature","temperature-sensor"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tob1as.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-02T13:39:38.000Z","updated_at":"2024-10-29T21:37:16.000Z","dependencies_parsed_at":"2024-10-28T21:38:19.631Z","dependency_job_id":null,"html_url":"https://github.com/Tob1as/rpi-sensors","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tob1as%2Frpi-sensors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tob1as%2Frpi-sensors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tob1as%2Frpi-sensors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tob1as%2Frpi-sensors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tob1as","download_url":"https://codeload.github.com/Tob1as/rpi-sensors/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252241949,"owners_count":21717075,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["am2302","dht22","docker","docker-compose","dockerfile","gpio","humidity","humidity-sensor","iot","python","python3","raspberry-pi","raspberry-pi-gpio","raspberrypi","sensor","sensors","temperature","temperature-sensor"],"created_at":"2024-11-13T01:14:06.449Z","updated_at":"2025-05-03T19:30:54.525Z","avatar_url":"https://github.com/Tob1as.png","language":"Python","readme":"# Raspberry Pi Sensors (rpi-sensors)\n\n## Description\n\nThis application measures temperature and humidity with a [DHT22/AM2302](https://learn.adafruit.com/dht) sensor connected to the Raspberry Pi.  \nThe sensor is read out with a Python script and the library [Adafruit_CircuitPython_DHT](https://github.com/adafruit/Adafruit_CircuitPython_DHT). The measurement data is displayed in the console and can optionally be save to a database (MariaDB) and displayed on a web server.\n\n## Requirements\n\n* Raspberry Pi\n* Raspberry Pi OS (previously called Raspbian), Version: 10 buster / 11 bullseye\n* Sensor: DHT22 (AM2302) (Buy: [int.](https://www.adafruit.com/product/393)/[de](https://www.berrybase.de/am2302/dht22-digitaler-temperatur-und-luftfeuchtesensor-mit-kabelanschluss))\n* optional: Docker \u0026 docker-compose\n\n## Installation / Usage\n\n### Note: \nIt use [physical PIN7 = GPIO4 (D4)](https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#gpio) by default. You can now[*](https://github.com/adafruit/Adafruit_CircuitPython_DHT/issues/57) change the GPIO Pin over a env-Variable (see below). \nThe other two cable of `AM2302` are connect to 3V (or 5V) and Ground.\n\n### First Step:    \n```sh\n# Clone Project \ngit clone https://github.com/Tob1as/rpi-sensors.git\n# change in folder\ncd rpi-sensors/\n```\n\n### Secend Step:  \nUse Docker (recommended) or manual installation.  \n\n#### Docker\n\nRequirements:\n* installed [Docker](https://docs.docker.com/engine/install/debian/)\n* installed [Docker-Compose](https://docs.docker.com/compose/install/linux/#install-using-the-repository)\n* Help? Use my install [Script](https://github.com/Tob1as/docker-kubernetes-collection/blob/master/scripts/docker+docker-compose_install.sh) for that.\n* Note: This was developed and tested on a Raspberry Pi 3. On 4 it run when you set `PRIVILEGED_MODE_ENABLE=true` in `.env`-File (see below).\n\nSteps:  \n1. copy env-File:\n    ```sh\n    cp example.env .env\n    ```\n2. change settings in `.env`-File, example Database Password or GPIO Pin. Then optional check config:\n    ```sh\n    docker-compose config\n    ```\n3. Run:\n    ```sh\n    docker-compose up -d\n    ```\n    or:\n    ```sh\n    docker-compose up -d mariadb dht22 web\n    ```\n4. [optional] Logs:\n    ```sh\n    docker-compose logs -f\n    ```\n5. [optional] Stop:\n    ```sh\n    docker-compose down -v\n    ```\n\n#### manual installation\n  \n1. Install requirements:\n    ```sh\n    sudo apt-get update\n    sudo apt-get install -y build-essential python3-dev libgpiod2 libmariadb-dev\n    sudo pip3 install adafruit-blinka==8.43.0\n    sudo pip3 install adafruit-circuitpython-dht==4.0.5\n    sudo pip3 install mariadb==1.1.10\n    sudo pip3 install paho-mqtt==2.1.0\n    ```\n2. Setup local or external MariaDB/MySQL.\n3. Export Variable in `example.env`-File or change default value in `dht_sensor.py`.\n4. Run:\n    ```sh\n    python3 ./dht_sensor.py\n    ```\n5. Optional: Copy html-Folder into Webserver with installed PHP-Modul and change database settings in php file.\n\n### Troubleshooting\n\nIf your container (example: web) fails to start with Images that based on Alpine 3.13 on ARM devices like Raspberry with Raspbian Buster (32 bit) then see [here](https://github.com/Tob1asDocker/php#troubleshooting) or [here](https://github.com/Tob1asDocker/rpi-mariadb#troubleshooting) or [here](https://docs.linuxserver.io/faq#libseccomp) for a possible solution.\n\n## This on\n\n* [DockerHub](https://hub.docker.com/r/tobi312/rpi-sensors) for Container/Docker Image\n* [GitHub](https://github.com/Tob1as/rpi-sensors) for Sourcecode and configuration\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftob1as%2Frpi-sensors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftob1as%2Frpi-sensors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftob1as%2Frpi-sensors/lists"}