当我运行此python代码从gsm发送短信时,我收到了一条消息
内容不受支持
import serial
import time
ser = serial.Serial("/dev/ttyAMA0",baudrate=9600)
time.sleep(1)
ser.write('ATE0\r')
time.sleep(1)
ser.write('ATZ\r')
time.sleep(1)
ser.write('AT+CMGF=1\r')
time.sleep(1)
ser.write('AT+CMGS= "+989337282702" \r')
time.sleep(1)
ser.write('hi \r')
time.sleep(1)
ser.write(chr(26))
time.sleep(1)
print 'sent successfully'