Forum

Full Version: Enable serial console
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to see the boot messages on the serial terminal. Google search and elsewhere in this forum I got idea about using /dev/ttyAMA0.

I have latest xbian beta 2 installed on raspberry pi.
Ethernet login works great with using putty on laptop.
I have connected USB to serial converter on laptop and is wired to raspberry Pi GPIO pins 8 and 10.

Using putty on my laptop to communicate with serial connection, I have setup 115200 baud, 8 data bit, 1 stop bit, no parity and no XON/XOFF handshake.

After booting rPi with xbian, I get message on the serial terminal -
Uncompressing Linux... done, booting ...

So far I have made following changes but still no luck seeing boot messages on serial terminal.

1. I changed file /boot/cmdline.txt and added console ttyAMA0 in it as follows-
console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2

2. Changed /etc/inittab.dist and added line -
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

3. added modules in module file /etc/modules so that the serial terminal ttyAMA0 will show up.
serial_core
amba-pl011

After all these changes and re-booting I still do not see console messages coming on serial terminal after first line which say- "Uncompressing Linux.. Done. booting..." The fact that one line shows up on the putty console tells me USB to serial converter is set up correctly and is working fine. Can any one help me how can I get boot messages on serial terminal?
Thank you.
You can't. The module needs to be compiled into the kernel for this to work at boot time.
I was able to enable serial console to login, no debug log but it's enough to try to solve my wifi issues.

DO IT OWN RISK

Edited on 08 Mar 14 to avoid missunderstandig.

Don't need modify cmdline.txt
Disable black list of the module amba_pl011 by editing /etc/modprobe.d/xbian.conf
Don't use inittab
Creare il file '/etc/init/ttyAMA0.conf'
Code:
# ttyAMA0 - getty
#
# This service maintains a getty on ttyAMA0 from the point the system is
# started until it is shut down again.

start on stopped rc or RUNLEVEL=[12345]
stop on runlevel [!12345]

respawn
exec /sbin/getty -L 115200 ttyAMA0 vt100
Reboot or start with the command 'start ttyAMA0'

Hope to be usefull and clear (Sorry for my english :-) )
Why not use inittab?
(4th Mar, 2014 03:58 PM)CurlyMo Wrote: [ -> ]Why not use inittab?

I tried but we don't have inittab, only "/etc/inittab.dist" , I tried to write an /etc/inittab whit the init level and the T0.. etc but it didn't work.

Maybe I did it wrong ?
Without an inittab, login doesn't work. Also the inittab.dist looks like a real inittab so i think that one is used.
(6th Mar, 2014 08:11 AM)CurlyMo Wrote: [ -> ]Without an inittab, login doesn't work. Also the inittab.dist looks like a real inittab so i think that one is used.
I tried with the inittab.dist, didn't work.

I searched to find the right way understandig this distribution and finally, I think, I find the legit way to do it.

We need the module like I said before, then, instend modifing /etc/rc.local we need to create a the file :
/etc/init/ttyAMA0.conf like I find here https://help.ubuntu.com/community/SerialConsoleHowto
Code:
# ttyAMA0 - getty
#
# This service maintains a getty on ttyAMA0 from the point the system is
# started until it is shut down again.

start on stopped rc or RUNLEVEL=[12345]
stop on runlevel [!12345]

respawn
exec /sbin/getty -L 115200 ttyAMA0 vt100

Of course I worked allways like root, then reboot.
Did you try just copying the inittab.dist to inittab?
guys !

inittab is obsolete. it's presence there ia only in case any old program should reference some info there. consoles are standard upstart respawning jobs. look at

Code:
/etc/init/tty{1,2}.conf

or at the end cybor's demo. he was properly reading docs Smile

also, serial_core and amba-pl011 are part of kernel (builtin) - at least in 3.12.7+ (xbian-package-kernel v1.3-6.10) which also is in STABLE repo as regular update since Feb.

(7th Mar, 2014 04:48 AM)cybor Wrote: [ -> ]I searched to find the right way understandig this distribution and finally, I think, I find the legit way to do it.

it is not "distro" but "init management". currently there is systemd (apple like, used in fedora for instance), upstart (by ubuntu) and old fashioned not used anymore SysV (the classics inittab + init.d)

xbian migrated to Upstart with Beta1 release.

Code:
man upstart

and yes, Ubuntu provides quite good "user level" documentation and is a good source.

btw: for basic console init understanding:

save as /etc/init/tty3.conf
Code:
respawn

exec getty -a xbian tty3

do a
Code:
sudo start tty3

and look at third console
that's all !
@mk011
Thanks for the clarification, I updated my previous posts to avoid missunderstanding.
so it is working, right ?
there is actually no reason for it to fail,

is still issues concerns, feel free to continue within this thread.
Reference URL's