Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 Communicate GSM Modem with VB6, stuck to enter AT command

views
     
TSmszazu
post Jan 7 2009, 11:53 AM, updated 17y ago

New Member
*
Junior Member
44 posts

Joined: Dec 2008
Hye.. I am developing serial communication for siemens gsm modem. i'm stuck on how to insert at command into vb. I try using hyperterminal, and i found the command to send an sms to hp is as follows:

at+cmgf=1
OK
at+cmgs=0191234567,145
> testing...sending sms to user's hp ->
+CMGS: 62

OK
at
OK



after at+cmgs=0191234567,145, i need to presskey ENTER and after > testing...sending sms to user's hp, i need to press CTRL+Z ... this sign "->" is actually ctrl+z...i also don't know in vb, what code represent ctrl+z and ENTER>


Below is my VB source code. I think this at command need to be place at the part that i already bold. any idea guys? Tq!
Option Explicit
Private Sub Form_Load()


MSComm1.Settings = "9600,N,8,1"


MSComm1.DTREnable = False


MSComm1.CommPort = 1

MSComm1.PortOpen = True

End Sub

Private Sub cmdExit_Click()


MSComm1.PortOpen = False
End

End Sub


Private Sub cmdSend_Click()


MSComm1.Output =

End Sub



geekster129
post Jan 7 2009, 05:49 PM

Janitor
******
Senior Member
1,180 posts

Joined: Jan 2007
From: *awaiting GPS accuracy*



CTRL-Z = ASCII Code 26
xaragorn
post Jan 7 2009, 06:43 PM

New Member
*
Junior Member
9 posts

Joined: Dec 2008
..

This post has been edited by xaragorn: Jan 7 2009, 06:49 PM
TSmszazu
post Jan 7 2009, 11:09 PM

New Member
*
Junior Member
44 posts

Joined: Dec 2008
QUOTE(geekster129 @ Jan 7 2009, 05:49 PM)
CTRL-Z = ASCII Code 26
*
thx! it works..

//
MSComm1.Output = "at+cmgf=1" + Chr$(13)
MSComm1.Output = "at+cmgs=0191234567,145" + Chr$(13)

//

For this part, I actually wants to write like a normal equation. How do I write it without using MsComm1.Output?
Rite now, when I send Sms, only half of the message received. I'm not sure why. Could be because of this part?


Option Explicit
Private Sub Form_Load()


MSComm1.Settings = "9600,N,8,1"

MSComm1.DTREnable = False
MSComm1.CommPort = 1

MSComm1.PortOpen = True


End Sub

Private Sub cmdExit_Click()

MSComm1.PortOpen = False
End

End Sub


Private Sub cmdSend_Click()
MSComm1.Output = "at+cmgf=1" + Chr$(13)
MSComm1.Output = "at+cmgs=0191234567,145" + Chr$(13)

MSComm1.Output = "ABC DEF GHI KLM NOP" + Chr$(26)


End Sub


This post has been edited by mszazu: Jan 7 2009, 11:09 PM
geekster129
post Jan 8 2009, 09:29 AM

Janitor
******
Senior Member
1,180 posts

Joined: Jan 2007
From: *awaiting GPS accuracy*



QUOTE(mszazu @ Jan 7 2009, 11:09 PM)
thx! it works..

//
MSComm1.Output = "at+cmgf=1" + Chr$(13)
MSComm1.Output = "at+cmgs=0191234567,145" + Chr$(13)

//

For this part, I actually wants to write like a normal equation. How do I write it without using MsComm1.Output?
Rite now, when I send Sms, only half of the message received. I'm not sure why. Could be because of this part?
Option Explicit
Private Sub Form_Load()
MSComm1.Settings = "9600,N,8,1"

MSComm1.DTREnable = False
MSComm1.CommPort = 1

MSComm1.PortOpen = True
End Sub

Private Sub cmdExit_Click()

MSComm1.PortOpen = False
End

End Sub
Private Sub cmdSend_Click()
MSComm1.Output = "at+cmgf=1" + Chr$(13)
MSComm1.Output = "at+cmgs=0191234567,145" + Chr$(13)

MSComm1.Output = "ABC DEF GHI KLM NOP" + Chr$(26)
End Sub

*
Hi,

For your information, for the best compatibility, you would need to include the init string (it's an AT command), and it is different for each model of the GSM modem, so you will need to search in Google or from your modem vendor.

Besides that, try to experiment with the hardware settings, particularly the Baud Rate. This might also be a reason why you only receive half of the message. Is the message appeared half way in your phone?

Thanks

TSmszazu
post Jan 12 2009, 07:47 AM

New Member
*
Junior Member
44 posts

Joined: Dec 2008
I try it again, but this time, my hp received full message..thanks for ur help!
effectz
post May 21 2009, 11:40 PM

Regular
******
Senior Member
1,112 posts

Joined: Oct 2006
Anybody got this Siemens 35i GSM Modem? I want this very badly. Please contact me ASAP by email in this forum.
Price can nego.

user posted image

user posted image

icon_question.gif rclxm9.gif wink.gif



 

Change to:
| Lo-Fi Version
0.0179sec    0.62    5 queries    GZIP Disabled
Time is now: 14th December 2025 - 06:49 AM