Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Arduino GSM SIM900不接收消息_Arduino_Sms_Gsm_Sim900 - Fatal编程技术网

Arduino GSM SIM900不接收消息

Arduino GSM SIM900不接收消息,arduino,sms,gsm,sim900,Arduino,Sms,Gsm,Sim900,以下URL将出现在我的GSM模块中,并包含在SIM900模块的数据表中 我只在GSM模块和Arduino mega板之间连接了RX、TX、GND和PWR引脚。 发送短信正常,但接收短信不正常 这是发送sms的Arduino代码-(参考-) #包括 软件系列SIM900(15,14); char-incoming_char=0; 无效设置() { Serial.begin(19200);//用于串行监视器 SIM900.begin(19200);//用于GSM屏蔽 SIM900power();/

以下URL将出现在我的GSM模块中,并包含在SIM900模块的数据表中

我只在GSM模块和Arduino mega板之间连接了RX、TX、GND和PWR引脚。 发送短信正常,但接收短信不正常

这是发送sms的Arduino代码-(参考-)

#包括
软件系列SIM900(15,14);
char-incoming_char=0;
无效设置()
{
Serial.begin(19200);//用于串行监视器
SIM900.begin(19200);//用于GSM屏蔽
SIM900power();//打开屏蔽
延迟(20000);//给时间登录到网络。
SIM900.print(“AT+CMGF=1\r”);//将SMS模式设置为文本
延迟(100);
SIM900.print(“AT+CNMI=2,2,0,0,0\r”);
//在收到GSM shield的串行输出后脱口而出新短信的内容
延迟(100);
}
void SIM900power()
//软件相当于按下GSM屏蔽“电源”按钮
{
数字写入(9,高);
延迟(1000);
数字写入(9,低);
延迟(7000);
}
void循环()
{
//现在,我们只需在串行监视器上显示GSM屏蔽发送的任何文本
Serial.println(“循环”);
如果(SIM900.available()>0)
{
串行打印(“等待”);
incoming_char=SIM900.read();//从蜂窝串行端口获取字符。
Serial.print(传入字符);//将传入字符打印到终端。
而(一){};;
}
}

尝试添加
SIM900.print(“AT+CMGD=1,4\r”)设置()中的code>
。我也遇到了类似的问题,原因是sim卡的信息存储空间已经满了

如果sim卡内存中没有空间,您将不会收到任何消息或通知

所以你的setuo循环看起来像这样

void setup()
{
    Serial.begin(19200); // for serial monitor
    SIM900.begin(19200); // for GSM shield
    SIM900power();  // turn on shield
    delay(20000);  // give time to log on to network.

    SIM900.print("AT+CMGF=1\r");  // set SMS mode to text
    delay(100);
    SIM900.print("AT+CMGD=1,4\r");  // Deletes all SMS saved in SIM memory
    delay(100);
    SIM900.print("AT+CNMI=2,2,0,0,0\r"); 
    // blurt out contents of new SMS upon receipt to the GSM shield's serial out
     delay(100);
}

尝试添加
SIM900.print(“AT+CMGD=1,4\r”)设置()中的code>
。我也遇到了类似的问题,原因是sim卡的信息存储空间已经满了

如果sim卡内存中没有空间,您将不会收到任何消息或通知

所以你的setuo循环看起来像这样

void setup()
{
    Serial.begin(19200); // for serial monitor
    SIM900.begin(19200); // for GSM shield
    SIM900power();  // turn on shield
    delay(20000);  // give time to log on to network.

    SIM900.print("AT+CMGF=1\r");  // set SMS mode to text
    delay(100);
    SIM900.print("AT+CMGD=1,4\r");  // Deletes all SMS saved in SIM memory
    delay(100);
    SIM900.print("AT+CNMI=2,2,0,0,0\r"); 
    // blurt out contents of new SMS upon receipt to the GSM shield's serial out
     delay(100);
}