Skip to content

Instantly share code, notes, and snippets.

@interwebjill
Last active August 14, 2019 04:25
Show Gist options
  • Save interwebjill/0b3dcdc56d2d9f0b646534a6207899f7 to your computer and use it in GitHub Desktop.
Save interwebjill/0b3dcdc56d2d9f0b646534a6207899f7 to your computer and use it in GitHub Desktop.
BBB Autostart a GUI

You could read this:

https://learn.adafruit.com/running-programs-automatically-on-your-tiny-computer

or this:

http://mattrichardson.com/BeagleBone-System-Services/

and think that this will be an easy job. What is not said is that if your code loads a GUI, this won't work at all. Systemd services configure system services. Your GUI has to wait until the display server and display manager have started.

So what would that be for the BeagleBone Black running Debian Jessie?

Researching how the BeagleBone starts up, I found the following steps:

  • U-Boot initializes the processor, vital peripherals and then load Linux image from Flash,
  • U-Boot starts Linux image by passing it some parameters, the bootargs,
  • Linux starts, mounts its rootfs and launches /sbin/init,
  • init process checks its /etc/inittab config file and executes the instructions it contains,
  • this config file generally asks init to launch /etc/init.d/rcS at some point,
  • /etc/init.d/rcS looks at all scripts in /etc/init.d/ directory which start with a S, and executes them in ascending order

I really just included this list for the final line, so that people who don't use Embedded Linux can get a feeling for our pain.

You may find your way to the LXQt GUI and the Sessions Settings > Autostart. I couldn't get anything I put in setting to save. Wrote a bug report.

Here's what works

  1. chmod 755 your file

  2. Write a file to /etc/xdg/autostart like this:

     [Desktop Entry]
     Type=Application
     Exec=sudo /usr/bin/python /home/debian/oqy/oqy.py
     Name=oqy
     Comment=Startup OQY on load
    

To stop the script, ssh into the BBB and

pkill -f oqy.py

Hotkeys probably won't work because the keyboard will likely be locked out by the display manager.

@inbsarda
Copy link

inbsarda commented May 8, 2019

I am also working on BeagleBone Black running bone-debian-9.5-lxqt-armhf-2018-10-07-4gb.img. We want to run a python tkinter gui on boot up. Used the method mentioned above. But it did not work for us. The python script fails to run on boot up. Anything extra work that we need to do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment