CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Join Date
    Aug 2006
    Location
    Hubli, India
    Posts
    70

    Unhappy Send, receive SMS through GSM Modem using visual basic 6.0

    Hello friends , I am new to this site. I wanted some help.

    Question : How do i send or receive SMS (GSM modem) using VB6 code, and not third party ActiveX controls?

    Is it possible using Comm Control , if yes then what would be the ATL Commands for it. please........

  2. #2
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Send, receive SMS through GSM Modem using visual basic 6.0

    Yes it's quite easy. Use the MSComm control to establish communications with the modem/terminal. I don't know about GSM but I operated a Siemens M20 for that purpose. Works perfectly.

    What I have to AT to initialize the M20 is: (only once after program start)
    AT+CPIN="1234" to send the PIN
    AT+CSCA="+491722270000" to set the number of the service center (here the german D2 net)
    AT+CMS=1 to set the type of simple SMS
    AT+CMGF=1 to set the text mode
    AT+CSCS="8859-1" to select the character set (maybe obsolete for american)

    To send an SMS
    AT+CMGS="(number of partner to call)"
    the device prompts ">" and you send the message string followed by chr$(26) to terminate.

    Best you make a little terminal like testprog:
    A TextBox as input line where you can type a command which is send to the modem when you press Enter
    A TextBox as output window where you display the answers from the modem.
    Then you can play around with it.
    I'm quite confident that the AT commands I listet here apply also to other brands of modem.

  3. #3
    Join Date
    Aug 2006
    Location
    Hubli, India
    Posts
    70

    Re: Send, receive SMS through GSM Modem using visual basic 6.0

    Quote Originally Posted by WoF
    Yes it's quite easy. Use the MSComm control to establish communications with the modem/terminal. I don't know about GSM but I operated a Siemens M20 for that purpose. Works perfectly.
    Thanks Pal , I think i'll play with it now, I think i have some more doubts going on in my mind but i'll see

    Thanks pal

  4. #4
    Join Date
    Aug 2006
    Location
    Hubli, India
    Posts
    70

    Unhappy Re: Send, receive SMS through GSM Modem using visual basic 6.0

    Please help me

    I connected my GSM Modem and then tested few AT Commands,
    then got this AT set here to send an SMS, but i dont know how to read SMS, how to delete stored SMS

    SMS_AT_String = "AT+CMGF=1" & Chr(13) & "AT+CMGF=" & Chr(34) & Mobile_Number & Chr(34) & Chr(13) & SMS_Message & Chr(26)


    please Help me as I dont have the extended AT Command List for the GSM Modem, It is cheap modem,
    But it supports General AT Commands

    Please Help Me, It's Urgent

  5. #5
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Send, receive SMS through GSM Modem using visual basic 6.0

    Try to get the manual of the Siemens GSM modem somewhere from the internet. It almost certainly contains a list and descriptions of all supported AT commands. I have no manual handy at the moment but can try to find my command list from M20 tomorrow. M20 and GSM seem to have the same command set.

  6. #6
    Join Date
    Aug 2006
    Location
    Hubli, India
    Posts
    70

    Re: Send, receive SMS through GSM Modem using visual basic 6.0

    Hello WoF,
    Sorry I was away for few days.

    Thank you very much, I found the Siemens GSM modem manual. I also found its different Model AT commands also. After I tryout with these commands as they are working and complete the application as I want it.

    I will post the Manual, and a sample programme if it works may be it will help others also.

    If I have any other doubts, I'll post it. I hope you and Other Gurus will find some time to answer me.

    Thanks once again......

  7. #7
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Send, receive SMS through GSM Modem using visual basic 6.0

    You're welcome.
    Yes, I'd love to have a look at your sample program, since I still got some work to do with my modem section later this year.

  8. #8
    Join Date
    Aug 2006
    Location
    Hubli, India
    Posts
    70

    Thumbs up Re: Send, receive SMS through GSM Modem using visual basic 6.0

    Sorry again,
    I was late

    any way I have found some of the AT Commands Manual.

    Seimens and other also, but I prefer the AVR manual as it is short and descriptive.

    Sorry I could not attach the Sample programme, beacuse I was all the time working and correcting the AT commands in my software, which will not mean as an example, I'll prepare one and post it later.

    Sorry, but I could not attach other PDF files as they are too large.
    If any one requires, they can mail me to [email protected]

    Buy for now.
    Attached Files Attached Files

  9. #9
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Send, receive SMS through GSM Modem using visual basic 6.0

    Yes, thanks. Seems to me, all Siemens modems have the same command set, at first look.

    I'd love to see chunks of your code. Looking forward to it.

  10. #10
    Join Date
    Aug 2006
    Location
    Hubli, India
    Posts
    70

    Thumbs up Re: Send, receive SMS through GSM Modem using visual basic 6.0

    Quote Originally Posted by WoF
    Yes, thanks. Seems to me, all Siemens modems have the same command set, at first look.

    I'd love to see chunks of your code. Looking forward to it.
    Sorry late again,

    My God the bloody programme was giving me many errors, just because I added a Timer to do some other work.

    At last now its working. I am attaching the code. It's (not chunks of code) just a sample programme.

    Please suggest me if some more things have to be or can be added to it.

    Thank you for giving me those links to AT commands without which I could not have done.

    Moderators/Gurus :

    Thank you for CodeGuru.com that my problem is solved. Hey but please don't mark it as resolved, because I want one more help.

    Can any one of you teach me step by step how to make this GSM AT Programme as an ActiveX control, It can be posted on CG for everyone to download , free of Cost(At least AT supported GSM). Please...........


    Thank you WoF once again
    Attached Files Attached Files

  11. #11
    Join Date
    Aug 2006
    Location
    Hubli, India
    Posts
    70

    Exclamation Re: Send, receive SMS through GSM Modem using visual basic 6.0

    Hello!!!

    anybody there , Moderators please......

  12. #12
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Send, receive SMS through GSM Modem using visual basic 6.0

    Sorry, I had no time yet to look at your code. I've got a job too, you know?

    And I ever only made user-controls, but it should not be soooo difficult to do an ActiveX from a working program. I'd like to learn that too. If nobody can teach us, we'll work that out by ourselves.

  13. #13
    Join Date
    Aug 2006
    Location
    Hubli, India
    Posts
    70

    Smile Re: Send, receive SMS through GSM Modem using visual basic 6.0

    Quote Originally Posted by WoF
    Sorry, I had no time yet to look at your code. I've got a job too, you know?
    Congratulations WoF on your new Job, I hope everything goes fine there.
    Thankyou very much for the Spirit too, you know why I told it to make anActiveX is , beacuse if it is made an ActiveX other process in the form can go on in syncronisation. Any way well see to that,

    Moderators, please have you checked my thread and my sample programme, please let me know

  14. #14
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Send, receive SMS through GSM Modem using visual basic 6.0

    Thanks, but it's not a new job. I just wanted to say that I have also a job to do and therefore had had no time to look at your program.
    But now I did.

    I think, for an ActiveX component there must still be done a lot of more error trapping and handling.

    But let us spin out some ideas:
    I could imagine an ActiveX control for SMS sending and receiving, which wraps up the modems AT commands into an easy to use VB component.
    Lets call it SMS.

    It would have properties like:
    SMS.PinNumber
    SMS.ControlCenter
    SMS.ReceiversPhoneNumber

    and for operation
    SMS.ConnectionQuality
    SMS.IsLoggedIn
    SMS.Initialize

    but also for interface purposes
    SMS.CommPortNumber
    SMS.PortSettings

    and methods for sending and retrieving SMs
    SMS.SendMessage MessageText
    SMS.ReadMessage(MessageNumber)

    Ok. That was just some basic thinking of what an SMS ActiveX should consist. And it's only the start of it. Before actual implementation there should follow a lot more considerations and planning.

    I had some functions for the Siemens M20 implemented as a standard module a while ago, but only for sending SMS. I shall dig that out and see if it gives some more ideas.

  15. #15
    Join Date
    Aug 2006
    Location
    Hubli, India
    Posts
    70

    Re: Send, receive SMS through GSM Modem using visual basic 6.0

    Quote Originally Posted by WoF
    Thanks, but it's not a new job. I just wanted to say that I have also a job to do and therefore had had no time to look at your program.
    But now I did.
    Sure WoF, hope you get some very good ideas, and for the basic start of the ActiveX, I shall try, I'll tryout a simple ActiveX and send you very soon, let me know if some changes.

    Ok , Hey you can email me tooo..............

    Bye............

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured