This is an old revision of the document!
* Student: Zoican Denis-Alexandru
The goal of this project is to alert the system's owner when an object approaches the system. When this happens, a photograph of the object is taken, and the user can view the image from any network-connected device.
The project was developed on 2 different boards: 1. ESP32 board - the code was written using Arduino IDE, where I used the Arduino libraries 2. Raspberry Pi 4 - the code was written in Python, where I used OpenCV and Flask
1. ESP32 board The code is divided in functions for a better understanding of the logic. The following code demonstrates how the boards connect to WiFi in order to communicate with the Raspberry Pi 4. The board's mode will be set to WIFI_STA, the board being able to connect to an WIFI network. The authentication procedure begins with the use of the network's name and password.
void connectToWifi(){ Serial.println("Connecting.. status: " + String(WiFi.status())); WiFi.mode(WIFI_STA); WiFi.begin(WIFI_NETWORK,WIFI_PASSWORD); unsigned long startAttemptTime = millis(); while(WiFi.status() != WL_CONNECTED && millis()-startAttemptTime < WIFI_TIMEOUT){ Serial.print("."); delay(100); } if(WiFi.status() != WL_CONNECTED){ Serial.println("Failed to connect"); } else { Serial.println("Connected"); Serial.println(WiFi.localIP()); }