我需要一段代码来帮助我通过短信与华为3G加密狗发送天气预报。AT命令在python的短信文本中发送
它的工作,但这里是我得到:
AT+CMGF=1
AT+CMGS="+12345678"
It's partly cloudy and 20C now in Wahren.
为什么我收到那些AT字符串?
import pywapi
import string
import serial
weather_com_result = pywapi.get_weather_from_weather_com('AGXX0006')
sms_text = "It's " + string.lower(weather_com_result['current_conditions']['text']) + " and " + weather_com_result['current_conditions']['temperature'] + "C now in Wahren.\n\n"
dongle = serial.Serial(port="COM6",baudrate=460800,timeout=0,rtscts=0,xonxoff=0)
def sendatcmd():
number = "+12345678"
dongle.write('AT+CMGF=1\r')
dongle.write('AT+CMGS=&