0

I'm trying to get a graphical program called r3-view to start automatically upon boot on the Raspberry Pi. The following line works from an SSH session to display it on the SPI display:

DISPLAY=:2.0 /home/pi/r3-view /home/pi/clock.r3

However, when I add that line to crontab -e as follows:

@reboot DISPLAY=:2.0 /home/pi/r3-view /home/pi/clock.r3

It doesn't start up automatically.

I also tried adding the following line to /etc/rc.local before "exit 0", but it still doesn't start up on boot:

DISPLAY=:2.0 /home/pi/r3-view /home/pi/clock.r3 &

Any ideas?

  • Upon reboot I tried again, and this time the SPI display was 0.0. I updated the DISPLAY to that and tried rebooting using both methods, and neither would still work although it would work from an SSH session. – Respectech Aug 6 '15 at 1:13
1

Tried adding suggested start info to /etc/rc.local, but then all I got was a blank screen upon reboot (no X server or anything).

Created the following file:

/etc/X11/Xsession.d $ sudo vi 98-r3-view-clock

Entered the following into that file:

# R3-View Clock.r3

/home/pi/r3-view /home/pi/clock.r3 &

Rebooted, and voila!

0

Presumably you have an X server starting on that display somehow. If so, disable that, it's part of the problem. If not, that's part of the problem too.

Here's what you want at the end of rc.local:

(
    exec &> /var/log/rc_local.log
    /usr/bin/xinit /home/pi/r3-view /home/pi/clock.r3 -- /usr/bin/X :2
) &

exit 0

I'm presuming /home/pi/clock.r3 is an argument to r3-view and not a second application. Note when r3-view exits, so will the X server.

The tricky bit here is going to be getting the display right, since it seems you have more than one. This is the point of -- /usr/bin/X :2. See man xinit for more information about this. You may end up having to create an X config for that display and specify that.

If this doesn't work, there should be some explanation in /var/log/rc_local.log.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.