I have a BBB with Debian version 2017-03-19, the latest release as far as I know, with a 4D systems display. I have made a Python script using TkInter, running fine on another BBB system with an older Debian version.
I made a simple testscript using TkInter as well. Running the testscript form XTerm or UXTerm (what is the difference?) works: a simple window pops up.
Running the same from Debian bash directly displays the well known error above. I googled a lot but no answer found yet.
The older system with similar software runs fine from autostart. Maybe I need to do here as well? I can not find autostart in the lastest Debian version: it must be in a different directory that I know of.
Finally: if I run the original script (running fine on the older system) I just get a blank screen and system halts.
Hope you can help me out.
Many thanks in advance,
Harke
I have a BBB with Debian version 2017-03-19, the latest release as far as
I know, with a 4D systems display. I have made a Python script using
TkInter, running fine on another BBB system with an older Debian version.
OK, so you are interacting with your BBB directly, not from another
computer via SSH or serial, right?
I made a simple testscript using TkInter as well. Running the testscript
form XTerm or UXTerm (what is the difference?) works: a simple window pops
up.
Running the same from Debian bash directly displays the well known error
above. I googled a lot but no answer found yet.
What do you mean by 'from the debian bash'? Normally, you're sitting in
front of a graphical desktop (i.e. running the X server or Wayland)
displaying a terminal emulator (e.g. XTerm) that runs a shell (e.g. bash).
The shell command (e.g. xclock) starts the process that issues X11 commands
that go to the current $DISPLAY and show up as windows.
If you're not running the X server, i.e. sitting at the raw text terminal
console (all black screen with white text), you cannot and will not see
graphics.
The older system with similar software runs fine from autostart. Maybe I
need to do here as well? I can not find autostart in the lastest Debian
version: it must be in a different directory that I know of.
Finally: if I run the original script (running fine on the older system) I
just get a blank screen and system halts.
If you want to use your system in graphics mode you should autostart X.
Usually it is done by asking it to go to the graphical run state (5 in the
old sysV init scripts, graphical.target in systemd)
For debugging, you can type 'startx' to start X manually.
Thanks for your reaction. I am by no means an expert so I may have the terminology wrong. I have a stand alone Beagleboard system, keyboard/mouse connected via usb dongle. The system starts up normally, in grafics mode, I can invoke internet, no problem, LAN connected. Going to XTerm I get the linux prompt, still in grafics mode. A simple TKInter test program works. Going to linux (XTRL/ALT/F1) I can invoke startx that brings me back were I came from: the grafics environment (LXDE). Starting the TKInter test program from the Linux prompt gives me the famous error message in the title. In Xterminal “echo $DISPLAY” renders :1, in plain linux: a blank line. Starting my application in XTerm gives a fully blank screen.
Still very puzzling…
I hope you or someone else can bring me further.
Kind regards,
Harke
I have a stand alone Beagleboard system, keyboard/mouse connected via usb
dongle. The system starts up normally, in grafics mode, I can invoke
internet, no problem, LAN connected. Going to XTerm I get the linux prompt,
still in grafics mode. A simple TKInter test program works.
OK, this is normal
Going to linux (XTRL/ALT/F1) I can invoke startx that brings me back were I
came from: the grafics environment (LXDE).
Now, this is not needed---you already have X running, and you should run
all your GUI programs from the Xterm like your TKInter test above. There's
no need to 'go to linux' again. Perhaps you are mislead by the fact that
after you run a graphical program from the shell prompt in XTerm you don't
get the prompt back---but that's easily fixed by running the command in the
background by adding the ampersand to the end of the command:
tesst &
When you go to the text console and do startx again, you have dueling X
servers, and I am not sure what is the expected result of that. Don't do
that---use the original X by either running in background with &, or
creating a new xterm, or arranging for your app icon to be visible so that
you can run it by doubleclicking the icon.
Starting the TKInter test program from the Linux prompt gives me the famous
Thank you very much, I keep on learning. My application now runs fine manually from XTerminal. Now I want to run the application on boot. I figured out a systemd service is problably the way to go. I managed to define that (ac.service) and run it on boot up. I wrote:
[Unit]
After = grafical.target
[Service]
Type = idle
ExecStart = /home/debian/eme {etc to run Python script and make log file}
[Install]
WantedBy=multi-user.target
This sort of works but the application does not start: the log file gives the famous $DISPLAY error. I try to start my application last, so after the X server has been started. Maybe the “WantedBy” statement is wrong?
Thanks a lot in advance, best regards,
Harke
not grafical), and runs the login manager which then runs graphical desktop
manager which allows you to run your app.
The simplest way to handle it is to use the 'autostart' feature of the
display manager.
You can replace the whole setup in systemd by doing what you are doing, but
you have to take out the display/login manager.
You will also need to add
Environment="DISPLAY=:0"
and maybe XAUTHORITY to the [Service} section