fromJPN
Posts: 14
Joined: Wed Dec 13, 2017 3:40 am

abnormal display result of cal command on serial0 port

Mon Nov 12, 2018 2:53 am

Hello.
please tell me. :)

1) my environment: 2017-07-05-raspbian-jessie-lite.img on raspberry pi 3 model B.

2) I conected a serial cable bitwin a terminal(Tera Term on Windows XP) and GPIO physical pins 15,16(serial0 port).

3) The display of the prompt, the command I input, the display of the execution result of the command are displayed without any problems at this terminal.

4) However, the result of the cal command is abnormal in display.

5) For example, if it is normal, it should appear as follows. Also, today's date "12" should be displayed with the color reversed.

Code: Select all

# cal
   November 2018
Su Mo Tu We Th Fr Sa
             1  2  3
 4  5  6  7  8  9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30
6) However, when I run the cal command at this terminal, it looks like this.

Code: Select all

# cal
   November 2018
Su Mo Tu We Th Fr Sa
             1  2  3
 4  5  6  7  8  9 10
11 $<2>12$<2> 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30
7) Today's date is indicated as "$<2>12$<2>". Also, the part of "$<2>12" was displayed with the color reversed.

8) This abnormal phenomenon occurs on the display of the terminal connected to serial0 port, but it does not occur on tty1 (screen connected to HDMI).

I looked for information about this phenomenon, but I could not find it. :shock:

Please tell me how to solve this problem.

User avatar
allfox
Posts: 452
Joined: Sat Jun 22, 2013 1:36 pm
Location: Guang Dong, China

Re: abnormal display result of cal command on serial0 port

Mon Nov 12, 2018 4:32 am

I see OP's name is fromJPN, so replying with Japanese.

こんにちは

まず、raspbian jeesieはもう古いので、新しいraspbian stretchにしたほうがいいですね。古いPiハードでも大丈夫。

この文字化けみたいな"$<2>12$<2>"は色をかえるためのエスケープ文字列と思います。

お使いのPCターミナルプログラムと、PiのOSが認識してるターミナルタイプが異なる時に、このような現象が発生します。

PCのターミナルプログラムを、PuTTYにかえだら、たぶん、解決できます。

fromJPN
Posts: 14
Joined: Wed Dec 13, 2017 3:40 am

Re: abnormal display result of cal command on serial0 port

Wed Nov 14, 2018 12:40 am

to allfox

日本語で返信してくださり、どうもありがとうございました。 ;)
あなたのヒントから、私は stretch と PuTTY を実験しました。

なるほど、cal コマンドの表示について、stretch では正常な表示でした。
私は Jessie のターミナルとして PuTTY を使ってみましたが、この現象は改善されませんでした。

しかし、Jessie は、このようなくだらないバグがいくつかありますが、大筋で動きます。
stretch は、フリーズするような致命的なバグがあったりして、まだ私は使いたくないです。
私は気持ちがすっきりしない。。。 :(

とにかく、どうもありがとうございました。 :)


to allfox

Thank you very much for replying in Japanese. ;)
From your hint, I experimented with stretch and PuTTY.

Indeed, regarding the display of cal command, stretch showed normal display.
I have tried use to PuTTY as a terminal of Jessie, but that phenomenon was not improved.

But, Jessie has some such silly bugs, but it works largely.
Stretch has fatal bugs that it freezes, and I don't want to use it yet.
I don't feel clearer... :(

Anyway, thank you very much. :)

bertlea
Posts: 277
Joined: Wed Dec 07, 2016 6:33 am
Location: Hong Kong

Re: abnormal display result of cal command on serial0 port

Wed Nov 14, 2018 3:43 am

I don't have this issue using Jessie (4.9.35+ #1014) on Pi Zero W when connected it using Putty from Windows 7. It may be related to the default language coding. Maybe the "today" highlight escape code is interpreted differently in Shift-JS?

fromJPN
Posts: 14
Joined: Wed Dec 13, 2017 3:40 am

Re: abnormal display result of cal command on serial0 port

Thu Nov 15, 2018 1:31 am

to bertlea

Thank you very much for your reply. ;)

Your console screen is connected to 'ttyS0 on Jessie (4.9.35+ # 1014)', is not it?

I chose "en_GB.UTF - 8 UTF - 8 en_GB.UTF - 8" in "config locales" of "raspi - config".

I observed it using 'raspberry pi zero W', which was also an abnormal display result.

I installed again (4.9.35 + # 1014) and observed again before, but it was still an abnormal display result.

I did "apt-get update apt-get upgrade" again, but again it was an abnormal display result.

As the "stretch" worked normally, PC settings and terminal software relationships were found innocent.

What is different between me and your "Jessie (4.9.35 + # 1014)"? :?:

OTL :cry: (Thank you)

bertlea
Posts: 277
Joined: Wed Dec 07, 2016 6:33 am
Location: Hong Kong

Re: abnormal display result of cal command on serial0 port

Thu Nov 15, 2018 3:18 am

Sorry, I do not use serial port connection and as your Stretch version is fine, so I guess the issue is really about the serial port driver. So if you use SSH over LAN or WIFI to connect to the same Pi, there is not such problem?

fromJPN
Posts: 14
Joined: Wed Dec 13, 2017 3:40 am

Re: abnormal display result of cal command on serial0 port

Thu Nov 15, 2018 6:38 am

to bertlea

The abnormal display is only when using the serial port.
It is correctly displayed on LAN or WiFi SSH.
Because stretch displays correctly, I thought that the BUG was fixed.
This problem seems not to be the reason for my setting being incorrect.
I'm sorry, I will give up. :|

Thank you very much. ;)

Return to “General discussion”