https://github.com/zamberjo/dht22_sensor_client
Client MQTT for sensor DHT22
https://github.com/zamberjo/dht22_sensor_client
Last synced: about 1 month ago
JSON representation
Client MQTT for sensor DHT22
- Host: GitHub
- URL: https://github.com/zamberjo/dht22_sensor_client
- Owner: zamberjo
- Created: 2018-03-14T21:06:29.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-21T14:51:11.000Z (over 8 years ago)
- Last Synced: 2025-02-26T14:48:20.279Z (over 1 year ago)
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DHT22 Sensor client for RPi
Installation
-------
I always recommend using virtualenv
```
apt-get update && apt-get install -y virtualenv build-essential python-dev python-openssl
```
```
git clone https://github.com/zamberjo/dht22_sensor_client.git /opt/dht22_sensor_client && pushd $_
```
```
virtualenv venv
source venv/bin/activate
```
```
git clone https://github.com/adafruit/Adafruit_Python_DHT.git /opt/Adafruit && pushd $_
python setup.py install
popd
rm -rf /opt/Adafruit
```
```
pip install -r requeriments.txt
```
Use
---
Publish temperature and humidity
```
/opt/dht22_sensor_client/venv/bin/python dht22_cron.py
```
Crontab
-------
```
crontab -e
*/5 * * * * cd /opt/dht22_sensor_client/venv/bin/python /opt/dht22_sensor_client/dht22.py >/dev/null 2>&1
```