Okay, thanx a lot thagrol, -now I got the following message in the log file:
“/etc/rc.local: 20: /etc/rc.local: /home/pi/Alarm2_Thread: not found”
I am still working on the SSH connection, but did just try your other suggestion first.
Anyway the: ‘Alarm2_Thread.py’ file is found in the folder: /home/pi/, so I tried to add the “*.py” extension, which just gave the following error:
“/etc/rc.local: 20: /etc/rc.local: /home/pi/Alarm2_Thread.py: Permission denied”
OK.
This is basic stuff that is not in anyway specific to rc.local or other auto start methods.
- it should have been obvious that the extension (.py) is part of the filename and therefore must be included.
- Linux file and directory names are also case sensitive. foo.py is not the same file as Foo.py.
- In order to run a file as a program it must have execute permission set for the user attempting to run it. It would appear that your file does not.
The simplest and least secure way to add it isCode:
chmod a+x /etc/rc.local: /home/pi/Alarm2_Thread.py - Your python file must also have an apropriate shebang as its first line or the shell won't know which interpreter to invoke and pass it to.
When not using a virtual environment with python I usually useCode:
#!/usr/bin/env python3
Code:
python -u /etc/rc.local: /home/pi/Alarm2_Thread.py >some.log 2>&1 &Statistics: Posted by thagrol — Mon May 13, 2024 7:47 pm