Wireless Networking
--
Questions
--
Followers
Top Experts
AT [i press enter]
OK [Results OK]
AT+CSCA="+0092300000042" [I Enter SMS Center No.]
OK [Resuls OK]
AT+CMGS="+923006660933" [I enter where to send sms]
+CMS ERROR: 500 [Resuls Error]
i am getting this error when try to send sms message. can someone tell me the solution please.
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
sms center:"+92300000042"
mob number:"+923006624925"
mob number: "3006624925"
or can some one tell me the location from where i can download excat and easy vb code for this sms application
Timer is set for 50mS interval.
'Demo program will switch a modem on (using DTR), send a message and switch the modem off.
'Message sent demonstrates sending the "@" character - sent as a NULL character
Dim MS50 As Integer
Dim ModemLine As String
Public Function SendCommand(outcomm$, waittime, waitfor$, waiterror$) As Integer
Dim untiltime, intext$
Debug.Print outcomm$, waittime;
dummy = DoEvents()
SendCommand = False
If outcomm$ > "" Then
Comm1.InBufferCount = 0 'clear buffer only if we are sending a command
End If
Comm1.Output = outcomm$
Delay (0)
untiltime = MS50 + waittime * 20
Do While MS50 < untiltime
DoEvents
If Comm1.InBufferCount Then
intext$ = intext$ + Comm1.Input
ModemLine = intext$ 'Allows us to see modem responses
If waiterror$ > "" Then
If InStr(intext, waiterror$) Then
SendCommand = False
Debug.Print "error!"
Exit Function
End If
End If
If InStr(intext$, waitfor$) Then
Debug.Print "found!"
SendCommand = True
Exit Function
End If
End If
Loop
Debug.Print "Fell out!"
End Function
Private Sub Form_Load()
Comm1.PortOpen = True
'wait for 5 seconds
Delay (100)
'check the modem is present
If Not (SendCommand("AT" & Chr(13), 1, "OK", "ERROR")) Then Stop
'select text mode
If Not (SendCommand("AT+CMGF=1" & Chr(13), 1, "OK", "ERROR")) Then Stop
'select number to send message to
If Not (SendCommand("AT+CMGS=0779
'send message
If Not (SendCommand("SMS message goes here." & Chr(26), 10, "OK", "ERROR")) Then Stop
'switch modem off
If Not (SendCommand("AT^SMSO" & Chr(13), 1, "OK", "ERROR")) Then Stop
Comm1.PortOpen = False
End Sub
Private Sub Timer_Timer() 'timer is a timer set to 50mS interval
MS50 = MS50 + 1
If MS50 > 30000 Then MS50 = 0 'avoid overflows when idle
End Sub
Private Sub Delay(DelayTime As Double)
MS50 = 0
Do While MS50 < DelayTime
DoEvents
Loop
End Sub
Simon
www.tdc.co.uk
AT+CMGF=?
+CMGF: (0)
i think this means that my mob support only PDU mode not Text Mode, can you please tell me more about this and how to convert my message commands to PDU modes. waiting for reply,






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
A piece of software you can download is PDUSpy which is quite handy, some VB code which generates PDU formats is below.
Yes your hardware only supports PDU.
Public Function EncodeOutgoingSMS(PDUType As Integer, Number As String, Message As String, PDUInternational As Integer) As String
Dim i As Integer
EncodeOutgoingSMS = ""
If PDUType = A1C Then EncodeOutgoingSMS = EncodeOutgoingSMS & ASCIIHex(&H0) 'TP-MTI etc
If PDUType = M1C Then EncodeOutgoingSMS = EncodeOutgoingSMS & ASCIIHex(&H1) 'PDU type
If PDUType = A1C Then EncodeOutgoingSMS = EncodeOutgoingSMS & ASCIIHex(&H11) 'PDU type
EncodeOutgoingSMS = EncodeOutgoingSMS & ASCIIHex(&H0) 'increment each time TP-MR message reference, the M1 does this for you
EncodeOutgoingSMS = EncodeOutgoingSMS & ASCIIHex(Len(Number)) 'length of destination address
If PDUInternational Then
EncodeOutgoingSMS = EncodeOutgoingSMS & ASCIIHex(&H91) 'International number and national numbering plan
Else
EncodeOutgoingSMS = EncodeOutgoingSMS & ASCIIHex(&H81) 'National numbering plan
End If
For i = 1 To Len(Number) / 2
EncodeOutgoingSMS = EncodeOutgoingSMS & Mid(Number, i * 2, 1) & Mid(Number, i * 2 - 1, 1)
Next i
If Len(Number) / 2 <> Int(Len(Number) / 2) Then EncodeOutgoingSMS = EncodeOutgoingSMS & "F" & Mid(Number, i * 2 - 1, 1)
EncodeOutgoingSMS = EncodeOutgoingSMS & ASCIIHex(&H0) ' TP-PID
EncodeOutgoingSMS = EncodeOutgoingSMS & ASCIIHex(&H0) 'TP-DCS
If PDUType = A1C Then EncodeOutgoingSMS = EncodeOutgoingSMS & ASCIIHex(&HAA) 'TP-VDF
EncodeOutgoingSMS = EncodeOutgoingSMS & ASCIIHex(Len(Message))
EncodeOutgoingSMS = EncodeOutgoingSMS & MessageEncode(Message)
End Function
Private Function MessageEncode(InMsg As String) As String
Dim i As Integer, Byterev As Integer, Bits As Integer, Eightbit As Integer
Dim Msg As String
For i = 1 To Len(InMsg)
Byterev = Byterev * 128 'shift left 7 bits
Byterev = Byterev + Rev(Asc(Mid(InMsg, i, 1)), 7)
Bits = Bits + 7
While Bits >= 8
Eightbit = Int(Byterev / 2 ^ (Bits - 8))
Byterev = Byterev - Eightbit * 2 ^ (Bits - 8)
Bits = Bits - 8
Msg = Msg & ASCIIHex(Rev(Eightbit, 8))
Wend
Next i
If Bits > 0 Then
Byterev = Byterev * 128 'shift left 7 bits
Bits = Bits + 7
Eightbit = Int(Byterev / 2 ^ (Bits - 8))
Msg = Msg & ASCIIHex(Rev(Eightbit, 8))
End If
MessageEncode = Msg
End Function
Function Rev(Byted As Integer, B As Integer) As Integer
Dim j As Integer, Value As Integer
For j = 0 To B - 1
If Byted And 2 ^ j Then Value = Value + 2 ^ (B - 1 - j)
Next j
Rev = Value
End Function
Private Function ASCIIHex(Value) As String
ASCIIHex = Right("0" & Hex$(Value), 2)
End Function
After changing sim card which has credit i send command
AT+CMGS=23
>0001000B812903606690F3000
+cmgs:102
ok
again sending
AT+CMGS=23
>0001000B812903606690F3000
+cmgs:103
ok
but on phone 923006660933 no message received? what can be the problem now?

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
Can you Recheck the mob number in the string may be messages are going some other phone number beacuse i am getting OK with
at+cmgs=23
>0001000B812903606690F3000
+CMGS:105
ok
increased value everytime i am waiting for your responses please help me in completing this issue.
0001000C812903602694520000
Simon
07912903000040F201000A8103
07912903000040F201000C8129






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
i face Error when send string without 92 but OK with CMGS and a incremented number when i use with 92. the problem is no message i am receiving on this number. what can be the reasons?
and tell me the how can i get PDU from PDUSPY
In Create PDU
destination: International Number
Destination Adress: 923006660933
Enter Message Text: Test Message
and use the default setting press create but i am getting diffrent result than yours.

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
=
PDU LENGTH IS 31 BYTES
ADDRESS OF DELIVERING SMSC
NUMBER IS : +491722270333
TYPE OF NR. : (0x10) International
NPI : (0x01) ISDN/Telephone (E.164/163)
MESSAGE HEADER FLAGS (0x01)
MESSAGE TYPE : SMS SUBMIT
REJECT DUPLICATES : NO
VALIDITY PERIOD : NOT PRESENT
REPLY PATH : NO
USER DATA HEADER : NO UDH
REQ. STATUS REPORT : NO
MSG REFERENCE NR. : 0 (0x00)
RECIPIENTS ADDRESS
NUMBER IS : 923006624925
TYPE OF NR. : (0x00) Unknown
NPI : (0x01) ISDN/Telephone (E.164/163)
PROTOCOL IDENTIFIER (0x00)
MESSAGE ENTITIES : SME-to-SME
PROTOCOL USED : Implicit / SC-specific
DATA CODING SCHEME (0x00)
COMPRESSION : OFF
MESSAGE CLASS : NONE
ALPHABET USED : 7bit default
VALIDITY OF MESSAGE : NONE GIVEN
USER DATA PART OF SM
USER DATA LENGTH : 11 septets
USER DATA (TEXT) : SMS Message
Hope this explains it - see the Decode tab on PDU Spy.
and it is giving me error of
CMS:Error 38 what does it mean?






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Thanx a lot SMS sent successfully but one problem from PDUSpy only [SMS Message] this text is going , if i change this text Error message appear and no sms is going. what can be the problem with the sms message. :|
Private Sub Form_Load()
MSComm1.CommPort = 1 ' Com Port 1
MSComm1.PortOpen = True
MSComm1.Settings = "19200,N,8,1"
end sub
and in button click event
MSComm1.Output = "AT" & Chr(13)
and
Private Sub MSComm1_OnComm()
MsgBox MSComm1.Input
End Sub
and no msg box appear means communication problem can u tell me communication control parameters like
InBufferSize,OutBufferSize

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
why are u not replying when my application is on ending stage. SMS Message problem solved too it was length problem , just tell me about the Visual Basic comm control setting or any URL from where i can get these settings or ready made application, and tell me how much points should i award u as u did a lot for me, waiting for reply very badly , Zahid
Zahid






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Wireless Networking
--
Questions
--
Followers
Top Experts
Wireless networking is anything related to the transfer of data between two (or more) devices without the use of a physical connection, ranging from getting advice on a new Bluetooth headset to configuring sophisticated enterprise level networks.