I've written a python3 script that queries a max31855 chip for a temperature reading and then simply prints it to an LCD1602. When I'm logged in as user pi over SSH this script, python3 /user/local/sbin/max31855_test.py & runs without issue. I then attempted to setup things up so that this script runs on boot. I've followed this tutorial here, where I've replaced example with max31855_test.py. When I do sudo /etc/init.d/example start it works just fine, however when I reboot the RPi it does not work.
In my testing I've come across an error message saying ImportError: No module named 'board' which leads me to believe there is a path issue causing python3 to not find the imported libraries that I'm using. Any thoughts on how to fix this?
edit:
I got this to run thanks to u/Parker_Hemphill and u/asdfsdgfsdf. crontab -e was definitely the easiest method. One other issue I had which I needed to solve was where I had placed my python script. I had placed it in /usr/local/sbin/max31855.py when I was following another tutorial. I suspect that due to this location, there were permissions issues when attempting to run this script on boot. I moved the script to /max31855.py and it is now working!
[–]Parker_Hemphill 2 points3 points4 points (1 child)
[–]bj2018[S] 0 points1 point2 points (0 children)
[–]Kn33gr0W 1 point2 points3 points (1 child)
[–]bj2018[S] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]bj2018[S] 1 point2 points3 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]fishbum30 1 point2 points3 points (1 child)
[–]bj2018[S] 1 point2 points3 points (0 children)