From 02bc7ab49a75fc028abf9bc2aeeba4e65e9849b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jordi=20Altay=C3=B3?= Date: Thu, 26 Dec 2019 20:37:14 +0100 Subject: [PATCH] added `CNMI` command to init function I had problems when using the `CMGL` command and it wouldn't reply with any message in the buffer, adding the CNMI configuration in the init solved the issue for me --- GPRS_Shield_Arduino.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/GPRS_Shield_Arduino.cpp b/GPRS_Shield_Arduino.cpp index 126ce0a..ba4d696 100644 --- a/GPRS_Shield_Arduino.cpp +++ b/GPRS_Shield_Arduino.cpp @@ -56,6 +56,11 @@ bool GPRS::init(void) } //delay(500); It is not necessary, as we have time before next command + // set New Message Indicator + if(!sim900_check_with_cmd(F("AT+CNMI=1,1,0,0,0\r\n"), "OK\r\n", CMD)) { // Set message mode to ASCII + return false; + } + if(!checkSIMStatus()) { return false; }