Esp32s3 video server with motion detection and sms notification (sim900)

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

I moved your topic to an appropriate forum category @jay-jay05.

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

1 Like

Please check the power supply of your SIM900. It should be powered with a separate 5v,2A DC power supply. If possible, you can cross-check your SIM900 with an Arduino. Here is how you can do this: Receive SMS with AT Commands using Sim900 and Arduino - The Engineering Projects

1 Like

Ok thanks i will try

I have to mention i use this esp: https://www.aliexpress.com/item/1005004339894833.html?pdp_npi=4%40dis!USD!US%20%2419.71!US%20%2419.71!!!141.26!141.26!%402101f00017096688992975128ea1b7!12000035916969764!sh01!CZ!1815509229!&spm=a2g0o.store_pc_home.productList_2006668552549.1005004339894833

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.