python - 你如何使用 python 发送 AT GSM 命令?

标签 python modem

我如何使用 python 发送 AT GSM 命令?

我能够使用 Delphi 和一些 comport 组件 (TComport) 很容易地做到这一点,但是我如何使用 python 与我的调制解调器通信?

加思

最佳答案

我用 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')

然后我听听答案...

关于python - 你如何使用 python 发送 AT GSM 命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/672366/

相关文章:

python - Django 支付集成

python - 我应该使用哪种数据库模型在运行时动态修改实体/属性?

at-command - 当 SIM 卡没有 PIN 时,如何使用 AT 命令更改/创建 SIM PIN?

c++ - 伪终端和串行设备之间奇怪的字符替换

c++ - 为什么这个串行/调制解调器代码会弄乱我的终端显示?

python - PyCharm 调用图总是在加载,如何解决?

Python 3,如何设置 Visual Studio C++ 2015 编译器?

Python eve ?where 查询返回空结果

c - 海斯 AT 命令 : Detect Remote Hangup?

java - 为什么 SerialEvent.RI 不起作用?