AT model使用gnokii来收取短消息

Linux 2006/11/20 10:13
最近继续研究我们的那个at model无法读取短信的问题。
问题1:
每次使用gnokii --getsms SM 1命令来读取短信的时候,都会出现GetSMS SM 1 failed! (Command failed.) 的错误提示。用各大搜索引擎搜索了一下。总算在google上找到合适的方法。还是最近有人在gnokii-users mailing list上提出的bug。看来rp还不错,:D
主要出问题的原因就是AT指令错误。我们的AT model只能接受如下所示的指令:
AT+CPMS="SM","SM"
AT+CPMS="ME","ME"
而gnokii发送的指令却是这样的:
AT+CPMS="SM","SM","SM"
AT+CPMS="ME","ME","ME"
因此导致出错了,无法正常读取信息。需要修改源代码common/phones/atgen.c的function AT_SetSMSMemoryType()。然后重新make&&make install。

问题2:
使用gnokii附带的smsd程序来收发短信。smsd是一个后台运行的程序,会循环读取数据库或者文件,把需要发送的消息放入数据库或者文件中,smsd就会帮你发送出去,而收到的短信也会自动帮你存入数据库或者文件中。这样就可以很方便的在上面做2次开发。对我来说,这是一个很有用的工具。不过使用的过程中,发现有如下错误提示,导致无法成功运行:
GN_OP_GetSMSStatus at line 400 in file lowlevel.c returns error 1
Restarting connection.Serial device: closing device
幸运的是,在gnokii-users mailing list中还是成功的找到了解决的办法。还是gnokii的一个小bug,需要修改common/phones/atgen.c,具体的方法太繁琐,就不细说了。我把我修改后的atgen.c共享出来,有需要的同学可以自己下载。有兴趣的同学可以参看下面的链接,里面有关于这2个问题的详细讨论。
下载atgen.c

相关链接如下:
http://www.nabble.com/smsd-problem-with-AT-model-tf2174662.html#a6054611
http://www.nabble.com/smsd-problem-with-AT-model---Part-II-t2387168.html
top
  1. cai 2007/12/15 11:16 MODIFY/DELETE REPLY

    cai@dolpin:~$ gnokii --identify
    GNOKII Version 0.6.18
    LOG: debug mask is 0x1
    Config read from file /home/cai/.gnokiirc.
    phone instance config:
    model: 6510
    port_device: /dev/ttyUSB0
    connection_type: 2
    init_length: 0
    serial_baudrate: 19200
    serial_write_usleep: -1
    hardware_handshake: 0
    require_dcd: 0
    smsc_timeout: 100
    connect_script:
    disconnect_script:
    rfcomm_cn: 1
    sm_retry: off
    Connecting
    Serial device: opening device /dev/ttyUSB0
    Serial device: setting RTS to low and DTR to low
    Serial device: setting RTS to high and DTR to high
    Serial device: setting speed to 19200
    Switching to FBUS mode
    Serial device: setting speed to 115200
    Getting model...
    Message sent: 0x1b / 0x0006
    00 01 00 07 01 00 |
    SM_Block: exiting the retry loop
    Message sent: 0x1b / 0x0006
    00 01 00 07 01 00 |
    SM_Block: exiting the retry loop
    Message sent: 0x1b / 0x0006
    00 01 00 07 01 00 |
    SM_Block: exiting the retry loop
    Serial device: closing device
    Serial device: opening device /dev/ttyUSB0
    Serial device: setting speed to 115200
    Serial device: setting RTS to low and DTR to low
    Error in link initialisation: 4
    Telephone interface init failed: Problem occurred internal to model specific code.
    Quitting.
    Problem occurred internal to model specific code.



    $dmesg
    [ 167.796000] ark3116 1-2:0.0: ark3116 converter detected
    [ 167.824000] usb 1-2: ark3116 converter now attached to ttyUSB0
    ....
    [10175.924000] /build/buildd/linux-source-2.6.22-2.6.22/drivers/usb/serial/ark3116.c: can't set 0 baud, using 9600 instead

    如何解决呢?

  2. 耿志国 2008/01/24 23:31 MODIFY/DELETE REPLY

    LOG: debug mask is 0x1
    phone instance config:
    model: 3100
    port_device: /dev/ttyUSB0
    connection_type: 2
    init_length: 0
    serial_baudrate: 19200
    serial_write_usleep: -1
    hardware_handshake: 0
    require_dcd: 0
    smsc_timeout: 100
    connect_script:
    disconnect_script:
    rfcomm_cn: 1
    sm_retry: off
    Connecting
    Serial device: opening device /dev/ttyUSB0
    Gnokii serial_open: open: No such device
    Couldn't open FBUS device: No such device
    Error in link initialisation: 1
    Serial device: opening device /dev/ttyUSB0
    Gnokii serial_open: open: No such device
    Couldn't open FBUS device: No such device
    Error in link initialisation: 1
    Error in link initialisation: 1
    Telephone interface init failed: Command failed.
    我的配置文件:
    LOG: debug mask is 0x1
    phone instance config:
    model: 3100
    port_device: /dev/ttyUSB0
    connection_type: 2
    init_length: 0
    serial_baudrate: 19200
    serial_write_usleep: -1
    hardware_handshake: 0
    require_dcd: 0
    smsc_timeout: 100
    connect_script:
    disconnect_script:
    rfcomm_cn: 1
    sm_retry: off
    Connecting
    Serial device: opening device /dev/ttyUSB0
    Gnokii serial_open: open: No such device
    Couldn't open FBUS device: No such device
    Error in link initialisation: 1
    Serial device: opening device /dev/ttyUSB0
    Gnokii serial_open: open: No such device
    Couldn't open FBUS device: No such device
    Error in link initialisation: 1
    Error in link initialisation: 1
    Telephone interface init failed: Command failed.
    希望帮助一下,急用,zigo928@gmail.com

  3. hot toon 2008/03/13 04:51 MODIFY/DELETE REPLY

    이 위치는 유익한뿐 아니라 재미있는다!

  4. girly love quote 2008/03/13 05:41 MODIFY/DELETE REPLY

    너는 차가운 위치를 만들었다!

  5. tiger body paint 2008/03/13 06:30 MODIFY/DELETE REPLY

    아주 좋은 위치 나는 그것을 감사 좋아한다!

  6. nude robbie williams picture 2008/03/13 07:16 MODIFY/DELETE REPLY

    이 위치는 유익한뿐 아니라 재미있는다!

  7. amatuer fucking 2008/03/14 02:20 MODIFY/DELETE REPLY

    여보세요, 아주 좋은 위치!

  8. wet tee shirt college 2008/03/14 03:07 MODIFY/DELETE REPLY

    나의 친구는 너의 위치의 현재 팬이 되었다!

  9. flash photo gallery 2008/03/14 03:08 MODIFY/DELETE REPLY

    너는 차가운 위치를 만들었다!

  10. old men fucking old men 2008/05/23 03:30 MODIFY/DELETE REPLY

    너는 위치를차가운 만들었다!

  11. free fucking movie tit 2008/05/23 04:04 MODIFY/DELETE REPLY

    우수한 디자인!!

  12. quarter horse western pleasure 2008/05/23 04:35 MODIFY/DELETE REPLY

    관심을 끌. 너가 좋을 동일할 지점을.

  13. adult friend 2008/05/23 05:03 MODIFY/DELETE REPLY

    우수한 디자인!!

  14. hentai artist 2008/05/23 05:06 MODIFY/DELETE REPLY

    저에서 유사한 역사는 이었다.

  15. watch taboo charming mother online 2008/05/23 06:31 MODIFY/DELETE REPLY

    너의 방문한 위치를 즐기는!

  16. angelina jolie picture sexy 2008/05/23 06:48 MODIFY/DELETE REPLY

    걸출한 블로그!

  17. young teen love 2008/05/24 00:37 MODIFY/DELETE REPLY

    정말 같지 않는 블로그!

  18. naked girls and cars 2008/05/24 00:52 MODIFY/DELETE REPLY

    여기 이것은 뉴스 있다!

  19. father son holy ghost 2008/05/24 00:54 MODIFY/DELETE REPLY

    너는 아주 보는 좋은 위치가 있는다!

  20. ladies party dresses 2008/05/24 02:00 MODIFY/DELETE REPLY

    친구는 위치의 너의 현재 팬이 되었다!

  21. mexican lesbian 2008/05/24 02:18 MODIFY/DELETE REPLY

    중대한 축하!경이롭 위치 위치!

Write a comment


PREV : [1] : .. [37] : [38] : [39] : [40] : [41] : [42] : [43] : [44] : [45] : .. [161] : NEXT