I created this python script on rpi2, the message goes through, but it is a blank message. Is it a encoding issue?
import serial
import time
from sys import version_info
from curses import ascii
phone = serial.Serial("/dev/ttyAMA0", 115200, timeout=0.5)
def send_text(number,message):
phone.write(b'AT+CMGF=1\r')
phone.write(b'AT+CMGS="' + number.encode() + b'"\r')
phone.write(message.encode())
phone.write(ascii.ctrl('z'))
for i in range(len(reply)):
reply[i] = reply[i].rstrip()
print reply
AT commands (where 0000000000 is a 10 digit mobile number) in Minicom, still blank message
minicom -D /dev/ttyAMA0 -b 115200 -o
AT
OK
AT+CMGS="0000000000"
>Hello
<ctrl-z>
+CMGS: 14
OK
\r
, good. But you should never, never, ever use sleep as a substitute for waiting for the Final result code from the modem. See this answer for details. Without fixing that you will never get any of your AT command code to behave reliably. – CeliotomyAT+CSMP=17,167,0,0
– Antimonic