Example code
# AT Command Examples
import serial
ser = serial.Serial('/dev/ttyUSB0', 115200)
def send_at(cmd, timeout=1):
ser.write((cmd + '\r\n').encode())
time.sleep(timeout)
return ser.read(ser.in_waiting).decode()
# Initialize
send_at('AT')
send_at('AT+CPIN?') # Check SIM
send_at('AT+CSQ') # Signal strength
send_at('AT+CGPS=1') # Enable GPS
# Send SMS
send_at('AT+CMGF=1')
send_at('AT+CMGS="+1234567890"')
ser.write(b'Hello from DENDAT\x1a')
# HTTP GET
send_at('AT+HTTPINIT')
send_at('AT+HTTPPARA="URL","http://api.dendat.ai/ping"')
send_at('AT+HTTPACTION=0')