-1

Hi fellow programmers.

I am trying to make my python script auto-boot on startup in Linux / Raspbian on my Raspberry Pi 3.

I followed this tutorial: http://www.instructables.com/id/Raspberry-Pi-Launch-Python-script-on-startup/?ALLSTEPS

When I do sh launcher.sh my GUI opens and everything works fine. But when I boot nothing shows up.

When going to the crontab logs I get the following error:

Traceback (most recent call last):

File "CCM-Interface.py", line 76, in <module>

root = Tk()
  File "/usr/lib/python3.4/tkinter/__init__.py", line 1854, in __init__

self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
  • 3
    You are trying to run an X application before your X server is running. That won't work. You will have to wait for your X server to start for this to work, so I would suggest you invoke your script from your X session script instead. – Frédéric Hamidi Nov 14 '16 at 14:22
  • How would I do this? – Jarno Jellesma Nov 14 '16 at 14:47
  • If you search for that exact error message on this site ("no display name..."), you will find 247 related questions. Did _none_ of those help you? – Bryan Oakley Nov 14 '16 at 15:11

1 Answers1

0

I fixed it the following way:

I edited the following file by typing this in the terminal:

sudo nano ~/.config/lxsession/LXDE-pi/autostart

And adding this line:

@sh /home/pi/GUI/launcher.sh