3

I have a raspberry Pi, for which I currently use the following script whilst I set some things up

watch -n .5 ntpq -np > /dev/tty2 &
gpsmon > /dev/tty3 &
cgps > /dev/tty4 &
watch 'ifconfig && ip route' > /dev/tty5 &

then use Alt-F2 etc to look at each screen However when I am viewing , say, tty2 and an undervoltage occurs it displays a message hwmon hwmon1: undervoltage on the screen which then causes the text to be wrong due to scrolling

I want to stop or otherwise address the issue of text message causing the text alignment problems and only have the undervoltage hwmon message output on tty1 - or perhaps only on logged in ttys.

I also get the lightning bolt icon so I will be aware of the issue, which occurs when I am plugging and unplugging USB hubs - I'm hoping it is a voltage mismatch between the powered USB hub and the Raspberry PI itself as the (common) power supply is a 20A 5V and I have used dedicated large cables to the powered hub. Its short term and does not appear to be having any other effect

Ross
  • 152
  • 1
  • 8

1 Answers1

2

I can't speak from personal experience but perhaps try

how do i disable messages or logging from printing on the console virtual termin.

You can use the command

sudo dmesg -n 1

to suppress all messages from the kernel (and its drivers) except panic messages from appearing on the console.

To fix at each boot, add the command to:

/etc/rc.local

A comment from ross

dmesg -n 1 does stop messages to the console but I found the message is still being sent to tty10 (which appears to be just the syslog) so this is what I needed

joan
  • 71,024
  • 5
  • 73
  • 106
  • Thanks- I knew I had seen that command somewhere but my searches did not find it - still I want to see the messages somewhere so for the moment I re-wrote my script so that it kills and restarts all the processes eg bash /var/tmp/wgps1.pid watch -n .5 ntpq -np > /dev/tty2 & echo kill $! >> /var/tmp/wgps1.pid etc – Ross Jun 28 '22 at 06:13
  • dmesg -n 1 does stop messages to the console but I found the message is still being sent to tty10 (which appears to be just the syslog) so this is what I needed – Ross Jun 28 '22 at 06:20
  • Thanks for the update. I will update the answer with that information. – joan Jun 28 '22 at 08:29