Linux 下利用gnokii 调用短信猫发送短,突然就不能发送了,更换短信猫也是那样

缘沐 2017-02-14 03:42:47
[root@localhost ~]# echo "测试正常" |gnokii --sendsms XXXXXXXXXXX
GNOKII Version 0.6.31
LOG: debug mask is 0x1
Config read from file /etc/gnokiirc.
phone instance config:
model = AT
port = /dev/ttyUSB0
connection = serial
initlength = default
serial_baudrate = 9600
serial_write_usleep = -1
handshake = software
require_dcd = 0
smsc_timeout = 10
rfcomm_channel = 0
sm_retry = 0
Initializing AT capable mobile phone ...
Serial device: opening device /dev/ttyUSB0
Serial device: setting RTS to high and DTR to high
Message sent: 0x00 / 0x0004
41 54 5a 0d | ATZ
write: [ATZ<cr>]
read : [ATZ<cr><cr><lf>OK<cr><lf>]
Message received: 0x00 / 0x000a
02 41 54 5a 0d 0d 0a 4f 4b 0d | ATZ OK
Received message type 00
Message sent: 0x00 / 0x0005
41 54 45 31 0d | ATE1
write: [ATE1<cr>]
read : [OK<cr><lf>]
Message received: 0x00 / 0x0004
02 4f 4b 0d | OK
Received message type 00
Message sent: 0x00 / 0x000a
41 54 2b 43 4d 45 45 3d 31 0d | AT+CMEE=1
write: [AT+CMEE=1<cr>]
read : [AT+CMEE=1<cr><cr><lf>OK<cr><lf>]
Message received: 0x00 / 0x0010
02 41 54 2b 43 4d 45 45 3d 31 0d 0d 0a 4f 4b 0d | AT+CMEE=1 OK
Received message type 00
Message sent: 0x06 / 0x0007
41 54 2b 47 4d 4d 0d | AT+GMM
write: [AT+GMM<cr>]
read : [AT+GMM<cr><cr><lf>TC35<cr><lf><cr><lf>OK<cr><lf>]
Message received: 0x06 / 0x0015
02 41 54 2b 47 4d 4d 0d 0d 0a 54 43 33 35 0d 0a | AT+GMM TC35
0d 0a 4f 4b 0d | OK
Received message type 06
Message sent: 0x06 / 0x0008
41 54 2b 43 47 4d 49 0d | AT+CGMI
write: [AT+CGMI<cr>]
read : [AT+CGMI<cr><cr><lf>SIEMENS<cr><lf><cr><lf>OK<cr><lf>]
Message received: 0x06 / 0x0019
02 41 54 2b 43 47 4d 49 0d 0d 0a 53 49 45 4d 45 | AT+CGMI SIEME
4e 53 0d 0a 0d 0a 4f 4b 0d | NS OK
Received message type 06
Message sent: 0x63 / 0x0009
41 54 2b 43 53 43 53 3f 0d | AT+CSCS?
write: [AT+CSCS?<cr>]
read : [AT+CSCS?<cr><cr><lf>+CSCS: "GSM"<cr><lf><cr><lf>OK<cr><lf>]
Message received: 0x63 / 0x001f
02 41 54 2b 43 53 43 53 3f 0d 0d 0a 2b 43 53 43 | AT+CSCS? +CSC
53 3a 20 22 47 53 4d 22 0d 0a 0d 0a 4f 4b 0d | S: "GSM" OK
Received message type 63
Initialisation completed
Message sent: 0x23 / 0x0009
41 54 2b 43 53 43 41 3f 0d | AT+CSCA?
write: [AT+CSCA?<cr>]
read : [AT+CSCA?<cr><cr><lf>+CSCA: "+8613010851500",145<cr><lf><cr><lf>OK<cr><lf>]
Message received: 0x23 / 0x002e
02 41 54 2b 43 53 43 41 3f 0d 0d 0a 2b 43 53 43 | AT+CSCA? +CSC
41 3a 20 22 2b 38 36 31 33 30 31 30 38 35 31 35 | A: "+86130108515
30 30 22 2c 31 34 35 0d 0a 0d 0a 4f 4b 0d | 00",145 OK
Received message type 23
=====> ENTER gn_sms_send()
enc_chars: 6
ext_chars: 0
total: 12
size of the input string: 18 bytes
number of characters in the input string: 6 chars
=====> ENTER sms_send_single()
General Data Coding
UCS-2
dcs: 0x08
Length: 0x0c
user_data_length: 0x0c
ValidityIndicator: 2
user_data: 59167F516D4B8BD56B635E38
Input is 18 bytes long
SMS is 12 octets long
Sending
Message sent: 0x65 / 0x000a
41 54 2b 43 4d 47 46 3d 30 0d | AT+CMGF=0
write: [AT+CMGF=0<cr>]
read : [AT+CMGF=0<cr><cr><lf>OK<cr><lf>]
Message received: 0x65 / 0x0010
02 41 54 2b 43 4d 47 46 3d 30 0d 0d 0a 4f 4b 0d | AT+CMGF=0 OK
Received message type 65
PDU mode set
Sending initial sequence
Message sent: 0x66 / 0x000b
41 54 2b 43 4d 47 53 3d 32 36 0d | AT+CMGS=26
write: [AT+CMGS=26<cr>]
read : [AT+CMGS=26<cr><cr><lf>> ]
Message received: 0x66 / 0x000f
01 41 54 2b 43 4d 47 53 3d 32 36 0d 0d 0a 3e | AT+CMGS=26 >
Received message type 66
Got response: No error.
Sending frame: 0891683110801505F011000B813127503531F50008AA0C59167F516D4B8BD56B635E38
Message sent: 0x21 / 0x0047
30 38 39 31 36 38 33 31 31 30 38 30 31 35 30 35 | 0891683110801505
46 30 31 31 30 30 30 42 38 31 33 31 32 37 35 30 | F011000B81312750
33 35 33 31 46 35 30 30 30 38 41 41 30 43 35 39 | 3531F50008AA0C59
31 36 37 46 35 31 36 44 34 42 38 42 44 35 36 42 | 167F516D4B8BD56B
36 33 35 45 33 38 1a | 635E38
write: [0891683110801505F011000B813127503531F50008AA0C59167F516D4B8BD56B635E38^Z]
read : [^A^491683110801505F011000B813127503531F50008AA0C59167F516D4B8BD56B635E38^Z<cr><lf>+CMS ERROR: 500<cr><lf>]
Message received: 0x21 / 0x005a
04 01 f4 39 31 36 38 33 31 31 30 38 30 31 35 30 | 9168311080150
35 46 30 31 31 30 30 30 42 38 31 33 31 32 37 35 | 5F011000B8131275
30 33 35 33 31 46 35 30 30 30 38 41 41 30 43 35 | 03531F50008AA0C5
39 31 36 37 46 35 31 36 44 34 42 38 42 44 35 36 | 9167F516D4B8BD56
42 36 33 35 45 33 38 1a 0d 0a 2b 43 4d 53 20 45 | B635E38 +CMS E
52 52 4f 52 3a 20 35 30 30 0d | RROR: 500
Received message type 21
SMS Send failed (Unknown error - well better than nothing!!)
Serial device: closing device
...全文
1134 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
这是一门linux下c++通讯架构实战课程,针对c/c++语言已经掌握的很熟并希望进一步深造以将来用c++在linux下从事网络通讯领域/网络服务器的开发和架构工作。这门课程学习难度颇高但也有着极其优渥的薪水(最少30K月薪,最高可达60-80K月薪),这门课程,会先从nginx源码的分析和讲解开始,逐步开始书写属于自己的高性能服务器框架代码,完善个人代码库,这些,将会是您日后能取得高薪的重要筹码。本课程原计划带着大家逐行写代码,但因为代码实在过于复杂和精细,带着写代码可能会造成每节课至少要4~5小时的超长时间,所以老师会在课前先写好代码,主要的时间花费在逐行讲解这些代码上,这一点望同学们周知。如果你觉得非要老师领着写代码才行的话,老师会觉得你当前可能学习本门课程会比较吃力,请不要购买本课程,以免听不懂课程并给老师差评,差评也会非常影响老师课程的销售并造成其他同学的误解。 这门课程要求您具备下面的技能:(1)对c/c++语言掌握的非常熟练,语言本身已经不是继续学习的障碍,并不要求您一定熟悉网络或者linux;(2)对网络通讯架构领域有兴趣、勇于挑战这个高难度的开发领域并期望用大量的付出换取高薪;在这门课程中,实现了一个完整的项目,其中包括通讯框架和业务逻辑框架,浓缩总结起来包括如下几点:(1)项目本身是一个极完整的多线程高并发的服务器程序;(2)按照包头包体格式正确的接收客户端发送过来的数据包, 完美解决收包时的数据粘包问题;(3)根据收到的包的不同来执行不同的业务处理逻辑;(4)把业务处理产生的结果数据包正确返回给客户端;本项目用到的主要开发技术和特色包括:(1)epoll高并发通讯技术,用到的触发模式是epoll中的水平触发模式【LT】;(2)自己写了一套线程池来处理业务逻辑,调用适当的业务逻辑处理函数处理业务并返回给客户端处理结果;(3)线程之间的同步技术包括互斥量,信号量等等;(4)连接池中连接的延迟回收技术,这是整个项目中的精华技术,极大程度上消除诸多导致服务器程序工作不稳定的因素;(5)专门处理数据发送的一整套数据发送逻辑以及对应的发送线程;(6)其他次要技术,包括信号、日志打印、fork()子进程、守护进程等等;

1,025

社区成员

发帖
与我相关
我的任务
社区描述
Linux /Unix kernel支持不同的硬件体系,X86, ARM, MIPS, 等等
社区管理员
  • CPU和硬件区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧