[BBB] Accessing display from serial console login

1,939 views
Skip to first unread message

shedmeister

unread,
Jun 29, 2013, 5:59:35 PM6/29/13
to beagl...@googlegroups.com
I've been using linux for years and never tried to do this.  Does anyone know if it is possible, and if so how?
I have a display connected to HDMI and the gnome desktop comes up fine (latest Angstrom image, Beaglebone Black).
I'd rather not hassle with a USB hub and connect a keyboard and mouse (I already have a webcam connected via USB).
I interface to the BBB with a serial console login.  Is there a way to launch X applications from the serial console and get them to display on the HDMI monitor?
I've tried:

<launch X application>
(Raw:616): Gtk-WARNING **: cannot open display:
export DISPLAY=localhost:0.0
<launch X application>
(Raw:602): Gtk-WARNING **: cannot open display: localhost:0.0
bbb> echo `hostname`
beaglebone
bbb> export DISPLAY=beaglebone:0.0
<launch X application>
(Raw:602): Gtk-WARNING **: cannot open display: beaglebone:0.0

Also, since I never plan to wiggle a mouse, how do I disable the screensaver function (display goes to sleep)?

Thanks,
 Jim


Charles Steinkuehler

unread,
Jun 29, 2013, 6:11:08 PM6/29/13
to beagl...@googlegroups.com, shedmeister
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 6/29/2013 4:59 PM, shedmeister wrote:
> I've been using linux for years and never tried to do this. Does
> anyone know if it is possible, and if so how? I have a display
> connected to HDMI and the gnome desktop comes up fine (latest
> Angstrom image, Beaglebone Black). I'd rather not hassle with a USB
> hub and connect a keyboard and mouse (I already have a webcam
> connected via USB). I interface to the BBB with a serial console
> login. Is there a way to launch X applications from the serial
> console and get them to display on the HDMI monitor? I've tried:
>
> <launch X application> (Raw:616): Gtk-WARNING **: cannot open
> display: export DISPLAY=localhost:0.0 <launch X application>
> (Raw:602): Gtk-WARNING **: cannot open display: localhost:0.0 bbb>
> echo `hostname` beaglebone bbb> export DISPLAY=beaglebone:0.0
> <launch X application> (Raw:602): Gtk-WARNING **: cannot open
> display: beaglebone:0.0

I've run into that as well, and haven't figured it out. I saw
something that implied I should "export DISPLAY=:0", but I haven't
tried it yet. I did pretty much everything you list above and had the
same results.

> Also, since I never plan to wiggle a mouse, how do I disable the
> screensaver function (display goes to sleep)?

If you hook up a mouse once, you can disable the display power
management in gnome and it will 'stick'. There's probably some
magical command line incantation that would make this work without
doing it through the gui, but I'm not familiar enough with gnome to
know how. :(

Alternately, you can "echo 0 > /sys/class/graphics/fb0/blank" to
'kick' the display every once in a while and get it to turn back on.

Note that if you haven't turned off blanking and you don't have a
mouse or keyboard plugged into the 'Bone, it will go into blanking
IMMEDIATELY after boot and it will generally look like HDMI is broken.

- --
Charles Steinkuehler
cha...@steinkuehler.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlHPW3wACgkQLywbqEHdNFyZiwCfVOqaWwdefPUi0TJrh5LVkRwD
J0gAoMufmAfvBUaRmkM0HDYGgVL1AJl9
=TGmW
-----END PGP SIGNATURE-----

Douglas Jerome

unread,
Jun 29, 2013, 6:27:58 PM6/29/13
to beagl...@googlegroups.com
On 06/29/13 14:59, shedmeister wrote:
> I've been using linux for years and never tried to do this. Does anyone
> know if it is possible, and if so how?
> I have a display connected to HDMI and the gnome desktop comes up fine
> (latest Angstrom image, Beaglebone Black).
> I'd rather not hassle with a USB hub and connect a keyboard and mouse (I
> already have a webcam connected via USB).
> I interface to the BBB with a serial console login. Is there a way to
> launch X applications from the serial console and get them to display on
> the HDMI monitor?
> I've tried:
>
> <launch X application>
> (Raw:616): Gtk-WARNING **: cannot open display:
> export DISPLAY=localhost:0.0
> <launch X application>
> (Raw:602): Gtk-WARNING **: cannot open display: localhost:0.0
> bbb> echo `hostname`
> beaglebone
> bbb> export DISPLAY=beaglebone:0.0
> <launch X application>
> (Raw:602): Gtk-WARNING **: cannot open display: beaglebone:0.0
>
> Also, since I never plan to wiggle a mouse, how do I disable the
> screensaver function (display goes to sleep)?
>
> Thanks,
> Jim

Maybe look at the 'xhost' command:
$ man xhost
$ xhost
$ xhost +localhost

cwrse...@gmail.com

unread,
Jun 30, 2013, 2:23:46 PM6/30/13
to beagl...@googlegroups.com

What you want is a normal desktop with a "remote" keyboard and mouse,
and I'm not sure how to do that.  I access the BBB from a network
connection, using VNC.

I got a minimal X desktop displayed via a VNC server by logging into the
BBB with ssh and running the following script:

#!/bin/bash
# Start a vnc server.
export DISPLAY=:1
xinit -- /usr/bin/Xvfb :1 -screen 0 1024x768x24 &
x11vnc -display :1 &

with ~/.xinitrc being:

# ~/.xinitrc
xclock -geometry 50x50-1+1 &
xterm -geometry 80x50+494+51 &
xterm -geometry 80x20+494-0 &
twm

Then a VNC viewer on the remote machine gets you an X desktop with a couple
of xterms and twm (a window manager); there's no reason why the same setup
can't start a standard desktop.  It's not using any hardware acceleration,
so even with Xterms it's a bit slow, but I haven't yet had time to sort out
a better configuration.  (Be aware that the setup has less than no security.)

Good luck - Will


shedmeister

unread,
Jul 4, 2013, 1:10:03 PM7/4/13
to beagl...@googlegroups.com
Here's an update on this:

On a regular linux box, if I do an X login (gnome) using the main display, then type 'echo $DISPLAY' in a terminal window, I get ":0.0".  Then if I remote login via ssh, or any non-X method, then 'export DISPLAY=":0.0", then 'xterm &', an xterm appears on the main display.
If I do the same thing on the Angstrom build, connect HDMI monitor, keyboard, and mouse, "echo $DISPLAY" also returns ":0.0".  From the serial console login, 'export DISPLAY=":0.0", launch X application, I get "Gtk-WARNING **: cannot open display: :0.0".

I noticed that in the ubuntu experiment, I had to be the same user in both the X session and the non-X session for this to work.  In Angstrom, I am root on both.  I tried a regular user account (xuser comes pre-configured), a lot of things break in the gnome session so I didn't get very far at all.

Also, even natively using the gnome session with display, kerboard, and mouse; basic X things don't work:
'xterm &' gives me an all white window, a message on the window I launched it from about a locale error and can't find input method, and I have to kill the xterm process from the serial console login to bring the X-session back to life.
And MOST IMPORTANTLY, my openCV application does something similar, opens a blank white window and hangs.  This is the main thing I bought the BBB for!

Thanks,
 Jim

Charles Steinkuehler

unread,
Jul 4, 2013, 1:58:21 PM7/4/13
to beagl...@googlegroups.com, shedmeister
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 7/4/2013 12:10 PM, shedmeister wrote:
> Here's an update on this:
>
> On a regular linux box, if I do an X login (gnome) using the main
> display, then type 'echo $DISPLAY' in a terminal window, I get
> ":0.0". Then if I remote login via ssh, or any non-X method, then
> 'export DISPLAY=":0.0", then 'xterm &', an xterm appears on the
> main display. If I do the same thing on the Angstrom build, connect
> HDMI monitor, keyboard, and mouse, "echo $DISPLAY" also returns
> ":0.0". From the serial console login, 'export DISPLAY=":0.0",
> launch X application, I get "Gtk-WARNING **: cannot open display:
> :0.0".
>
> I noticed that in the ubuntu experiment, I had to be the same user
> in both the X session and the non-X session for this to work. In
> Angstrom, I am root on both. I tried a regular user account (xuser
> comes pre-configured), a lot of things break in the gnome session
> so I didn't get very far at all.
>
> Also, even natively using the gnome session with display, kerboard,
> and mouse; basic X things don't work: 'xterm &' gives me an all
> white window, a message on the window I launched it from about a
> locale error and can't find input method, and I have to kill the
> xterm process from the serial console login to bring the X-session
> back to life. And MOST IMPORTANTLY, my openCV application does
> something similar, opens a blank white window and hangs. This is
> the main thing I bought the BBB for!

You'll probably have a lot better luck with something like Debian or
Ubuntu. It's straight-forward to run RobertCNelson's console Debian
and Ubuntu images and add LXDE (or Gnome/KDE if you really want) for a
much more conventional Linux X11 experience:

http://elinux.org/BeagleBoardDebian
http://elinux.org/BeagleBoardUbuntu

- --
Charles Steinkuehler
cha...@steinkuehler.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlHVt70ACgkQLywbqEHdNFwieACfVHu2shti1Y3h7AAzI/X+SwBQ
7UYAnRL6oNHV6Pbg4pLnkzhlIR09frAa
=jT6D
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages