+ CMS错误:305发送短信时

时间:2015-10-02 09:47:53

标签: vb.net sms at-command modem

我有一个系统可以在设置时间表时发送短信以确认他们的预约,但是出现错误+ CMS错误:305

            'SMS

            query = "SELECT * FROM schedule WHERE Phone_Number ='" & txtPhoneNumber.Text & "'"
            cmd = New MySqlCommand(query, MySqlConn)
            reader = cmd.ExecuteReader
            'TIME DATE SMS
            Dim date1, time1 As String
           date1 = Val(frmViewSchedule.dtpDate.Text)
            time1 = Val(frmViewSchedule.dtpTime.Text)
            txtMessage.Text = sys_msg + "TIME: " + time1 + " DATE: " + date1

            If reader.HasRows Then
                reader.Read()
                txtPhoneNumber.Text = reader.Item("Phone_Number")


                With SerialPort1
                    .Write("at" & vbCrLf)
                    Threading.Thread.Sleep(1000)
                    .Write("at+cmgf=1" & vbCrLf)
                    Threading.Thread.Sleep(1000)
                    .Write("at+cmgs=" & Chr(34) & txtPhoneNumber.Text & Chr(34) & vbCrLf)
                    .Write(txtMessage.Text & Chr(26))
                    Threading.Thread.Sleep(1000)
                    MsgBox(rcvdata.ToString)

                End With
            End If

1 个答案:

答案 0 :(得分:2)

CMS ERROR 305表示 文本格式无效

进入Text Mode的AT命令是AT+CMGF=1PDU编码是AT+CMGF=0

Text Mode中,发送短信时对文本进行编码也很重要。 标准GSM编码为AT+CSCS="GSM"

为了安全起见,请从AT&F(出厂默认配置)开始。您可以在会话开始时发出AT&F命令,以克服可能存储在调制解调器中的奇怪设置。