Hello
I want to send sms with sim800l module, my circuit is like the following circuit, with the difference that instead of arduino uno, I used a nodemcu, and I also used a 2 amp adapter for electricity. I put a capacitor (1000uf 50 volts) in its path. The voltage that reaches the module is about 4.2 volts. The module turns on and the module light flashes. I also put the nodemcu program below. The module sets the setting time for error text mode.
Thank you for your help.
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include <SoftwareSerial.h>
#define rxPin D6
#define txPin D5
SoftwareSerial mySerial(rxPin,txPin);
//// UDP
//WiFiUDP UDP;
//IPAddress local_IP(192,168,4,1);
//IPAddress gateway(192,168,4,1);
//IPAddress subnet(255,255,255,0);
//#define UDP_PORT 4210
//
//// UDP Buffer
//char packet[255];
//char reply[] = "Packet received!";
void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
Serial.println("Initializing...");
delay(1000);
mySerial.println("AT");
updateSerial();
mySerial.println("AT+CSQ");
updateSerial();
mySerial.println("AT+CSCS?");
updateSerial();
mySerial.println("AT+CREG?");
updateSerial();
mySerial.println("AT+CMGF=1");
updateSerial();
mySerial.println("AT+CMGF?");
updateSerial();
mySerial.println("AT+CMGS=\"+xxxxxxxxxxxx\"");
updateSerial();
mySerial.print("Last Minute Engineers | lastminuteengineers.com");
updateSerial();
mySerial.write(26);
}
void loop()
{
// // If packet received...
// int packetSize = UDP.parsePacket();
// if (packetSize) {
//// Serial.print("Received packet! Size: "); Serial.println(packetSize);
// int len = UDP.read(packet, 255);
// if (len > 0) {
// packet[len] = '\0';
// }
//// Serial.print("Packet received: ");
// Serial.println(packet);
//
// // Send return packet
// UDP.beginPacket(UDP.remoteIP(), UDP.remotePort());
// UDP.write(reply);
// UDP.endPacket();
// }
updateSerial();
}
void updateSerial()
{
delay(500);
while (Serial.available())
{
mySerial.write(Serial.read());
}
while(mySerial.available())
{
Serial.write(mySerial.read());
}
}
And this is the output: