I run into a question that I want to auto run a server in python when boot the Raspberry Pi every time. I tried several methods but they all don't work for me. Assume my python file is
I tried to use crontab and wrote
@reboot python /home/pi/Desktop/server.py &
But it doesn't work. I check the the server doesn't start. I also tried to wrote in /etc/rc.local
python /home/pi/Desktop/server.py &
Still doesn't work.
Only wrritten in
works now. But it needs me to use ssh to remote login in and then start run the server. What I want is just the server would auto run after I reboot the Pi, not needing to login in. Anyway has ideas?