我正在使用Arduino来控制SM5100B GSM设备,一切正常,除非我想在收到另一个后发送短信.我明白了,
错误代码:
OK> + CMGS:2 5 OK + CMEERROR:4
我处理上述收到短信的代码:
#include <SoftwareSerial.h> //Include the NewSoftSerial library to send serial commands to the cellular module.
char inchar; //Will hold the incoming character from the Serial Port.
SoftwareSerial cell(2,3);
char mobilenumber[] = "0597010129";
void setup() {
//GSM
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
Serial.println("Initialize GSM module serial port for communication.");
cell.begin(9600);
delay(35000); // give time for GSM module to register on network etc.
Serial.println("delay off");
cell.println("AT+CMGF=1"); …Run Code Online (Sandbox Code Playgroud)