can i connect VCC pin of GSM module to VU of nodemcu? i have a code to send sms using GSM and esp8266. but it never send. the output of serial monitor is:
Waiting 10 seconds to send SMS… Sending SMS… —> AT+CMGF=1 <—
ERROR SMS not sent! Waiting 10 seconds to send SMS… Sending SMS…
—> AT+CMGF=1 <— ERROR SMS not sent! Waiting 10 seconds to send
SMS… Sending SMS… —> AT+CMGF=1 <— ERROR SMS not sent!
and my code is:
#include <SoftwareSerial.h>
#include <Adafruit_FONA.h>
#define FONA_RX D3
#define FONA_TX D4
#define FONA_RST D5 // Define FONA_RST pin
SoftwareSerial mySerial(FONA_RX, FONA_TX);
Adafruit_FONA fona = Adafruit_FONA(FONA_RST); // Initialize FONA object with the software serial port
void setup() {
pinMode(FONA_RST, OUTPUT); // Set FONA_RST pin as OUTPUT
digitalWrite(FONA_RST, HIGH); // Reset FONA
delay(100);
digitalWrite(FONA_RST, LOW);
delay(1000); // Wait for FONA to initialize
Serial.begin(9600);
mySerial.begin(9600); // Set the baud rate to 9600
if (!fona.begin(mySerial)) {
Serial.println(F("Couldn't find FONA"));
while (1);
}
Serial.println(F("FONA is OK"));
}
void loop() {
Serial.println(F("Waiting 10 seconds to send SMS..."));
delay(10000);
Serial.println(F("Sending SMS..."));
char phoneNumber[] = "+989333639888"; // Define phoneNumber as char array
char message[] = "Hello from NodeMCU!"; // Define message as char array
if (fona.sendSMS(phoneNumber, message)) {
Serial.println(F("SMS sent!"));
} else {
Serial.println(F("SMS not sent!"));
}
delay(60000); // Wait 60 seconds before sending another SMS
}
when i type and send any AT command in serial interface of Arduino ide nothing happen.