Materials:
Raspberry Pi Zero W
DHT22 temperature and humidity sensor
Somewhere to host your api
Guide:
- Configure your Raspberry Pi by following an online tutorial.
- Login to your Pi using ssh e.g. ssh pi@192.168.0.38 password raspberry (default).
- Upload the temperature and humdity recording software tempsensor.py.
- Now upload launcher.sh and follow the tutorial by instructables to launch tempsensor.py on start up (https://www.instructables.com/id/Raspberry-Pi-Launch-Python-script-on-startup/).
- Reboot your Pi (sudo reboot) and that's it!
What's going on?
Once your Raspberry Pi loads up launcher.sh will run and that will open tempsensor.py automatically. tempsensor.py will sleep for 10 seconds and then fire to your api every 30 seconds (you can change this by amending the sleep functionality (time.sleep(SECONDS)). If your Pi stops firing to the api a simple reboot is required.