0

I want to automate my python script which controls devices through CAN. I can start script simply from terminal, but I dont want to do that every time. So I put nohup python /home/pi/script.py & in rc.local - did not work. I tried putting print('1') just after import can to find out that it never happens. I even put time.sleep(60) to make sure everything loads before starting my script - still nothing. Nohup does not show '1' - only '0' which is right before import can:

import time
time.sleep(60)
print('0')
import can
print('1')
Ri Di
  • 103
  • 4
  • 2
    Did you install `can` only for your user? Have your script write to a log file (with `nohup python /home/pi/script.py 2>&1 > logfile`) to see what errors occur – Panki Mar 01 '22 at 12:52
  • thanks. I installed can with pip in sudo su - now theres other problem (also with can and sudo) - I guess ill look for other way to launch script on boot – Ri Di Mar 02 '22 at 06:21

0 Answers0