The ESP32-S3 CAM is a small and affordable camera board that can stream live video over Wi-Fi.
In this project, we'll make the camera accessible from our phone and use ngrok to access it remotely.
What You'll Need
ESP32-S3 CAM
USB cable
Wi-Fi connection
Computer
ngrok account
Step 1: Connect the ESP32-S3 CAM to Wi-Fi
First, upload the camera streaming code to your ESP32-S3 CAM.
Add your Wi-Fi name and password:
const char* ssid = "YOUR_WIFI_NAME";
const char* password = "YOUR_WIFI_PASSWORD";
Upload the code and open the Serial Monitor.
Once connected, the ESP32-S3 CAM will display its local IP address.
For example:
http://192.168.1.100
Open this address in your browser to access the live camera stream.
Step 2: Test the Local Camera Stream
Make sure your phone or computer is connected to the same Wi-Fi network as the ESP32-S3 CAM.
Open the camera's IP address and start the live stream.
Your camera is now working locally! 📹
However, there is one limitation.
The camera cannot be accessed when you leave the Wi-Fi network.
Step 3: Use ngrok
1. Create an ngrok Account
Go to ngrok and create a free account.
2. Install ngrok
If you're using a Mac, open Terminal and run:
brew install ngrok
You can also download ngrok directly from the official website.
3. Add Your Authtoken
Copy your authtoken from your ngrok dashboard and run:
ngrok config add-authtoken YOUR_AUTHTOKEN
4. Start the Camera Tunnel
Make sure your ESP32-S3 CAM is running and accessible on your local network.
Then run:
ngrok http YOUR_ESP32_IP:80
For example:
ngrok http 192.168.1.100:80
ngrok will generate a public URL.
Open that URL on your phone, and you can access your ESP32-S3 CAM remotely! 📱📹
ngrok creates a tunnel that allows you to access a local service through the internet.
Open your terminal and start ngrok using the port where your camera stream is available.
Step 4: Open the Camera From Your Phone
Copy the ngrok URL and open it on your phone.
Now try turning off Wi-Fi and switching to mobile data.
Open the ngrok URL again.
If everything is working correctly, you should be able to see your ESP32-S3 CAM live stream remotely! 🎉
How It Works
ESP32-S3 CAM
↓
Wi-Fi
↓
Local Network
↓
ngrok
↓
Internet
↓
📱 Phone
Important Security Note
Be careful when making a camera accessible through the internet.
Do not use a publicly accessible stream as a real security system without proper authentication and security.
Watch the Full Video
🎥 Watch the complete tutorial on my YouTube channel.
The full code and project files are available on GitHub.
Happy building! 🚀
#ESP32S3 #ESP32CAM #ESP32 #ngrok #IoT

Post a Comment