Noor Mohammad Babu
Noor Mohammad Babu

Reputation: 67

Visual basic 6 , gsm modem error "+CME ERROR: 4"

I am developing a VB6 app to use a GSM modem. Currently I am using a Wavecome Fastrack M1306B GSM modem. I get +CME ERROR: 4 error message.

Below is my current code.

VB6 Code:

 MSComm1.Output = "AT+CMEE=1" & vbCrLf
    Delay (1)
    MSComm1.Output = "AT+WIND=15" & vbCrLf
    Delay (1)
    MSComm1.Output = "AT+CPAS" & vbCrLf
    Delay (1)
    MSComm1.Output = "AT+STSF?" & vbCrLf
    Delay (1)
    MSComm1.Output = "AT+STSF=1" & vbCrLf
    Delay (1)
    MSComm1.Output = "AT+STGI=0" & vbCrLf
    Delay (1)
    MSComm1.Output = "AT+STGR=0,1,128" & vbCrLf
    Delay (1)
    MSComm1.Output = "AT+STGI=6" & vbCrLf
    Delay (1)
    MSComm1.Output = "AT+STGR=6,1,7" & vbCrLf
    Delay (1)
    MSComm1.Output = "AT+STGI=6" & vbCrLf
    Delay (1)
    MSComm1.Output = "AT+STGR=6,1,0" & vbCrLf
    Delay (1)
    MSComm1.Output = "AT+STGI=3" & vbCrLf
    Delay (1)
    MSComm1.Output = "AT+STGR=3,1" & vbCrLf
    Delay (1)
    MSComm1.Output = 1212 & Chr(26) & vbCrLf
    Delay (1)
    MSComm1.Output = "AT+STGR=1,1" & vbCrLf

Output:

AT+CSQ
+CSQ: 29,0
OK
AT+CSCS="GSM"
OK
AT+COPS?
+COPS: 0,2,47004
OK
AT+CMEE=1
OK
AT+WIND=15
OK
AT+CPAS
+CPAS: 0
OK
AT+STSF?
+STSF: 1,"5FFFFFFF7F",3,0
OK

AT+STSF=1
OK
AT+STGI=0
+STGI: "Teletalk STK"
+STGI: 128,3,"Tele Charge",0
+STGI: 129,3,"Teletalk 3G World",0
+STGI: 130,3,"General Services",0
OK
AT+STGR=0,1,128
OK
+STIN: 6
AT+STGI=6
+STGI: 0,"Tele Charge"
+STGI: 1,10,"Recharge",0
+STGI: 2,10,"Transfer",0
+STGI: 3,10,"Last Recharge",0
+STGI: 4,10,"Last Transfer",0
+STGI: 5,10,"Change PIN",0
+STGI: 6,10,"Send PIN",0
+STGI: 7,10,"Stock Balance",0
+STGI: 8,10,"Suspend",0
+STGI: 9,10,"Activate",0
+STGI: 10,10,"Help Line",0
OK
AT+STGR=6,1,7
OK
+STIN: 6
AT+STGI=6
+STGI: 0,"Stock Balance"
+STGI: 1,2,"Own Account",0
+STGI: 2,2,"Down Stream Account",0
OK
AT+STGR=6,1,0
OK
+STIN: 3
AT+STGI=3
+STGI: 0,1,4,4,0,"Please Enter PIN (4 digit)"
OK
AT+STGR=3,1
> 1212
+CME ERROR: 4

Upvotes: 2

Views: 1129

Answers (1)

user1889116
user1889116

Reputation:

This statement:

MSComm1.Output = 1212 & Chr(26) & vbCrLf

wants to assign the (implicit) string "1212" to Output, followed by the control character ANSI 26.

Your modem does not like this and replies with the error shown (Operation not supported). Here are all relevant error codes: http://www.micromedia-int.com/en/gsm-2/73-gsm/669-cme-error-gsm-equipment-related-errors

Not sure why you give the modem the control character. Somehow it looks like a copy/paste error, please comment if your modem does require this. Try to give your PIN this way instead:

MSComm1.Output = "1212" & vbCrLf

Upvotes: 1

Related Questions