[Solved] Weird characters in console

While viewing the Karaf console locally (the Pi is plugged into a TV currently), after trying to display certain characters, character-map seems to be a mess. See the pictures, they explain better than me :slight_smile:
Any ideas why and how to fix it?

I got to the console like so:

 ssh openhab@localhost -p 8101


Have you overclocked your Pi, and do you know if it’s getting good power?

Not overclocked, power works fine on my other pi. I’ve since changed the SD card and a new install.
It only seems to happen once it’s tried to display a “strange” character. I don’t have an identical model pi else I would swap SD card.
edit I swapped power supply but it’s exactly the same

Does it clear up if you issue

stty sane


nope, tried as superuser too but nothing :-/

That’s a weird one! Sorry I’m out of suggestions.

Strange things will happen when you emmit ANSI control character to the console. Since karaf shell behaves like real shell it reacts on such things (ie to color some lines, bold some text and so on). If you would be so kind to tell us what this strange character is so we can isolate issue and check with Karaf shell. List of characters karaf may react is here:

And if it is that, you should be able to fix this with:

echo -e “\033c”

1 Like

Where can I find the actual log file which is displayed when log:tail is used? As in, where is it located in the directory structure?
That way I can find the offending character. :slight_smile:

It is in $OH_HOME/userdata/logs/openhab.log. For apt installation it will be /var/log/openhab2.

Correct! Thanks!

So what’s happening then? I can understand Raspbian being incapable of displaying anything but the basic of characters; but then to get itself into a state where it jumbles the display like this…
Surely this sort of problem should have been fixed years ago?

The line which triggers this behaviour begins this way:
(I’ve taken screenshot so you can see character correctly.)

I’ve no idea what that even is. Perhaps related to trying to create a switch item for my busch-jaeger zigbee switch (which doesn’t seem to be supported by the Hue binding - another issue)

@Benjy reply simply clear all control characters. It is a escape character which should cause terminal reset (clearing all control characters/switches being used).

But this is not yet caused by that - source of troubles sits in some of your configuration files. Try to find “Mac OS X” string which occurs in log: find /etc/openhab2 -type f -exec grep "Mac OS X" {} \;. You most likely have malformed configuration.

I’ll try that, but it’s a brand new install.
All I’ve done is add hue binding and lightwaverf binding.
Nothing else.


[19:06:39] pi@openHABianPi:/var/log/openhab2$ find /etc/openhab2 -type f -exec grep "Mac OS X" {} \;
Binary file /etc/openhab2/services/._openhab.cfg matches
Binary file /etc/openhab2/._.DS_Store matches

The files contain weird strings, I’ll remove the files - no idea where they came from

You have somehow malformed file. By default openhab.cfg should be text file but for some reason it become a binary file. I’m not even sure if it’s necessary for OH2. Remove these two matched files and problem will dissapear. :slight_smile:

Thanks Łukasz, files removed, problem removed :slight_smile: