How do you send AT GSM commands using python?

别来无恙 提交于 2019-12-02 21:06:45

I do it like this with pyserial:

import serial

serialPort = serial.Serial(port=1,baudrate=115200,timeout=0,rtscts=0,xonxoff=0)
def sendatcmd(cmd):
    serialPort.write('at'+cmd+'\r')

print 'Loading profile...',
sendatcmd('+npsda=0,2')

Then I listen for an answer...

I don't know if there is an AT module, but you can use pyserial to communicate with a serial port.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!