Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Kernel logs on UART console

Featured Replies

Hi there, while trying to solve the issue with OPi PC and rtl8188 (thread link) I managed to get console on the UART interface, nice feature considering my networking issues, btw is there a way to output the kernel messages (dmesg like) to the UART console in real time? I'm asking cos the issue that I'm trying to fix involves system freeze + automatic reboot and I would like to see the logs during the event.

I already tried to mess with printk, but it's very likely I've done something wrong.

If you log in on this console, executing

dmesg -w

on this console will give you real-time dmesg output until reboot/crash occurs.

 

Also you can experiment with kernel command line in boot.cmd/boot.scr, setting "console=ttyS0 loglevel=6" and disabling login on this console (sudo systemctl disable serial-getty@ttyS0) should put all kernel messages to ttyS0 (console available on separate 3-pin header). In case you use high enough loglevel (like 6 or 7), I would recommend increasing scrollback buffer size in your terminal application or enabling logging to file.

  • Author

I tried to use

dmesg -w

but all I get is the normal dmesg output, it doesn't wait for new messages.

I tried to use

dmesg -w

but all I get is the normal dmesg output, it doesn't wait for new messages.

       -w, --follow
              Wait for new messages.  This feature is supported only  on  sysâ€
              tems with a readable /dev/kmsg (since kernel 3.5.0).

OK, sorry, didn't have any devices with legacy kernel to test this, and looked at help message rather than in man page. Since legacy kernel version is 3.4.x this won't work and you'll have to use the other method.

  • Author

So, I've hooked up the OPi via ssh and changed the boot.cmd file as follow

#setenv bootargs "console=tty1 root=/dev/mmcblk0p1 rootwait rootfstype=ext4 cgroup_enable=memory swapaccount=1 panic=10 consoleblank=0 enforcing=0 loglevel=${verbosity}"
setenv bootargs "console=tty0 root=/dev/mmcblk0p1 rootwait rootfstype=ext4 cgroup_enable=memory swapaccount=1 panic=10 consoleblank=0 enforcing=0 loglevel=6"

then compiled boot.scr

sudo mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
Image Name:
Created:      Thu Aug 25 00:28:49 2016
Image Type:   ARM Linux Script (uncompressed)
Data Size:    2442 Bytes = 2.38 kB = 0.00 MB
Load Address: 00000000
Entry Point:  00000000
Contents:
   Image 0: 2434 Bytes = 2.38 kB = 0.00 MB

and lastly disabled login on tty0

sudo systemctl disable serial-getty@ttyS0

After a reboot on the uart console I got the usual booting messages then nothing else, no login prompt (as excepted) but also no dmesg output.

I think I may have modified the boot.cmd file incorrectly, it's the first time messing with these settings, sorta flying blind here.

 

setenv bootargs "console=tty0 root=/dev/mmcblk0p1 rootwait"

 

If it is what you entered in fex, you forgot the S (ttyS0 and not tty0)

  • Author

ahhhh spot on! It seems that in my lazines I just copy-pasted the original line and forgot to add the sneaky S...

 

Thanks to both of you, I can now get back to my original wifi issue (the never ending cycle, fix one, break two).

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.