问题描述
我有一个系统可以在设置日程时发送短信以确认他们的预定约会,但出现错误 +CMS ERROR : 305
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
'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
推荐答案
CMS ERROR 305 表示 Invalid Text Format
CMS ERROR 305 means Invalid Text Format
进入Text Mode
的AT指令为AT+CMGF=1
,PDU
编码为AT+CMGF=0
The AT command to get in Text Mode
is AT+CMGF=1
And PDU
encoding is AT+CMGF=0
在Text Mode
中,发送短信时的文本编码也很重要.标准 GSM 编码为 AT+CSCS="GSM"
In Text Mode
, encoding of the text when sending a SMS is important too.Standard GSM Encoding is AT+CSCS="GSM"
为了安全起见,从 AT&F
(出厂默认配置)开始.您可以在会话开始时发出 AT&F
命令,以克服可能存储在调制解调器中的奇怪设置.
And to be on the safe side, start with at AT&F
(Factory default configuration). You can issue an AT&F
command at start of your session to overcome possible strange settings that may be stored in the modem.
这篇关于+CMS ERROR:发送短信时出现 305的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!