I'm trying to find solution for my problem almost 2 days.
I have ch340 and sim800l. My idea is simple - want to turn on and off LED with sms message.
But, I have problem with reading sms. Last night I tryed many, many solutions and once receive SMS text on Serial Monitor, but aftet that I tryed many things without success.
Here is code:
#include <SoftwareSerial.h>
//Create software serial object to communicate with SIM800L
SoftwareSerial mySerial(3, 2); //SIM800L Tx & Rx is connected to Arduino #3 & #2
void setup()
{
//Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
Serial.begin(9600);
//Begin serial communication with Arduino and SIM800L
mySerial.begin(9600);
Serial.println("Initializing...");
delay(1000);
mySerial.println("AT"); //Once the handshake test is successful, it will back to OK
updateSerial();
mySerial.println("AT+CSQ"); //Signal quality test, value range is 0-31 , 31 is the best
updateSerial();
mySerial.println("AT+CCID"); //Read SIM information to confirm whether the SIM is plugged
updateSerial();
mySerial.println("AT+CREG?"); //Check whether it has registered in the network
updateSerial();
mySerial.println("AT+CMGF=1"); // Configuring TEXT mode
updateSerial();
mySerial.println("AT+CNMI=1,2,0,0,0"); // Decides how newly arrived SMS messages should be handled
updateSerial();
}
void loop()
{
updateSerial();
}
void updateSerial()
{
delay(500);
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
}
}
On attached picture you can see output on serial monitor.
It looks signal is good, it is registered on home network, etc.
But when I send sms - LED on sim800l module just blinks few times fast and there is no sms on SM.
Any Solution? Thanks.
Yes, that is right tutorial. There is many same or verry similiar variations on internet.
Yes, I saw sms message last night, but not sure I used the 100% same code. As I told you, I tryed so many solutions...
Maybe I have right trace/track now...
When I connect sim800l module directly on 5v, it works fine and show me result in serial monitor as from picture. But as I told in first post, when I send sms - module start blinking rapidly without sms text on serial monitor. So, after 2 days I get idea what that can be.
AT command "AT+CREG?" show me is module registered on network. I started typeing command every second while sending sms from phone with second hand. And voila! Module lost connection/network every time when it need to receive sms...
I have LM 317 and trying with it to change voltage, but in that case module won't get network...
I am pretty sure now code is OK. Trying to find out how to fix this issue.
The LM317 may need be able to supply 2A the tutorial says is needed during some transmission bursts, buts not clear what is actually required to receive an sms and not drop from the network due to low power. I have seen reference on the internet to some modules dropping off the network if the voltage drops below 4.0.
When I connect sim800l module directly on 5v, it works fine and show me result in serial monitor as from picture.
The operating voltage of the chip is from 3.4V to 4.4V. Connecting to 5v is a bad idea.
Can you provide details of the module you actually have, and how it is being powered?