3

I am working on integrating Sim900a on Rpi3B. As usual connecting to TX->Rx, Rx->Tx (GPIO14, GPIO15 in Rpi) - following diagram from this link: How do I connect GSM SIM 900A to a Raspberry Pi 3?

When I testing using Minicom 2.7x, it shows below error. My minicom setting using serial /dev/ttyS0 and baudrate 9600 (as baudrate 15200 got jammed the console and no response)

raspberrypi login:

raspberrypi login:

raspberrypi login:

raspberrypi login:

raspberrypi login:

raspberrypi login:

raspberrypi login:

ERROR

The error occurs even before typing AT command and it loop the error many times.

I tried to connect the Sim900A module to UART->USB converter, and connect to Windows 10 laptop, tested it using Putty, COM7 with baudrate 9600, It all works well.

Any solution?

Additional info on my Sim900a: Manufacture: Simcom Model:SIM900A S2-104V-Z094T

Mr Hery
  • 83
  • 4
  • 1
    Troubleshooting suggestion 1: Try Rpi CuteCom to talk to Win10Putty, to make sure Rpi Tx/Rx wiring is OK. – tlfong01 Jan 22 '20 at 01:20
  • Related: https://raspberrypi.stackexchange.com/questions/90013/uart-rx-stops-reading-data-after-working-correctly/90015#90015 – Dmitry Grigoryev Feb 11 '20 at 09:17

1 Answers1

4

This seems to be a rather basic issue: your system is configured to provide a login shell (and possibly kernel boot messages) over the UART. You need to disable it in order to use the serial for your own purposes.

This can be done using sudo raspi-config (go to Advanced Functions - Serial and select "No" to disable the shell over the serial port), then reboot. Normally that's all that should be needed.

Alternatively disabling kernel boot messages can also be done by removing console=ttyAMA0,115200 (or something similar) from /boot/cmdline.txt (this one needs a reboot). Disabling the login shell can be done by running sudo systemctl stop getty@ttyAMA0 (this one is effective immediately, until a reboot). You can also disable it permanently with sudo systemctl disable serial-getty@ttyAMA0.service

Dmitry Grigoryev
  • 27,928
  • 6
  • 53
  • 144
  • You are correct. But I found other thing about "getty". Can you explain it? Then I will make your answer as correct. I disable the "getty" thing and do your raspi-config suggestion, and it worked perfectly. – Mr Hery Feb 05 '20 at 07:36
  • @MrHery See if it's clearer now. Actually, raspi-config should have stopped getty under the hood, but indeed there's a command to do it manually. – Dmitry Grigoryev Feb 05 '20 at 11:55
  • Its clearer now. Nice explanation. What does getty do? – Mr Hery Feb 06 '20 at 08:31
  • 2
    getty is a process that monitors a terminal, spawning a specified command on it (in your case, login) when someone opens it for data transmission. login then would ask for a login/password and spawn the user's shell (bash) if the password is correct, or simply terminate. In both cases, when there's no more processes on a terminal (you type the wrong password, or you enter the correct password and then exit bash), getty will re-spawn login again. Obviously, SIM900A sends some data though the UART, but it looks nothing like a correct username / password to login. – Dmitry Grigoryev Feb 07 '20 at 08:02