in
Creating Smarter Networks

iLon and GSM modem via RS232

Last post 06-03-2009 3:56 AM by Xarlan. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-02-2009 1:06 AM

    • Xarlan
    • Top 50 Contributor
    • Joined on 12-23-2008
    • Posts 2
    • Points 25

    iLon and GSM modem via RS232

    Hi :) I want use AT command for control GSM modem (Siemens MC35i). For example - if I send "AT+CMGF=1\r\n" - havn't problem. But if I want send SMS - problem start. For write SMS (text mode) need use "AT+CMGS=number_phone\r\n" Execution this command without problem. Then need write text. And for break text and send SMS need use "Ctrl+Z". So - how it is possible simulation this key combination? I try for example declare variable type "char", give this variable "26" value (26 - this is code key combination of Ctrl+z); then use rs232_write phunction - and.... no result.... :( Also I suppose, that in RS232 interface to write number 26, and not symbol, that ASCII-code is 26. Also I try special symbol ( "\r" = "^M"; "\n" = "^J") for "Ctrl-Z" this is "^Z" - result not good. Modem perceive this combination how symbol "^" and "Z" It is have other variant for simulation Ctrl+Z? Or this is specific phunction "rs232_write"? Thanks :)
    • Post Points: 20
  • 06-02-2009 6:16 AM In reply to

    • Victor
    • Top 50 Contributor
    • Joined on 06-02-2009
    • Posts 4
    • Points 80

    Re: iLon and GSM modem via RS232

    I've tested a GSM modem (MC-45?) with my PC. The following sequence should work:

    1. Init: "at+cmgf=1\n"

    This should return a OK

    2. Enter edit mode: "at+cmgs=5551234567\r"

    This should return the prompt ">". The i.LON should wait until the prompt was received.

    3. Enter message: "My Message"

    4. Send CTRL-Z: "\x1a"

    Remark: "\x1a" is the hex endcoded CTRL-Z char in a C or C++ program.This can also be done in octal: "\32".

    • Post Points: 20
  • 06-03-2009 3:56 AM In reply to

    • Xarlan
    • Top 50 Contributor
    • Joined on 12-23-2008
    • Posts 2
    • Points 25

    Re: iLon and GSM modem via RS232

    yes :) it is possible congratulate :) I start to write anything information to RS232... but next problem... When I try read RS232 use phunction (rs232_read) - the iLon will crash. the code source: unsignedd char read_buf[10]; printf("print something"); - this line for debug and see in the HyperTerminal (for example) rs232_read(hwnd_RS232, read_buf, 10) - and after execute this line - iLon crash. Then it is possible only reboot iLon and restart service. What it is possible problem? In the datasheet (i.LON® SmartServer Programming Tools User’s Guide) the prototype phunction rs232_read is: "int rs232_read(int fd, unsigned char * buf, int length);" Also I use rs232_read in the "Work" and "Ontimer" subrutine...
    • Post Points: 5
Page 1 of 1 (3 items)
©2008 Echelon Corporation