Hallo i need help with spil some codes together for my school project. AI didn't help me and I really don't know. There is url for web server it works perfect Freenove_Basic_Starter_Kit_for_ESP32/C/Sketches/Sketch_17.1_CameraWebServer at main · Freenove/Freenove_Basic_Starter_Kit_for_ESP32 · GitHub and there is motion detection EloquentEsp32cam/examples/Motion_Detection/Motion_Detection.ino at 2 · eloquentarduino/EloquentEsp32cam · GitHub and code for sending sms
#include <HardwareSerial.h>
HardwareSerial SIM900(1); // Použijeme UART1
void setup() {
Serial.begin(115200); // Otevřete sériovou komunikaci s počítačem pro ladění
// Nastavte UART1 pro ESP32-S3, předpokládáme piny RX=44 a TX=43
SIM900.begin(9600, SERIAL_8N1, 18, 17); // Baud rate 9600, 8 data bits, no parity, 1 stop bit
Serial.println("Initializing...");
delay(2000); // Počkejte, až se SIM900 inicializuje
// Základní AT příkazy pro kontrolu spojení
sendATCommand("AT"); // Handshaking s SIM900
sendATCommand("AT+CSQ"); // Zkontrolujte signál
sendATCommand("AT+CCID"); // Číslo SIM karty
sendATCommand("AT+CREG?"); // Stav registrace sítě
// Konfigurace pro odesílání SMS
SIM900.println("AT+CMGF=1"); // Nastavení textového módu pro SMS
delay(3000);
SIM900.print("AT+CMGS=\"+xxxxxxxx\""); // Nastavte číslo, na které chcete SMS odeslat
delay(3000);
SIM900.println("TEST SMS FROM ESP32 SiM900"); // Obsah SMS
SIM900.println((char)26);
delay(400);
SIM900.println();
// Give module time to send SMS
delay(5000);
}
void loop() {
// Přeposílejte vše z SIM900 do sériového monitoru a zpět
if (SIM900.available()) {
Serial.write(SIM900.read());
}
if (Serial.available()) {
SIM900.write(Serial.read());
}
}
void sendATCommand(String command) {
SIM900.println(command);
delay(500); // Počkejte na odpověď
while (SIM900.available()) {
Serial.write(SIM900.read()); // Vypište odpověď do sériového monitoru
}
}
but the code dont sending sms bit idk
i must do on server button to starting motion detection
task is very hard for me if motion detection detect something sim900 send me sms
Thanks for help