短信设备调用的时候,srv.startService();报的这个错,高手帮

分享
[QC] INFO [main] org.smslib.Service.listSystemInformation(113) SMSLib: A Java API library for sending and receiving SMS via a GSM modem or other supported gateways.
This software is distributed under the terms of the Apache v2.0 License.
Web Site: http://smslib.org
[QC] INFO [main] org.smslib.Service.listSystemInformation(114) Version: 3.5.2
[QC] INFO [main] org.smslib.Service.listSystemInformation(115) JRE Version: 1.7.0_71
[QC] INFO [main] org.smslib.Service.listSystemInformation(116) JRE Impl Version: 24.71-b01
[QC] INFO [main] org.smslib.Service.listSystemInformation(117) O/S: Windows 7 / amd64 / 6.1
map.get("comPort")=COM3
[QC] INFO [main] org.smslib.queues.DefaultQueueManager.init(92) Queue directory not defined. Queued messages will not be saved to filesystem.
[QC] INFO [Thread-3] org.smslib.modem.ModemGateway.startGateway(188) GTW: SMS: Starting gateway, using Generic AT Handler.
[QC] INFO [Thread-3] org.smslib.modem.SerialModemDriver.connectPort(65) GTW: SMS: Using polled serial port mode.
[QC] INFO [Thread-3] org.smslib.modem.SerialModemDriver.connectPort(68) GTW: SMS: Opening: COM3 @9600
WARNING: RXTX Version mismatch
Jar version = RXTX-2.2pre1
native lib Version = RXTX-2.2pre2
[QC] INFO [Thread-3] org.smslib.modem.SerialModemDriver.disconnectPort(120) GTW: SMS: Closing: COM3 @9600
[QC] INFO [main] org.smslib.modem.ModemGateway.stopGateway(197) GTW: SMS: Stopping gateway...
[QC] INFO [main] org.smslib.modem.SerialModemDriver.disconnectPort(120) GTW: SMS: Closing: COM3 @9600
[QC] INFO [main] org.smslib.modem.ModemGateway.stopGateway(201) GTW: SMS: Gateway stopped.
org.smslib.TimeoutException: No response from device.
Modem disconnected.
[QC] INFO [main] org.smslib.modem.ModemGateway.stopGateway(197) GTW: SMS: Stopping gateway...
[QC] INFO [main] org.smslib.modem.SerialModemDriver.disconnectPort(120) GTW: SMS: Closing: COM3 @9600
[QC] INFO [main] org.smslib.modem.ModemGateway.stopGateway(201) GTW: SMS: Gateway stopped.
at org.smslib.modem.AModemDriver$CharQueue.get(AModemDriver.java:535)
at org.smslib.modem.AModemDriver.getResponse(AModemDriver.java:338)
at org.smslib.modem.AModemDriver.getResponse(AModemDriver.java:313)
at org.smslib.modem.athandler.ATHandler.getSimStatus(ATHandler.java:145)
at org.smslib.modem.AModemDriver.connect(AModemDriver.java:132)
at org.smslib.modem.ModemGateway.startGateway(ModemGateway.java:189)
at org.smslib.Service$1Starter.run(Service.java:276)
短信设备二次开发 2个月前 1 0

admin

  • 注册时间 : 2022-03-30 04:08:47
  • 邮箱地址 : admin@tenghengkeji.com
  • 此页面用于展示用户的基本上资料信息

回帖 ( 1 )

  1. #1楼 admin
    2022-04-09 19:57:58
    0 0
    回复
    跟rxtx版本没关系,从错误来看rxtx2.2是支持64位JDK的,jre也是1.7.071的也是64位的没毛病
    问题比较大概率处在串口上,串口不能正常通讯导致超时抛出No response from device这个异常。
    针对这个smslib有几种情况会出现不能通讯超时异常呢?
    1、串口硬件层面问题不通(一般马上返回错误)
    2、波特率不对应设备波特率,9600改115200试试或者其他对应你的设备的波特率
    3、选用的品牌模块组指令不对,一般用wavecom或者西门子的指令比较通用或者留用用默认的标准指令,西门子和wavecom是早起领头企业现在国内等很多模块商的指令都基于这两个厂家开发延伸的所以用这个两个品牌指令跑通很多模块
    4、SIM卡上获取网络的指令返回太慢导致抛出串口不通异常,如at+cops相关指令,有些卡需要等待30-60秒,好像30秒后就超出smslib默认等待串口返回的延时时间,源码里面删除这个指令跳过就可以解决。(不改代码可以换张卡试试,有些卡时快时慢的,也可能硬件本身问题导致)