Hi all,
I am having trouble getting my script for the PIR sensor to start on boot.
I followed this guide which used to work until I did a fresh install with the latest version of MagicMirror.
The guide suggests adding the following line to the autostart file in:
~/.config/lxsession/LXDE-pi
@sudo /usr/bin/python /home/pi/MagicMirror/pir.py
… however, I do not have the lxsession directory in ~/.config.
I do have an autostart file in /etc/xdg/, but in the comments for the link I posted above it mentions that this is a global autostart file and the user one is preferred. The OP suggests manually creating the directory and autostart file using the path above, but that doesn’t seem to work either.
A few things:
-
my test script shows both 0 and 1 values for the sensor, confirming that it is sensing motion properly.
-
Running my monitor_off.sh / monitor_on.sh scripts manually work as expected
-
Starting my pir.py script manually works as expected
So, this leads me to believe that the problem is with the directory the autostart file is in.
Any help on this is appreciated. Thanks!