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?

asked Aug 6, 2015 at 1:05
1
  • 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. Commented Aug 6, 2015 at 1:13

2 Answers 2

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!

answered Aug 6, 2015 at 20:49
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.

answered Aug 6, 2015 at 11:19

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.