"no display name and no $display environment variable"

573 views
Skip to first unread message

Harke Smits

unread,
Aug 11, 2017, 6:33:21 AM8/11/17
to BeagleBoard
Hello Learned group,

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

Przemek Klosowski

unread,
Aug 11, 2017, 9:26:53 AM8/11/17
to beagl...@googlegroups.com
On Fri, Aug 11, 2017 at 6:33 AM, Harke Smits <yrr...@gmail.com> wrote:
Hello Learned group,

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. 

Harke Smits

unread,
Aug 12, 2017, 6:13:44 AM8/12/17
to Beagle Board
Hello Przemek,

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 

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/s5Qhhc75e1c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CAC%3D1GgEwLf4sHO_iA%2BwGg3-8YCNjy%3DJL5OZxv4prH5bPLn0Y9A%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

Przemek Klosowski

unread,
Aug 13, 2017, 4:42:16 PM8/13/17
to beagl...@googlegroups.com
On Sat, Aug 12, 2017 at 6:13 AM, Harke Smits <yrr...@gmail.com> wrote:
 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.

Harke Smits

unread,
Aug 14, 2017, 6:24:12 AM8/14/17
to Beagle Board
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




--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/s5Qhhc75e1c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard+unsubscribe@googlegroups.com.

Przemek Klosowski

unread,
Aug 14, 2017, 10:05:09 PM8/14/17
to beagl...@googlegroups.com
On Mon, Aug 14, 2017 at 6:23 AM, Harke Smits <yrr...@gmail.com> wrote:
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?

The default setup in systemd starts the graphical target (btw, graphical 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

Roberts Maria

unread,
Aug 15, 2017, 3:25:37 AM8/15/17
to beagl...@googlegroups.com

--------------------------------------------
On Tue, 8/15/17, Przemek Klosowski <przemek....@gmail.com> wrote:

Subject: Re: [beagleboard] "no display name and no $display environment variable"
To: beagl...@googlegroups.com
Date: Tuesday, August 15, 2017, 5:04 AM



On Mon,
Aug 14, 2017 at 6:23 AM, Harke Smits <yrr...@gmail.com>
wrote:
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 =
idleExecStart = /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?
The default setup
in systemd starts the graphical target (btw, graphical 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
addEnvironment="DISPLAY=:0" and
maybe XAUTHORITY to the [Service}
section



--

For more options, visit http://beagleboard.org/discuss

---

You received this message because you are subscribed to the
Google Groups "BeagleBoard" group.

To unsubscribe from this group and stop receiving emails
from it, send an email to beagleboard...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CAC%3D1GgHE3pQKSpH4gq1V2N_PJWiZVoZMFtgT0FjOUdGP_GtebQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.
n numele unei asa-zise ascutiri a luptei de clasa a organizarii si manifestarii dictaturiiproletariatului din teoria marxist leninista au fost incalcate brutal drepturi si libertati democratice elementare ale oamenilor. Orice forma de opozitie a fost reprimata violent. Sub acuzatia imaginara de tradare sabotaj sau agenti ai imperialismului a fost profund afectat tot corpul de elita al vietii politice si culturale interbelice. intre 1947-1952 au fost inscenate numeroase procese politice ca cel impotriva liderilor Partidului National taranesc - luliu Maniu si Ion Mihalache si altele ce s-au soldat cu pedepse grele la inchisoare sau lagare de munca unde au pierit multi adversari ai comunistilor. Au fost lichidate cu brutalitate incercarile de rezistenta armata din zona muntilor Bucegi Fagaras. S-a manifestat totusi desi firav o rezistenta militara la instaurarea regimului comunist. Au actionat astfel grupuri inarmate ca de exemplu in Banat -Tanase lonescu Blanaru Spiru in Oltenia -maiorul Dumitriu in Arges - Traian Marinescu Fagaras - general Arsanescu si fratii Arnautoiu. in cadrul constituirii noului aparat de stat intre 1948-1949 s-au creat Securitatea si Militia populara. Securitatea a devenit un instrument de teroare si represiune indreptat impotriva oricarui opozant al noului regim. Ea era coordonata de generali dintre care unii erau agenti ai serviciilor de spionaj ca A. Nikolski P. Bodnarenko. in 1952 si-a inceput activitatea de reprimare Alexandru Draghici devenit ulterior ministru de interne.

Harke Smits

unread,
Aug 16, 2017, 6:40:43 AM8/16/17
to Beagle Board
Thanks for your comments. The f/ph type was quickly solved..... (thanks!). But then it still does not work. After a couple of days experimenting and googling  I get lost. I know most systemd commend by heart now.... ;-). Now I get the error: ac.service is not loaded properly. Error: invalid argument. My service is now:
[Unit]
Description ....
After = graphical.target
[Service]
Type = idle
Environment="DISPLAY=:0"
XAUTHORITY {no arguments needed?}
ExecStart = /home/debian/eme {etc to run Python script and make log file}
[Install]
WantedBy=default.target

I do hope you can get me going.
Thanks in advance,
Harke
PS: I considered using autostart that works perfect on my two year old Debian on another system with LXDE. Now LXQT is used and I can not find this anymore. 

 from it, send an email to beagleboard+unsubscribe@googlegroups.com.


 To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CAC%3D1GgHE3pQKSpH4gq1V2N_PJWiZVoZMFtgT0FjOUdGP_GtebQ%40mail.gmail.com.

 For more options, visit https://groups.google.com/d/optout.
 n numele unei asa-zise ascutiri a luptei de clasa  a organizarii si manifestarii dictaturiiproletariatului din teoria marxist leninista   au fost incalcate brutal drepturi si libertati democratice elementare ale oamenilor. Orice forma de opozitie a fost reprimata violent. Sub acuzatia imaginara de tradare   sabotaj  sau agenti ai imperialismului  a fost profund afectat tot corpul de elita al vietii politice si culturale interbelice. intre 1947-1952 au fost inscenate numeroase procese politice  ca cel impotriva liderilor Partidului National taranesc - luliu Maniu si Ion Mihalache si altele  ce s-au soldat cu pedepse grele la inchisoare sau lagare de munca  unde au pierit multi adversari ai comunistilor. Au fost lichidate  cu brutalitate  incercarile de rezistenta armata din zona muntilor Bucegi  Fagaras. S-a manifestat totusi  desi firav  o rezistenta militara la instaurarea regimului comunist. Au actionat  astfel  grupuri inarmate  ca de exemplu in Banat -Tanase  lonescu  Blanaru  Spiru  in Oltenia -maiorul Dumitriu in Arges - Traian Marinescu  Fagaras - general Arsanescu si fratii Arnautoiu. in cadrul constituirii noului aparat de stat  intre 1948-1949 s-au creat Securitatea si Militia populara. Securitatea a devenit un instrument de teroare si represiune  indreptat impotriva oricarui opozant al noului regim. Ea era coordonata de generali  dintre care unii erau agenti ai serviciilor de spionaj  ca A. Nikolski  P. Bodnarenko. in 1952 si-a inceput activitatea de reprimare Alexandru Draghici  devenit ulterior ministru de interne.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/s5Qhhc75e1c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages