Results 1 to 12 of 12

Thread: accessing the GSM modem using serialport in windows OS

  1. #1
    Join Date
    Sep 2007
    Posts
    83
    Thanks
    6
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Question accessing the GSM modem using serialport in windows OS

    Hello,

    I want to develop an application where i have to interact with a GSM Modem to send or receive messages and require to write AT Commands on the modem via the com port from the qt programming.

    Can anyone provide guidance in this regard ..
    Highly URGENT ...



    Thanks in advance ...

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: accessing the GSM modem using serialport in windows OS

    Quote Originally Posted by jjbabu View Post
    I want to develop an application where i have to interact with a GSM Modem to send or receive messages and require to write AT Commands on the modem via the com port from the qt programming.
    See QextSerialPort.

    Quote Originally Posted by jjbabu View Post
    Highly URGENT ...
    Don't flag your question as “Urgent”, even if it is for you
    J-P Nurmi

  3. #3
    Join Date
    Sep 2007
    Posts
    83
    Thanks
    6
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: accessing the GSM modem using serialport in windows OS

    first thanx for ur response jpn,

    I feel very sorry to mentioning the urgent word in my thread.

    about my problem,i already used that "qextserialport" class.i want to send some commands(at commands)to the GSM modem for the purpose of sending and receiving the messages.

    Is there any library in the Qt to develop these type of applications,if any plz provide that documents to me.

    thanx for ur help.

  4. #4
    Join Date
    Jan 2006
    Location
    Berlin, Germany
    Posts
    64
    Thanks
    1
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: accessing the GSM modem using serialport in windows OS

    As far as I know, you would use QextSerialPort to read and write to the GSM modem, and you would just write the AT commands and then read the returned data. I have not ever seen a class specifically for dealing with GSM modem AT commands, but I do know there are several apps for KDE that work with GSM modems, it's possible one of them has some code which could be useful to you.
    Katrina Niolet

  5. #5
    Join Date
    Oct 2007
    Location
    Grenoble, France
    Posts
    80
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: accessing the GSM modem using serialport in windows OS

    I want to develop an application where i have to interact with a GSM Modem to send or receive messages
    What do you mean saying "messages" - SMS?
    I really don't think you can find anything ready to use with Qt and gsm. If you find something, I think it will work only with some specific gsm modem.
    I've been working with some industrial gsm modems (Motorola, Sony Ericcson, SIM, Siemens). They all support standard AT commands, but they have also nonstandard commands specific to their vendor.
    Datasheet of your modem should have list of all commands. As you already know, qextserialport will let you use UARTs. Then you must just analyze strings you get from GSM and correctly respond to them. I think QHash and maybe QMap will be helpful to do that.
    You have to run a level 3 diagnostic.

    Ashes to ashes, Qt to Qt ( wysota )

  6. #6
    Join Date
    Sep 2007
    Posts
    83
    Thanks
    6
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: accessing the GSM modem using serialport in windows OS

    Hi,
    Thanx for ur reply,

    Here i am mentioning clearly what is the problem,

    I am using Qt4.1 on Windows.

    I developed one application using the "Qextserialport" class.The functionality of my application is,it has to receive the data from the Micro controller(which will send the data according to user request) and display the data on my GUI,at the same time according to user requirement my application will send the data to the Micro controller using the RS-232.
    Upto this i have successfully finished.In this application the connectivity between my GUI(which is on PC) and Micro controller board is direct(i.e using RS-232 direct connection is there).

    Now we have one more version which is called wireless version,In this case the connectivity between GUI and Micro controller is wireless.

    at the Pc side we r having one GSM modem and at the board side we r having another,the same functionality will (i.e sending and receiving of data will occur between the two modems).

    here i know the At commands of modem to send and read the sms messages of modem.
    my idea is the data will be transfered in the sms messages between the modems.

    My problem is HOW TO WRITE SOURCE CODE FOR CONNECTING TO AND SENDING AT COMMANDS TO THE GSM MODEM.

    Is any one having the idea abt this issue,plz suggest me,are there any useful documents and libraries for this?

    THE MODEM I AM USING IS WAVE COM,

    How to start with this type of functionality,whether can i send the At commands(At,AT+CMGF=1,AT+CMGW="-----",AT+CMSS)through serially as like in the direct version or can i use any library to send this commands to the modem ?


    Thanx in Advance.

  7. #7
    Join Date
    Jan 2006
    Location
    Berlin, Germany
    Posts
    64
    Thanks
    1
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Red face Re: accessing the GSM modem using serialport in windows OS

    _Most_ GSM modems are capable of acting like standard serial devices; in that case you treat them just like you would any other serial port, just write your AT commands to the serial port they are attached to and get the response.

    _Some_ GSM modems use proprietary drivers and do not act like a standard serial device... in this case you would need to work with the manufacturer of that device to get the libraries you need.

    The easiest way I have found to test it on Windows is to go into the hardware manager and see if the GSM device has a modem device listed as a COM port, then if so open up Hyperterminal with a direct link to that serial port and try to type some AT commands to it. If that works, then chances are you can just write the AT commands directly to it in your software. If either of the these is not true, then chances are your device uses a proprietary driver.
    Katrina Niolet

  8. #8
    Join Date
    Oct 2007
    Location
    Grenoble, France
    Posts
    80
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: accessing the GSM modem using serialport in windows OS

    Connect wavecom to your pc's RS-232 and talk with it using qextserial just like you did to talk with your microcontroller.
    The difference is that you must use the AT commands. I'm sure they are ale listed in some manual you got with the modem.
    As katrina wrote, try to send sms manualy first, using hyperterminal or some other serial terminal software. Usually those modems are default at 115200, 8bit and no parity.
    After power-on just send to RS something like that
    Qt Code:
    1. AT //your command
    2. OK //modem response
    3. ATE0 //this is very usefull - turning off local echo
    4. OK //modem response
    5. AT+CPIN="1234" //enter pin number
    6. OK //modem response
    7. AT+CREG=1
    8. OK
    To copy to clipboard, switch view to plain text mode 
    In your software you should end commands you send by "\r\n". Most modems will send anything to you starting and finishing the message using "\r\n". So in fact you'll receive "\r\nOK\r\n".
    So again, try do what you need manually, then write Qt software doing this for you. It's not really difficult
    You have to run a level 3 diagnostic.

    Ashes to ashes, Qt to Qt ( wysota )

  9. #9
    Join Date
    Sep 2007
    Posts
    83
    Thanks
    6
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: accessing the GSM modem using serialport in windows OS

    Thanx for ur help calhal & katrina,

    yah,what u told ,i completed already,

    i checked my Gsm modem by connecting with com port and passed At commands using MS Hyperterminal,the modem works fine at that time,i sended sms message from PC to another mobile using that AT commands.
    we set the port and modem for 9600,8bit,no parity.

    My doubt was,how can i send "ENTER","CNTR+Z" signals of keyboard from my source code.can i give "\n" for "ENTER" signal?

    one more doubt is, after sending command to the modem,i will verify that"OK" response in the PC side,it will take some delay for this,how can i avoid the delay problem in this issue.

    u are really helpful to me,
    thanx alot..........

  10. #10
    Join Date
    Oct 2007
    Location
    Grenoble, France
    Posts
    80
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: accessing the GSM modem using serialport in windows OS

    My doubt was,how can i send "ENTER","CNTR+Z" signals of keyboard from my source code.can i give "\n" for "ENTER" signal?
    I think enter is rather "\r\n" in this case. ctrl+z is a SUB character. IIRC it has 0x1a hex code.

    one more doubt is, after sending command to the modem,i will verify that"OK" response in the PC side,it will take some delay for this,how can i avoid the delay problem in this issue.
    I don't know if I understand correctly your question. I'd use a QTimer to receive data from RS232, then emit some signal when got "OK" and connect it to right slot. Same for other commands received from modem.
    You have to run a level 3 diagnostic.

    Ashes to ashes, Qt to Qt ( wysota )

  11. The following user says thank you to calhal for this useful post:

    jjbabu (31st December 2007)

  12. #11
    Join Date
    Sep 2007
    Posts
    83
    Thanks
    6
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: accessing the GSM modem using serialport in windows OS

    Hi calhal

    I think enter is rather "\r\n" in this case. ctrl+z is a SUB character. IIRC it has 0x1a hex code.
    If u dont mind can u give me some more clarity regarding "CNTR+Z" signal,i understood about that "enter" signal,but i didnt abt "CNTR+Z".

    In the source code what i have to mention for "CNTR+Z"?
    can u give me any example abt this,

    thanks,

  13. #12
    Join Date
    Oct 2007
    Location
    Grenoble, France
    Posts
    80
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: accessing the GSM modem using serialport in windows OS

    In the source code what i have to mention for "CNTR+Z"?
    can u give me any example abt this
    When you press cntr+z in some serial terminal software, it will simply send ascii char representing this cntr+z.
    Here is some link http://www.cisco.com/en/US/docs/ios/.../papascii.html

    So in fact you must send this char to gsm modem. It would be string with something like "\x1a".
    You have to run a level 3 diagnostic.

    Ashes to ashes, Qt to Qt ( wysota )

Similar Threads

  1. Mac OS X - Accessing Windows Samba Shares
    By marcel in forum General Programming
    Replies: 1
    Last Post: 11th April 2007, 00:28
  2. Accessing Windows Registry
    By musaulker in forum Newbie
    Replies: 1
    Last Post: 29th March 2007, 00:32

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.