[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

Cheers,
Wayne

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)
Hmm

@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.

found:

[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: