Autostart Issue with Debian V9.5 on Beaglebone Black

I’m trying to have a Python program that uses Tkinter autostart when the BBB boots. This can normally be done by adding a file to the /home/debian/.config/autostart folder but this does not always work. My environment is a BBB, with a 4D Systems Gen4 LCD display and I’m running Debian v9.5 (Stretch)

The program I have is a Python program that uses Tkinter and also uses the PRU. If this program is started from a terminal on the desktop everything works fine. Since the Python program uses the LCD display I’ve added ‘xhost +’ to the system .bashrc file so that the Python program can be started ffrom any terminal (SSH for example) and display the Tkinter generated results on the LCD.

The problem comes when I try to use the autostart function. I have tried all of the following. In each case the Python program fails when trying to load the PRU with it’s associated BIN code.

Case 1: autostart file includes the command ‘Exec=python myProgram.py’
Case 2: autostart file includes the command ‘Exec=qterminal -e myBash.sh’, where myBash.sh is a Bash script file contains the command ‘python myProgram.py’
Case 3: autostart file includes the command ‘Exec=myBash2.sh’, where myBash2.sh is a Bash script file contains the command 'qterminal -e myBash.sh. This opens a terminal and executes myBash.sh which contains the command ‘python myProgram.py’

But if have an autostart command that only opens a terminal (i.e Contains ‘Exec=qterminal’ then on boot a terminal is opened and if I type run either myBash.sh or myBash2.sh the Python program works correctly.

I’ve also tried adding delay in the two bash files to give the system time to settle without success.

Is there some delay that has to happen on boot for the display to allow the PRU to work?

@texasEE, with the autostart, you ca not use relative path’s like when you are logged in. You must use the full path, as none of your “user” terminal settings are available in “autostart”…

Regards,

In trying to find the cause of the problem I noticed that relative filenames did not work. I’ve since modified all references to a full path name but the issue described still happens.

From you comment I’m assuming that the .bashrc file for the terminal is not run prior to running the -e command when the autostart file has the ‘qterminal -e fullPathNameMyBash.sh’ command.

Any other places that I can look to resolve this issue?

Any reason you just can’t call “/bin/bash /full/path/mybash.sh”?

Regards,