serial terminal on HDMI Display in BBB

531 views
Skip to first unread message

sajeevan k

unread,
May 6, 2017, 8:06:06 AM5/6/17
to BeagleBoard


Hi all,

Basically I want to run my Qt application(A particular window on HDMI Display) at login in Beaglebone Black.

For that I have written necessary scripts in .xinitrc, and then proceeding as per wiki page 

http://forums.debian.net/viewtopic.php?f=16&t=123694&start=0,

I am adding the line 

[ "$(tty)" = "/dev/ttyS0" ] && exec startx  
in ~/.profile, where ttyS0 is FTDI serial terminal(connector J1) in BBB.

Startx at login is finely working for FTDI serial terminal.

When I boot the system, the FTDI serial terminal asking for login id and password, when I entered it correctly, my Qt application and other application will be run as specified in .xinitrc.

But what is my requirement is, a serial terminal should appear in HDMI display itself. When User ID and password is entered there, my application should run.

But I am not able to run a serial terminal on HDMI display.
Since I run the command 

systemctl set-default multi-user.target
the HDMI Display shows a blank display, with the cursor blinking

How can I enable a serial terminal on HDMI display?


And what will be the terminal name (like /dev/ttyS0), for such a terminal?   

Thanks in advance for the advice.


Thanks & Regards,
Sajeevan.K

Dennis Lee Bieber

unread,
May 6, 2017, 11:47:25 AM5/6/17
to beagl...@googlegroups.com
On Sat, 6 May 2017 05:06:06 -0700 (PDT), sajeevan k
<saje...@laxven.com> declaimed the
following:


>When I boot the system, the FTDI serial terminal asking for login id and
>password, when I entered it correctly, my Qt application and other
>application will be run as specified in .xinitrc.
>
>But what is my requirement is, a serial terminal should appear in HDMI
>display itself. When User ID and password is entered there, my application
>should run.
>

First confusion: Do you mean a text command shell/console when you say
"serial terminal" -- to my understanding, no actual serial port/device is
involved in what you describe (and I don't think you mean to have this
"terminal" only talking over the debug serial port).

>But I am not able to run a serial terminal on HDMI display.
>
>Since I run the command
>
>systemctl set-default multi-user.target
>
I've not dug into the various start-up options (especially not the
change-over to systemd from the older init system -- and that was on a
Mandrake (later Mandriva later Mageia) 7 or 8 system...

>the HDMI Display shows a blank display, with the cursor blinking
>
Taking my BBB upstairs (where I have the HDMI capable TV but no network
access) along with keyboard/mouse... Running the 2017-03-19 Debian image...

The BBB comes up with black screen and pointer -- ie; X already running
(although it took a while for the screen background and directory icons to
show) and is already logged into the default debian user account. A right
mouse click gave the choice for a web browser or an xterm console.

I'll admit, I'd prefer it if the default were not auto-login, and
instead an X login dialog were presented, as found on most "big machine"
Linux/X systems. If that were the norm, your problem would be rather
simple, as starting your application would be something done via your
account profile during login (somehow determine the login was into X, start
application -- otherwise [serial port console/SSH] ignore the application.

Given that (my) BBB boots into a logged in X system (LXQT I believe is
current), I don't know if

https://docs.fedoraproject.org/en-US/Fedora//html/Installation_Guide/sect-trouble-after-graphical-login.html

is meaningful... https://wiki.archlinux.org/index.php/systemd#Targets seems
to imply that your choice requires a text console somewhere (serial port or
network). Again, I've not dug into my BBB deep enough to find out how it
does the auto-login of the graphical system rather than presenting a login
dialog -- which is implied by the graphical.target description linked.

Since the boot console uses the debug serial, I don't think there is
anything that can display on the HDMI until X is enabled. This is unlike
the RaspberryPi, which does spew boot messages onto a text console on HDMI
-- before it starts X (<heh> and it seems my current RPi card is giving a
library error on the startx, so it is doing a log-on to the HDMI text
console; time to reimage the SD card, the back-up card is doing auto log-in
to the X display).

>How can I enable a serial terminal on HDMI display?

Given the above -- I suspect you don't... You set the start up to start
X first... And somehow need to turn off the auto log-in to get a log-in
prompt.
--
Wulfraed Dennis Lee Bieber AF6VN
wlf...@ix.netcom.com HTTP://wlfraed.home.netcom.com/

Dennis Lee Bieber

unread,
May 6, 2017, 3:30:15 PM5/6/17
to beagl...@googlegroups.com

Talking to myself in public again...

On Sat, 06 May 2017 11:46:40 -0400, Dennis Lee Bieber
<wlf...@ix.netcom.com> declaimed the following:

>
> I'll admit, I'd prefer it if the default were not auto-login, and
>instead an X login dialog were presented, as found on most "big machine"
>Linux/X systems. If that were the norm, your problem would be rather
>simple, as starting your application would be something done via your
>account profile during login (somehow determine the login was into X, start
>application -- otherwise [serial port console/SSH] ignore the application.
>

<SNIP>

> Since the boot console uses the debug serial, I don't think there is
>anything that can display on the HDMI until X is enabled. This is unlike
>the RaspberryPi, which does spew boot messages onto a text console on HDMI
>-- before it starts X (<heh> and it seems my current RPi card is giving a
>library error on the startx, so it is doing a log-on to the HDMI text
>console; time to reimage the SD card, the back-up card is doing auto log-in
>to the X display).
>

Turns out the RPi configuration program (which runs from the auto login
X display) has options controlling both auto login, and GUI vs CLI (shell)
start-up. But take into account that even that CLI startup has to load
enough to render text to a framebuffer for the HDMI -- it is not a simple
pure text (ASCII/UTF-8/whatever) stream as with a true serial port.




NON-SEQUITUR RAMBLING:

OTOH: The Raspberry foundation has gone too far with security.
1) using NOOBS installer one MUST have keyboard/mouse/HDMI to respond to
prompts

2) in my case, at least, after the OS installed and rebooted to the logged
in X GUI, I had to edit /etc/wpa_supplicant/wpa_supplicant.conf to add my
WiFi credentials, then reboot
2a) Strangely, the NOOBS installer allows for entering the WiFi
passphrase, but NOT the subsequent Raspbian GUI; hence the need to do the
edit
2b) The Ethernet port is also not enabled by default and needs to be
enabled using the network connection icon config.

3) SSH is DISABLED by default, so even if one has enabled WiFi and hard
Ethernet, one still can not connect from outside without making more
configuration changes
3a) One subsequently gets nagged about having a default password on the
regular "pi" account

In short: Every updated NOOBS SD card requires a session with
HDMI/keyboard/mouse just to get to the stage a BBB starts from...

William Hermans

unread,
May 6, 2017, 4:47:44 PM5/6/17
to beagl...@googlegroups.com
This must be something new. I have an rPI here next to me right now acting as an access point for my Android phones, and I do not even own an HDMI cablem or even an HDMI capable monitor to plug it into. 

2)      in my case, at least, after the OS installed and rebooted to the logged
in X GUI, I had to edit /etc/wpa_supplicant/wpa_supplicant.conf to add my
WiFi credentials, then reboot
        2a)     Strangely, the NOOBS installer allows for entering the WiFi
passphrase, but NOT the subsequent Raspbian GUI; hence the need to do the
edit
        2b)     The Ethernet port is also not enabled by default and needs to be
enabled using the network connection icon config.

Again, as my first comment.

3)      SSH is DISABLED by default, so even if one has enabled WiFi and hard
Ethernet, one still can not connect from outside without making more
configuration changes
        3a)     One subsequently gets nagged about having a default password on the
regular "pi" account

Same.

        In short: Every updated NOOBS SD card requires a session with
HDMI/keyboard/mouse just to get to the stage a BBB starts from...

There is an option of course. Well a couple at least if you own, and have a linux machine handy. You edit the sdcard before booting it on the rpi. Of course, you need to know the exact modifications you need to make. Otherwise it could get very tedious, very quickly changing the card between PC, and rpi.

Additionally, if something like openssh-server is not installed by default. You can use chroot, plus QEMU to run the image emulated on an x86 machine, usually well enough to install stock Debian packages. This requires a bit of knowledge of course, and a bit of thinking outside the box( sometimes ).

William Hermans

unread,
May 6, 2017, 4:53:38 PM5/6/17
to beagl...@googlegroups.com
Oh, by the way. One thing I have noticed about the default images I got at least from the rpi foundation. I was going to show what version image I was using, which I can still do because the *.img file is on my x86 Debian server, But trying to log into my rpi failed. e.g. their network stack seems buggy. It does this quite often. Even still, I'm able to connect to the internet from my Android phones through the rpi acting as an AP. So . . . like Widnows often does, it loses it's brains, or part of anyhow.

william@eee-pc:~$ ls backup/
2016-03-12-jessie-minibian.img
2016-05-27-raspbian-jessie-lite.img
BBB-blank-debian-8.5-console-armhf-2016-06-19-2gb.img.xz
BBB-blank-debian-8.5-console-armhf-2016-06-19-2gb.img.xz.1
bone-debian-8.5-console-armhf-2016-06-19-2gb.img.xz
bone-debian-8.6-console-armhf-2016-10-30-2gb.img.xz

 
The one highlighted  is what I'm using, The minibian image I was just "reverse engineering", and have never used it yet.

Dennis Lee Bieber

unread,
May 6, 2017, 6:28:04 PM5/6/17
to beagl...@googlegroups.com
On Sat, 6 May 2017 13:53:23 -0700, William Hermans
<yyr...@gmail.com> declaimed the following:

>*2016-05-27-raspbian-jessie-lite.img*

You're working with an end-user image... The "NOOBS" installer is a ZIP
file, the contents are (pardon while I unzip one)

e:\MicroSupport\RPI3\NOOBS_v2_3_0>dir
Volume in drive E is PhotoExt
Volume Serial Number is CA0A-BC13

Directory of e:\MicroSupport\RPI3\NOOBS_v2_3_0

05/06/2017 06:21 PM <DIR> .
05/06/2017 06:21 PM <DIR> ..
05/06/2017 06:21 PM 14,778 bcm2708-rpi-0-w.dtb
05/06/2017 06:21 PM 14,273 bcm2708-rpi-b-plus.dtb
05/06/2017 06:21 PM 14,010 bcm2708-rpi-b.dtb
05/06/2017 06:21 PM 14,000 bcm2708-rpi-cm.dtb
05/06/2017 06:21 PM 15,356 bcm2709-rpi-2-b.dtb
05/06/2017 06:21 PM 15,992 bcm2710-rpi-3-b.dtb
05/06/2017 06:21 PM 15,346 bcm2710-rpi-cm3.dtb
05/06/2017 06:21 PM 50,268 bootcode.bin
05/06/2017 06:21 PM 314 BUILD-DATA
05/06/2017 06:21 PM <DIR> defaults
05/06/2017 06:21 PM 2,432 INSTRUCTIONS-README.txt
05/06/2017 06:21 PM <DIR> os
05/06/2017 06:21 PM <DIR> overlays
05/06/2017 06:21 PM 99 recovery.cmdline
05/06/2017 06:21 PM 655,012 recovery.elf
05/06/2017 06:21 PM 2,587,008 recovery.img
05/06/2017 06:21 PM 28,069,888 recovery.rfs
05/06/2017 06:21 PM 2,658,552 recovery7.img
05/06/2017 06:21 PM 0 RECOVERY_FILES_DO_NOT_EDIT
05/06/2017 06:21 PM 9,728 riscos-boot.bin
17 File(s) 34,137,056 bytes
5 Dir(s) 3,769,773,031,424 bytes free

and are meant to be copied to a FAT formatted SD card -- no fancy games
with raw image copies to the device. On first boot, it loads enough to
present a GUI by which one can choose to install Raspbian (included in one
of those files) or, if network is available, download/install one of some
10 or so other operating systems. The install then partitions the SD card
and creates the ext4 file system. Subsequent boots are into the GUI which I
described above.

William Hermans

unread,
May 6, 2017, 9:00:06 PM5/6/17
to beagl...@googlegroups.com
Ah ok, yeah never used an NOOBs image I guess. Actually, someday I'll look into creating my own images. Just need to work out what is needed from the BSP for support files, kernel, and kernel modules etc. As I do not like all this hand holding stuff, and quite honestly you never know what these people put on your boards software wise.

As for the nagging about the default rpi user passwd. I think that a good thing. One of the first things everyone should do once purchasing any of these ARM based boards is:

  1. Change the default users passwd
  2. log in as root( not through su in an ssh session )
  3. Change the default user, and directory to a new suitable name for you.
  4. Give your new default user sudo access( visudo )
  5. Disable root login again, if that is your thing.

I am really glad that in general SBC makers are starting to take responsibility for default security state of the board they're selling. This will mean less problem on the internet over all. Which can be a huge deal if you realize that a few hundred of these boards working in a zombie team could by them self take down a very large corporate network.

sajeevan k

unread,
May 8, 2017, 9:13:03 AM5/8/17
to BeagleBoard
Hi Dennis Lee and William Hermans,


Thank You for the quick reply.
Based on information, provided by You, instead of getting text command console on HDMI display,
I explored the possibility of Auto login. 

The link https://unix.stackexchange.com/questions/297252/how-do-you-configure-autologin-in-debian-jessie helped me to make the auto login possible for debian jessie 8 which is there in BBB.
 
My requirement was only that.

After the bootup startx should run automatically and my application screen should be visible to the user.

Thank You for the guidance.

Thanks & Regards,
Sajeevan.K
Reply all
Reply to author
Forward
0 new messages