On the project that we are currently developing, a SIM800L module is used.
Our device is only programmed to send an SMS when it gets a 5V digital pulse to microprocessor’s input (Arduino Nano).
The issue is about sending first SMS.
In intensive use, SIM module can send SMS for every single pulse applied to Arduino’s input but when it is set aside and after a while pulses applied, the first pulse is missing and no SMS sending.
For instance, if I set the device aside and after 1 hour if I apply 5 pulses, SIM module sends 4 SMSs (first one is missing sometimes).
So SIM module working as like its in sleep mode whether there is no AT command has been uploaded to set it in sleep mode. But sometimes first pulse in a daily usage is missing.
*Note: a1000uF capacitor has been soldered to Vcc and GND of SIM module but the problem still continues. Sometimes it does send the first SMS in a row of pulses but sometimes not.
void updateSerial()
{
delay(2000);
while (Serial.available())
{
mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port
}
while(mySerial.available())
{
Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port
}
}
this code runs normally, in serial monitor everything and every respond seems normal but sometimes after a while first sms is missing.
thanks.
No, there is no Error message. It looks same respond whether the SMS has been sent or not.
On the serial monitor;
////not recieved SMS
OK
AT
OK
AT+CMGF=1
OK
AT+CMGS=”+9XXXXXXXXXXX”
> SMS TEXT SMS TEXT….
////received SMS
OK
AT
OK
AT+CMGF=1
OK
AT+CMGS=”+9XXXXXXXXXXX”
> SMS TEXT SMS TEXT….
The first sent message pretends to take the module out of sleep mode. But there is no command for sleep mode and also this issue is not happening always.
According to the AT Commands document from the manufacturer, in the example on page 361 under the tittle “SMS Commands”, you should receive an OK after you close the message with “Ctrl+Z”. You can check this by adding an aditional updateSerial() after the mySerial.write(26);
Since your code doesn’t check if the previous command has been received properly before sending a new command, maybe at some point the software gets de-syncronized with the actual state of the SIM800.
I added one more updateSerial() after mySerial.write(26) but its still same.
OK
AT
OK
AT+CMGF=1
OK
AT+CMGS="+9xxxxxxxxxxx"
> SMS TEXT SMS TEXT…
+CMGS: 182
OK
AT
OK
AT+CMGF=1
OK
AT+CMGS="+9xxxxxxxxxxx"
> SMS TEXT SMS TEXT… //this hasn't been received
+CMGS: 183
OK
AT
OK
AT+CMGF=1
OK
AT+CMGS="+9xxxxxxxxxxx"
> SMS TEXT SMS TEXT…
I still see a weird pattern on the responses you receive. Shouldn’t you start with a AT<CR LF>OK<CR LF> instead of a <CR LF>OK<CR LF>AT ? If the module is responding to all your commands, I don’t think you can say it is in a sleep mode of some kind.
there are still lost messages but less than the previous situation.
+CMGS: 231
OK
AT
OK
AT+CMGF=1
OK
AT+CMGS="+901111111111" //idle number
> TEXT SMS TEXT SMS..
ERROR
AT+IPR=9600
OK
AT
OK
AT+CMGF=1
OK
AT+CMGS="+9xxxxxxxxxxx" //real number
> TEXT SMS TEXT SMS..
I’ve already deleted this line, its useless, it makes no effect on it.
For the power source; a 9V 2A adapter is used. Arduino Nano and LM2596 buck converter are powered up by that adapter.
4.1V (from converter) is applied to SIM800 and voltage divider with 10k and 20k resistors to feed Rx terminal between D2 of the Nano and GND.
Tx is directly connected to D3 of the Nano.
Ok, on this document on page 32 the manufacturer shows a simple circuit to properly interface the SIM800 with a 5v microcontroller. Keep in mind that VDDEXT is 2.8v.