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.
-
chmod 755 your file
-
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.
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?