Aim:This Article explains how to set up ESP 32 Camera Module as an Access Point Mode to connect to it directly through WIFI from Smart Devices.
The ESP32-CAM in Access Point mode (AP mode) means that the device itself acts as a Wi-Fi network that other devices (like smartphones, laptops, or tablets) can connect to directly. In this mode, the ESP32-CAM does not connect to an existing Wi-Fi network; instead, it creates its own network. Key Points of ESP32-CAM in Access Point Mode:Wi-Fi Network Creation: In AP mode, the ESP32-CAM creates its own Wi-Fi network, which other devices can join by connecting to the SSID (network name) broadcasted by the ESP32-CAM. Direct Connection: Devices connected to the ESP32-CAM's Wi-Fi network can communicate directly with it without needing an external router or internet connection. This is useful when you don't have an existing Wi-Fi network or want direct communication. Local Streaming: Once connected, you can access the ESP32-CAM's video stream or snapshots by entering the ESP32-CAM’s IP address (usually 192.168.4.1 in AP mode) into a web browser on the connected device. IP Address: The ESP32-CAM assigns itself a static IP address (often 192.168.4.1 ) and provides IP addresses to the devices connected to it via DHCP. Range Limitation: In AP mode, the communication range is limited to the ESP32-CAM’s Wi-Fi signal range, and devices need to be within that range to connect and access the camera feed.
Example Use Case:- Suppose you’re using the ESP32-CAM in a remote location without Wi-Fi access. You can set it up in AP mode, allowing your smartphone to connect directly to the ESP32-CAM’s Wi-Fi network to view the camera feed without needing an external network.
Prerequisites:
ESP32 Web Cam Module - 1 Jumper Pins - 4 to 5 Numbers USB to TTL Converter (To Program the ESP32 alone)
Program the ESP 32 Camera Module:
Connect the ESP 32 Camera Module and make sure the respective Port is selected in the Arduino IDE. Then Go to File > Examples > ESP32 > Camera > CameraWebServer Code. It will load the default Code, make the below code changes to make ESP 32 work in Soft Access Point Mode.
Update SSID: const char* ssid = "ECAP-Connect"; const char* password = "ComplexPassword";
Uncomment the below code: #define CAMERA_MODEL_AI_THINKER // Has PSRAM
In Setup() Method:
Comment the below station method and add the Access point Code as shown below
// ** Station Method // WiFi.begin(ssid, password); // // while (WiFi.status() != WL_CONNECTED) { // delay(500); // Serial.print("."); // } // Serial.println(""); // Serial.println("WiFi connected");
//** Access Point Method WiFi.softAP(ssid, password);
Connect to ESP 32 Camera Module: After uploading the code, You can connect to ESP32 Module through WIFI Settings on your Smart Device and access this Local IP "192.168.4.1" in your Browser to view the Video Stream of ESP32 Camera Module.
Module:
Browser: 192.168.4.1
Click on the "Start Stream" to view the Video Stream from ESP32 WebCam.
How It Works: - The ESP32-CAM creates a Wi-Fi network named
ESP32-CAM_AccessPoint with the password 12345678 . - Once a device connects to this network, it can access the ESP32-CAM’s video feed or other data by navigating to the IP address
192.168.4.1 in a web browser.
Advantages of Access Point Mode:- Portability: You can use the ESP32-CAM in areas without an existing Wi-Fi network.
- Direct Access: No external routers or internet access are needed for devices to communicate with the ESP32-CAM.
Disadvantages:- Limited Range: The range of the Wi-Fi network created by the ESP32-CAM is limited to the ESP32’s signal strength.
- No Internet Access: Devices connected to the ESP32-CAM network won't have access to the internet unless additional configurations (like bridging) are set up.
|