Hiro
Posts: 78
Joined: Fri Dec 30, 2011 11:09 am

Serial to TTY adaptor

Sun Dec 08, 2013 4:59 pm

I recently acquired a serial to tty adaptor and set about getting it working. There was loads of info on the net and i have managed to get it working but still have one issue i can find no answer for.

I have to manually start ttyAMA0 with "sudo /sbin/agetty 115200 ttyAMA0 vt102 &" from the command line and can then log in from my Windows machine using putty in serial mode and everything works as it should.

When i log off from the Windows machine ttyAMA0 stops running and i have to restart it to log back in again. At the moment i can do this as i still have a ethernet cable tothe Pi but i want to remove this and use serial only.

I edited /boot/cmdline.txt and removed "console=ttyAMA0,115200 kgdboc=ttyAMA0,115200" and edited /etc/inittab and commented out the line "T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100" as i though i had read that would do as i want but it hasn't. I did reboot after the changes.

Does anybody know what i need to do to get ttyAMA0 to start at boot and stay running all the time?
Cheers, Hiro.

EDIT: When i do log on remotely i get the message "-bash: no job control in this shell" don't know if that's important or not.

User avatar
jojopi
Posts: 3141
Joined: Tue Oct 11, 2011 8:38 pm

Re: Serial to TTY adaptor

Sun Dec 08, 2013 5:33 pm

Hiro wrote:Does anybody know what i need to do to get ttyAMA0 to start at boot and stay running all the time?
That is precisely the purpose of the line in /etc/inittab that you have commented out. The advice to disable the getty is for people who want to use the UART for outbound connections to a modem, microcontroller, GPS receiver, rather than to log in over.

You might also want to keep the references to ttyAMA0 in /boot/cmdline.txt. These allow you to see boot and system messages over the UART, send magic SysRq commands using a serial break, and reboot or debug the kernel remotely in the event of a crash.

"no job control" means that the shell is not interactive, has no controlling terminal, or cannot become a session leader. Hopefully this will go away when the getty is started normally.

Hiro
Posts: 78
Joined: Fri Dec 30, 2011 11:09 am

Re: Serial to TTY adaptor [Soolved]

Sun Dec 08, 2013 6:43 pm

I see, i just followed some instructions on the net and i suppose they must have been trying to achieve what you suggest instead of what i wanted. I have reinstated the original line in /etc/inittab and it now all works as i wanted. As a bonus the "no job control" error has gone as you suggested it might.

Thanks very much for your help jojopi.

Cheers, Hiro.

Return to “Troubleshooting”