Components used for this project:
- Raspberry Pi 4b running Raspbian
- Waveshare environment sensor hat
- Used virtual environment venv
- Clone project in
home/pi/
(or you need to change path below)
To run file automatically, I used crontab:
- Open terminal
- Type crontab -e
- Paste the following code into the file:
*/30 * * * * cd /home/pi/TemperatureLog && /home/pi/TemperatureLog/{your venv name}/bin/python main.py command arg
This will run the script main.py in your venv every 30 minutes - Click ctrl+o to save, then ctrl+x to close
- Script will run every 30 minutes