Can someone help me I'm stuck on this part because Sim800l does not send the URL in the text. Somehow whenever I put a link it does not get recognized (?).
Down below is the a sample code that I made and using Google Maps as the link to be sent. the code works using different text messages but when it comes to links does not send any texts.
Any replies and help is very much appreciated thanks!
#include <SoftwareSerial.h>
// Create a SoftwareSerial object for SIM800L
SoftwareSerial sim800l(2, 3);
void setup() {
// Start the serial communication with your computer
Serial.begin(9600);
// Start the serial communication with SIM800L
sim800l.begin(9600);
delay(2000); // Wait for SIM800L to initialize
}
void loop() {
// Check if a message is received
if (sim800l.available()) {
// Read the received message
String message = sim800l.readString();
Serial.println("Received Message: " + message);
}
// Send a text message
sendMessage("+xxxxxxxxxx", "Check out these URLs:\n1. https://www.google.com/maps/@latitude,longitutde");
delay(5000); // Wait for 5 seconds
}
void sendMessage(const String& phoneNumber, const String& message) {
// Set the SIM800L to text mode
sim800l.println("AT+CMGF=1");
delay(1000);
// Set the recipient phone number
sim800l.print("AT+CMGS=\"");
sim800l.print(phoneNumber);
sim800l.println("\"");
delay(1000);
// Send the message
sim800l.print(message);
delay(100);
// Send the Ctrl+Z character (end of message)
sim800l.write(0x1A);
delay(1000);
}