Hello,
I have the following simple bash script named "camera.sh":When I add the following line to /etc/rc.local, the libcamera does not start:Code:
#!/bin/bashexport DISPLAY=:0.0export XAUTHORITY=~/.Xauthoritysleep 10libcamera-hello --fullscreen -t 0The camera.sh file is executable and it works with the command line or double-clicking on it.Code:
sudo /home/pi/camera.shexit 0
I'm using bullseye OS.
It appears from the above that your script or something it is calling needs the desktop. rc.local runs before the desktop has been started.
Additionally, "~/.Xautority" will be expanded to /root/.Xauthority as everything started in or by rc.local is run by root unless explictly configured to do otherwise.
sudo is also not needed in rc.local.
If you change your line in rc.local to the following you should get any error messages thrown in the .log file:
Code:
/home/pi/camera.sh >/home/pi/camera.log 2>&1Running A Program At Start Up A Beginner's GuideWhat else can I try?
Statistics: Posted by thagrol — Thu Mar 07, 2024 2:32 pm