0

I am facing this issue that I can't solve, I've been on this like 3 days and it is really frustrating!

I'm trying to test AT commands through port serial0, I've tried it in a python file and when i send the command it return the command in string instead of the "OK" response i am waiting for. I also tried to send command through screen/picocom but here the thing is that when I type the command and press enter it does nothing but return the prompt to the begining of the line.

I've followed many tutorials doing the same over these 3 days without success, I believe I have the right connections between the Raspberry Pi and the GSM module. My raspberry model is an RPi 3B model v1.2 and the GSM module is SIM808 EVB v3.2 if that helps.

import serial
import RPi.GPIO as gpio

port = serial.Serial("/dev/serial0", baudrate=9600, timeout=1)

port.write(b'AT'+b'\r\n')
rcv = port.read(100)
print(rcv)

that returns b'AT\r\n' as response instead of the "OK" that proves communication was successful.

  • 1
    you know what's easier to work with than a "picture of code"? .... code – Jaromanda X Dec 19 '18 at 23:57
  • what does that means? O_o sorry for the ignorance – Frank Guerra Dec 19 '18 at 23:59
  • don't be like that - was my way of suggesting you post the code ... though, looking at it, it probably isn't doing anything wrong, perhaps the device you're connected to is – Jaromanda X Dec 20 '18 at 0:00
  • when you refer to "code" i think and i'm really sure, that's actually the only piece of code i wrote for the process in python, the other thing i wrote was console commands that's it, that's why i only posted that photo and nothing else, do you need to know exactly the console commands i used or something like that? – Frank Guerra Dec 20 '18 at 0:04
  • 1
    He/She is saying that you should copy/paste the code into your question, not take a picture of it. This is done for a couple of reasons. It takes it much easier for people to read, they can set font size in their browser and dont have to try and zoom in on a compressed image. It also makes it much easier for someone to copy into their own enviorment to try out or to make changes and post it as part of their answer. It is also much harder to spot typos/syntax issues in a picture rather then actual text. – Chad G Dec 20 '18 at 0:19

Your Answer

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

Browse other questions tagged or ask your own question.