2015-12-25 2 views
1

Следующий URL-адрес будет отображаться на моем GSM-модуле, и он будет включен в лист данных модуля SIM900.Arduino GSM SIM900 не принимает сообщения

http://www.pennybuying.com/gsm-gprs-module-sim900-development-board-lbs-mms-support-arduino-uno-ttl-rs232.html

Я подключил только RX, TX, GND и PWR контактный между модулем GSM и Arduino мега борту. Отправка SMS работает правильно, но получение SMS-сообщения не работает.

Это Arduino код отправки смс - (Reference - http://tronixstuff.com/2014/01/08/tutorial-arduino-and-sim900-gsm-modules/)

#include <SoftwareSerial.h> 
SoftwareSerial SIM900(15,14); 

char incoming_char=0; 

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+CNMI=2,2,0,0,0\r"); 
    // blurt out contents of new SMS upon receipt to the GSM shield's serial out 
    delay(100); 
} 

void SIM900power() 
// software equivalent of pressing the GSM shield "power" button 
{ 
    digitalWrite(9, HIGH); 
    delay(1000); 
    digitalWrite(9, LOW); 
    delay(7000); 
} 

void loop() 
{ 
    // Now we simply display any text that the GSM shield sends out on the serial monitor 
    Serial.println("loop"); 
    if(SIM900.available() > 0) 
    { 
    Serial.print("waiting"); 
    incoming_char=SIM900.read(); //Get the character from the cellular serial port. 
    Serial.print(incoming_char); //Print the incoming character to the terminal. 
    while(1){}; 
    } 

} 

ответ

0

Попробуйте добавить SIM900.print("AT+CMGD=1,4\r"); в вашем setup(). Я столкнулся с подобными проблемами, и причина в том, что память сим-карт для сообщений заполнена.

Вы не получите никаких сообщений или уведомлений, если в памяти 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); 
} 
Смежные вопросы