adafruit/Adafruit_Python_DHT

How to automatic run after reboot the Raspberry Pi with DHT22 sensor

jackyZhangHZ opened this issue · 2 comments

Hi :-) i have a question , could you please help: How to run automatic after reboot the Raspberry Pi with DHT22 sensor
MANY MANY THANKS

Hi, use crontab: run crontab -e and add this at the end:

@reboot sleep 30 && python /yourprojectfolder/start.py &

Leave 30 or 60 sleep seconds to let Rasp to go ready.
Replace "yourprojectfolder" with your.
"&" at end launch project in backgroud

To kill the process, use:

pkill -ef -9 "yourprojectfolder/start.py"

Hope this help, bye.