Application Note #13 - ESP32-CAM Web Server - with platformIO
INCOMPLETE…
Objectives
- connect and program an ESP32-CAM as a streaming video server using the platformIO IDE using these instructions : Reference 0: instructions for using esp32 cam with platformIO
- to that end
- choose and purchase an ESP32-CAM dev board
- download documentation
- connect the FTDI programmer
- program the ESP32-CAM with the web server as described in the Kee Yees documentation (tutorial)
Description
- create an ESP32-CAM based video streaming server
- this duplicates Application Note 9 except it uses platformIO not the arduino IDE
Platform
- CentOS Stream release 8
- Platformio IDE
=============================================================================
References
- Reference 0: ESP32-CAM with PlatformIO: Video streaming and face recognition
- Reference 1 : Kee Yees ESP32-CAM on Amazon…
- Reference 2 : Amazon Order…
- Reference 3 : KeeYees ESP32-CAM product web page…
- Reference 4 : KeeYees ESP32-CAM Tutorial (my gdrive copy of ESP32-CAM.zip downloaded from Reference 2)…
- Reference 5 : ESP32-CAM-KIT-English.pdf extracted from Reference 3…
- Reference 6 : Espressifs github repo for camera web app software…
- Reference 7 : Comprehensive ESP32 Reference……
- Reference 8 : Camera web server and home assistant…
- Reference 9 : Howto use the built in LED…
- Reference 10 : ESP32 Cam + node-red + home assistant…
- $10 DIY Wireless IP Security Camera for 3D Printers & Home…
Procedures
Step 1
Choose an ESP32-CAM dev board
- I chose the Kee Yees ESP32-CAM dev board shown in Reference 1… because it was an Amazon Choice, good reviews, it was cheap and documentation was available on the web site (Reference 3… and Reference 4…).
Step 2
Purchase the device
- (see Reference 2…). Ordered form Amazon.ca, May 24, 2020 for 22.99$
Step 3
Get documentation
- Download ESP32-CAM.zip from Reference 3….
- for convenience, use Reference 4 : my gdrive copy of ESP32-CAM.zip…
Step 4
Install software
- Install requisite software in CentOS
1
2
3
4
5
6
7
8
9
10
11
12
13# Install python3 and python2
sudo dnf install python2
# See : (https://linuxize.com/post/how-to-install-python-on-centos-8/)
sudo dnf install python3
# use python2
sudo alternatives --set python /usr/bin/python2
# install pyserial
sudo pip2 install pyserial
# set permissions on /dev/ttyUSB0
# https://www.arduino.cc/en/guide/linux#toc6
ls -l /dev/ttyUSB0
sudo usermod -a -G dialout fcarella
# logout/log back in - General Instructions to Install Platform IO
- follow these instructions…
0 Install platformIO on arch1
yay -Syu platformio
- follow these instructions…
Step 5
Program the ESP32-CAM
Connect the ftdi (see Reference 5, Page 11…)
- use the ftdi USB to TTL Serial Converter to connect esp32 to the computer for programming
Setup PlatformIO IDE for ESP32 programming
following notes are based on Reference 0.
Download and install VSCode and then install the Platform IO extension if you dont have it already (Refernce 0 has details)
Clone the Github repository containing the source code for CameraWebServer.
1
2cd ~/
git clone https://github.com/espressif/arduino-esp32.gitimport the Arduino Project
open the folder we just downloaded in the previous step (~/arduino-esp32/libraries/ESP32/examples/Camera/CameraWebServer) and choose AI Thinker ESP32-CAM and check the “use libraries installed by Arduino IDE” checkbox. This will download all the necessary sdk’s and frameworks for working the ESP32 CAM in platformio
Open CameraWebServer.ino using PlatformIO and modify the code as shown below:
Uncomment this line1
and edit your credentials
1
2const char* ssid = "your_wifi_ssid";
const char* password = "your_wifi_password";build/compile the app
upload the app to the ESP32 CAM
NOTE** make sure ESP32 is in programming mode () pins IO0 is shorted to GND and ESP32 is reset)
NOTE** did it work?
-Make sure the config file, platformio.ini has the right baud rate configured to the serial monitor
(monitor_speed=115200)
platformio.ini–>
1 | [env:esp32cam] |
take the ESP32 out of programming mode (disconnect pin IO0 from gnd and reset the ESP32)
open the serial monitor and reset the ESP32. Note the ESP32 output showing the URL of the video stream…
point your browser to the URL and confirm video streaming works…