I've been trying to connect my sim800L to my Raspberry pi 3 model B (rasbian) but without success...
I'm at the very first step, and since I'm new to Raspberry pi, I don't understand very well how it works.
Here is how I'm trying to connect it:
After some research, I've found that I needed to add some things to the /boot/config.txt
file in order to enable the UART, so I've added this :
core_freq=250
enable_uart
Edit : my version is My version is 4.4.50-v7+ so I don't need enable_uart
After, I found out a code that matched what I'm trying to do, here it is:
import serial
import os, time
# Enable Serial Communication
port = serial.Serial('/dev/ttyS0', baudrate=9600, timeout=1)
# Transmitting AT Commands to the Modem
# '\r\n' indicates the Enter key
port.write('AT'+'\r\n')
rcv = port.read(10)
print rcv
But nothing is working in the Python Shell, no matter if I'm using ttyS0 or Serial0, when I try the AT command, which is supposed to answer OK if the sim800L is successfully connected. I'm getting some basic error (after typing AT):
>>> AT
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
AT
NameError: name 'AT' is not defined
How can I resolve this error?
AT
: try to writercv
instead ofAT
– Liam Apr 02 '17 at 14:25raspi-config
. You should use/dev/serial0
. You also need a ground connection. – Milliways Apr 03 '17 at 00:05Now I guess the problem is in my code..
– Max Apr 12 '17 at 17:38