vb.net +CMS ERROR:发送短信时出现 305

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32904626/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 19:29:23  来源:igfitidea点击:

+CMS ERROR: 305 when sending SMS

vb.netsmsat-commandmodem

提问by exeCUTE

i have a system that can send sms when setting a schedule to confirm their scheduled appointment, but there's an error +CMS ERROR : 305

我有一个系统可以在设置时间表时发送短信以确认他们的预定约会,但出现错误 +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

回答by ?s??? ????

CMS ERROR 305 means Invalid Text Format

CMS ERROR 305 表示文本格式无效

The AT command to get in Text Modeis AT+CMGF=1And PDUencoding is AT+CMGF=0

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

In Text Mode, encoding of the text when sending a SMS is important too. Standard GSM Encoding is AT+CSCS="GSM"

在 中Text Mode,发送短信时的文本编码也很重要。标准 GSM 编码是AT+CSCS="GSM"

And to be on the safe side, start with at AT&F(Factory default configuration). You can issue an AT&Fcommand at start of your session to overcome possible strange settings that may be stored in the modem.

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