-
1Setup, gather components
For programming you will need a suitable development environment, I use the Arduino IDE, but this code should work in the Espressif development environment too.
Follow This Guide to set up the Espressif Arduino core in the IDE.
The AI-THINKER board requires use of an external 3.3v serial adapter to program; I use a
FTDI Friend
adapter, for more about this read AdaFruits excellent FTDI Friend guide.Be careful not to use a 5v serial adapter since this will damage the ESP32.
-
2Hookup
Hooking this up is pretty simple, see the diagram below.
Connect the RX line from the serial adapter to the TX pin on ESP32
The adapters TX line goes to the ESP32 RX pin
The GPIO0 pin of the ESP32 must be held LOW (to ground) when the unit is powered up to allow it to enter it's programming mode. This can be done with simple jumper cable connected at poweron, fitting a switch for this is useful if you will be reprogramming a lot.
You must supply 5v to the ESP32 in order to power it during programming, the FTDI board can supply this.
-
3Configure
Download the code from the Files section here or grab the latest release from Github at: https://github.com/easytarget/esp32-cam-webserver/releases/latest
- You can get the latest stable development release by cloning / downloading the
master
branch of the repo.
This will give you an archive file with the Version number in it, eg.
esp32-cam-webserver-3.0.zip
. Tou need to unpack this into your Arduino sketch folder, and then you need to rename the folder you just extracted to remove the version number, eg.esp32-cam-webserver-3.0
becomesesp32-cam-webserver
.Once you have done that you can open the sketch in the IDE by going to the
esp32-cam-webserver
sketch folder and selectingesp32-cam-webserver.ino
.In the sketch dont edit the main
esp32-cam-webserver.ino
sketch file, instead; copy the filemyconfig.sample.h
tomyconfig.h
and edit the settings there.You can set the camera board type, WiFi settings and some hardware/ui defaults in that file. Everything iscommented, and this file can remain private (it is in the .gitignore list).
- You can get the latest stable development release by cloning / downloading the
-
4Programming
Assuming you are using the latest Espressif Arduino core the AI-THINKER board will appear in the ESP32 Arduino section of the boards list.
Compile and upload the code from the IDE, when the
Connecting...
appears in the console reboot the ESP32 module while keeping GPIO0 grounded. You can release GPIO0 once the sketch is uploading, most boards have a 'boot' button to trigger a reboot.Once the upload completes (be patient, it can be a bit slow) open the serial monitor in the IDE and reboot the board again without GPIO0 grounded. In the serial monitor you should see the board start, connect to the wifi and then report the IP address it has been assigned.
If you have a status LED configured it will give a single slow flash when it begins attempting to conenct to WiFi, and three short flashes once it has succeeded. It will also flash briefly when you access the camera to change settings.
-
5Use!
Go to the URL given in the serial output, the web UI should appear with the settings panel open. Click away!
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.