在Raspberry Pi 2上使用AT命令和Python接收空白SMS SIM800

阿伦·K

我在rpi2上创建了这个python脚本,消息通过,但是它是空消息。这是编码问题吗?

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

Minicom中的AT命令(其中0000000000是10位手机号码),仍为空白消息

minicom -D /dev/ttyAMA0 -b 115200 -o

AT
OK
AT+CMGS="0000000000"
>Hello
 <ctrl-z>
+CMGS: 14
OK

GSM模块消息的屏幕截图

阿伦·K

文本模式参数存在问题下面的AT命令修复了它-

AT+CSMP=17,167,0,0

--info about it
AT+CSMP=<fo>,<vp>,<pid>,<dcs>
<fo>=17 Sets reply pat, user data header, status report request, validity period format, reject duplicates and message type.
<vp>=167 Sets validity period.
<pid>=0 Higher layer protocol indicator.
<dcs>=0 Information encode format.
OK Modem Response.

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

在Raspberry PI上使用Python的433MHz发送器和接收器

来自分类Dev

Raspberry Pi和GitLab

来自分类Dev

Python Raspberry Pi GPIO错误

来自分类Dev

NodeJS和Raspberry Pi

来自分类Dev

在Raspberry Pi上安装MongoDB

来自分类Dev

Raspberry Pi上的JavaFx Ensemble

来自分类Dev

Raspberry Pi 2 Netflix

来自分类Dev

Raspberry Pi上的Tensorflow

来自分类Dev

Raspberry Pi上的VLC流

来自分类Dev

在Raspberry Pi上使用pygame撕裂屏幕

来自分类Dev

如何在Arduino上获取实时GPS Sim800模块RTC时间

来自分类Dev

Raspberry Pi上的MAME ROM

来自分类Dev

从Raspberry Slave从Raspberry PI PI SPI读取与wireingPI2?

来自分类Dev

QEMU和Raspberry Pi

来自分类Dev

Raspberry Pi Python ValueError吗?

来自分类Dev

Raspberry Pi2上的FreeBSD

来自分类Dev

使用Raspberry Pi作为VPN?

来自分类Dev

使用spidev的linux(raspberry PI)上的SPI

来自分类Dev

Raspberry Pi 2 Netflix

来自分类Dev

在Raspberry PI上使用Python和OpenCV进行图像处理

来自分类Dev

在Raspberry Pi上使用qt显示ipaddress

来自分类Dev

DNXCore ARM在Raspberry Pi 2上发布

来自分类Dev

在Raspberry Pi上使用pygame撕裂屏幕

来自分类Dev

Raspberry Pi Zero上的Python非法指令

来自分类Dev

Raspberry Pi作为iBeacon接收器

来自分类Dev

如何通过AT命令了解SIM800模块的网络状态?

来自分类Dev

Raspberry Pi 2上的MongoDb性能

来自分类Dev

RPI上的SIM800 Sim应用程序工具包

来自分类Dev

如何使用SIM800的AT+HTTPHEAD