ec2 serial console utf8

0

Hello,

I have an application which uses qrencode to output a QR code to an EC2 instance serial port, qrencode is outputting in using UTF8 format which doens't seem to be understood completely by the web based serial port application:

Enter image description here

The same application works correctly on an Azure VM when outputting to the serial port.

Outputting use ANSI format render correctly, however the QR code is too large to be scanned in that case.

Is there any way I can configure the web based serial port application to understand UTF8?

Thanks, Peter.

  • While the formatting you're seeing is undesirable; a question: Why the need to output QR codes to a serial port? Most of the time, serial ports are for last-ditch debugging and access to servers; outputting a QR code would seem to be a pretty advanced use of that access method so I'm curious as to the why.

  • Without going into too much detail, our pending EC2 AMI market place offer is a network appliance and requires 2FA before we can onboard it onto a larger network. I agree using the serial port to output a QR code isn't your standard use of a serial port, though it is a good way to ensure that the person who deployed the instance (or has access to the instance via IAM) is authorised to onboard the appliance to a larger network.

질문됨 2년 전387회 조회
1개 답변
0

To figure out the locale setting of your instance, please kindly check the output of locale command and try editing /etc/environment file through the following steps.

  1. Check locale command and open the /etc/environment file. $ locale $ sudo nano /etc/environment

  2. Add the following lines:


LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" LC_CTYPE="en_US.UTF-8"

  1. "Ctrl + X" to exit
  2. "Y" to confirm the change
  3. Press ENTER key

NB: This is a system wide setting.

If your application still faces error, please attach the same for further analysis.

AWS
지원 엔지니어
Jeff_B
답변함 2년 전
  • Thanks Jeff,

    Still seeing the same issue after switching locales. My system (debian based linux vm) looks like this by default:

    me@cpe:$ locale -a C C.UTF-8 POSIX gnos@cpe:$ locale LANG=C.UTF-8 LANGUAGE= LC_CTYPE="C.UTF-8" LC_NUMERIC="C.UTF-8" LC_TIME="C.UTF-8" LC_COLLATE="C.UTF-8" LC_MONETARY="C.UTF-8" LC_MESSAGES="C.UTF-8" LC_PAPER="C.UTF-8" LC_NAME="C.UTF-8" LC_ADDRESS="C.UTF-8" LC_TELEPHONE="C.UTF-8" LC_MEASUREMENT="C.UTF-8" LC_IDENTIFICATION="C.UTF-8" LC_ALL= me@cpe:~$

    I installed the US utf8 and set it as default:

    root@ip-10-0-0-196:/home/me# locale LANG=en_US.UTF-8 LANGUAGE= LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL=en_US.UTF-8 root@ip-10-0-0-196:/home/me#

    Though the QR code is showing unrenderable chars as '?' (can't seem to attach the image)...

    root@ip-10-0-0-196:/home/me# /usr/bin/qrencode -t ANSIUTF8 -o /dev/console "sampletextto test the qr code stuff"

    Thanks, Peter.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠