I am using the GSM/GPRS/GNSS HAT for raspberry pi zero and after running a simple script

import serial   
import os, time
# Enable Serial Communication
port = serial.Serial("/dev/ttyAMA0", baudrate=115200, timeout=1)
# Transmitting AT Commands to the Modem
# '\r\n' indicates the Enter key
rcv = port.read(10)
print rcv

this outputs for me AT and then OK but sometimes different unexpected characters are shown so I decided to use minicom to figure out whats going on and the moment I connect with minicom the GSM module starts sending random characters. Is that a hardware fault or is it possible to be serial configuration fault ? When i type AT it repeats each character twice

Update 1: After disabling serial console thanks to @dougie's commentit stopped spamming characters but the moment I type something the character is repeated. but this was solved when i sed a python script instead of typing.

  • 1
    Have you disabled the "serial console" in sudo raspi-config or with the GUI preferences dialog? – Dougie Oct 4 '19 at 21:17
  • 1
    Disable the "serial console" (which shows up as console=ttyAMA0,115200 in a cat /proc/cmdline command). – Dougie Oct 4 '19 at 21:19
  • 1
    In cat /proc/cmdline there isconsole=ttyl how do i disable the serial console from there ? I used sudo raspi-config -> Interfacing options -> Serial -> enable, should I disable this ? @Dougie – Essam Gouda Oct 4 '19 at 21:27
  • 1
    I disabled the serial console my output can be shown in the updated post. – Essam Gouda Oct 4 '19 at 21:32
  • 1
    @Dougie if u can submit disabling serial console as an answer I will verify its the correct answer thanks for your help ! – Essam Gouda Oct 4 '19 at 21:40

Disable the "serial console" (which shows up as console=ttyAMA0,115200 in a cat /proc/cmdline command).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.