login prompt not reading keyboard entries properly in serial port
Linux - Embedded & Single-board computerThis forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
login prompt not reading keyboard entries properly in serial port
In my embedded Linux (2.6) I am trying to enable login in serial port, so that after booting I should get the login prompt. I am using ttyS1 and in the /etc/inittab file I added this line to enable the login.
Now I am gettig the login prompt but while typing the user name the login screen displays only alternate characters in the username (eg: if I type guest the screen displays ust), and unable to login also.
Instead of /bin/login tried using /sbin/getty, here also the scenario is same. With getty we can give the baud rate as a parameter, so I tried all standard baud rates but nothing worked.
minicom is my serial port interface. What will be the issue ? Need help
I would read the docs under linux/Documentation for your 2.6 kernel regarding kernel parameters. Which login and which getty version? There are more than one in the world.
You would need to configure minicom serial parameters for 9600, no parity, 8 bits, 1 stop bit and the port used on the computer connected to the SBC. Without knowing anything about your embedded device it is difficult to determine the problem.
Still trying to solve the issue. The minicom serial port parameters are, no parity, 8 bits, 1 stop bit and the my default baud rate is 57600.
The board is using the second UART so in the embedded Linux the serial port is /dev/ttyS1.
I cross compiled the latest version of busybox and tested, then also the issue is same. Doing further debugging I found that the login is using fgets for reading the username. So I created a small application and invoked it from the inittab (temporarily removed the login)
Now after booting, the above application start respawning
Enter something: guest
gString Read: uest
Enter something: guest
String Read: guest
Enter something: guest
gString Read: uest
Enter something: guest
String Read: guest
Enter something: (PRESSED ENTER KEY TWO TIMES)
/bin/sh: gg: not found
/ #
In the above example we can see that sometimes the first character is not going to the str[] buffer, it is read by the shell. After this if I give two enters continuously it shows
/bin/sh: gg: not found (gg is the two characters which are not read by the str[]).
This scenario is not only for the first characters, happening for intermediate characters also.
If I do ssh to this Linux and run this application, this reads full characters with out any drop.
Please help
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.