Skip to content

Commit d3397e6

Browse files
committed
Merge branch 'master' of ssh://easytarget.org:22022/owen/esp32-cam-webserver
2 parents 1a541cd + cbea427 commit d3397e6

File tree

1 file changed

+37
-19
lines changed

1 file changed

+37
-19
lines changed

README.md

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,73 @@
11
# Espressives ESP32-CAM example revisited.
22
## Taken from the ESP examples, and modified for reality
33
This sketch is a extension/expansion/rework of the 'official' ESP32 Camera example sketch from Espressif:
4+
45
https://github.com/espressif/arduino-esp32/tree/master/libraries/ESP32/examples/Camera/CameraWebServer
6+
57
- The example they have is nice, but a bit incomprehensible and hard to modify as supplied. It is very focused on showing off the face recognition capabilities, and forgets the 'webcam' part.
6-
- There are many other variants of a webcam server for these module sonline, but most are created for a specific scenario and not good for general, casual, webcam use.
8+
- There are many other variants of a webcam server for these modules online, but most are created for a specific scenario and not good for general, casual, webcam use.
9+
10+
![My Gods, it's full of cats!](Docs/mygodsitsfullofcats.png)
11+
12+
Hopefully this expanded example is more useful for those users who wish to set up a simple ESP32 based webcam using the cheap(ish) modules freely available online. Especially the AI-THINKER board:
713

8-
I believe this expanded example is more useful for those users who wish to set up a simple ESP32 based webcam using the cheap(ish) modules freely available online. Especially the AI-THINKER board:
14+
#### AI-THINKER ESP32-CAM vs Other Modules:
915

10-
### AI-THINKER ESP32-CAM vs Other Modules:
1116
I have four of the AI-THINKER boards, so the descriptions below are for that board. But I took care to leave the default definitions and controls for other boards in the example intact. You may need to adjust the programming method to suit the your board, look for examples online.
12-
For some other good examples and information on ESP32 based webcams I also recommend the sketches here:
17+
18+
* For some other good examples and information on ESP32 based webcams I also recommend the sketches here:
1319
https://github.com/raphaelbs/esp32-cam-ai-thinker
14-
The AI thinker wiki can be quite informative, when run through an online translator and read sensibly:
20+
21+
* The AI thinker wiki can be quite informative, when run through an online translator and read sensibly:
1522
https://wiki.ai-thinker.com/esp32-cam
1623

1724
## Setup:
25+
1826
* 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.
19-
* Follow [This Guide](https://github.com/espressif/arduino-esp32/blob/master/docs/arduino-ide/boards_manager.md) to set up the Espressif Arduino core in the IDE.
20-
* 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](https://learn.adafruit.com/ftdi-friend).
21-
* Be careful not to use a 5v serial adapter since this will damage the ESP32.
27+
* Follow [This Guide](https://github.com/espressif/arduino-esp32/blob/master/docs/arduino-ide/boards_manager.md) to set up the Espressif Arduino core in the IDE.
28+
* 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](https://learn.adafruit.com/ftdi-friend).
29+
* Be careful not to use a 5v serial adapter since this will damage the ESP32.
30+
2231
### Wiring
32+
2333
Is pretty simple, see the diagram below.
2434
![](http://)
25-
* Connect the RX line from the serial adapter to the TX pin on ESP32
26-
* The adapters TX line goes to the ESP32 RX pin
27-
* 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.
28-
* You must supply 5v to the ESP32 in order to power it during programming, the FTDI board can supply this.
35+
* Connect the **RX** line from the serial adapter to the **TX** pin on ESP32
36+
* The adapters **TX** line goes to the ESP32 **RX** pin
37+
* 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.
38+
* You must supply 5v to the ESP32 in order to power it during programming, the FTDI board can supply this.
2939

3040
### Config
3141

42+
You need to set the Board you are using in the main `esp32-cam-webserver.ino` sketch file, it defaults to the AI-THINKER, but the WRover Kit, ESP Eye and M5Stack are also availiable.
43+
44+
You can also set the camera name plus SSID and password for your WiFi network in that file, or follow the notes about using a separate file for your settings.
45+
3246
### Programming
47+
3348
Assuming you are using the latest Espressif Arduino core the AI-THINKER board will appear in the ESP32 Arduino section of the boards list.
34-
![](http://)
35-
Compile and upload the code from the IDE, and open the serial monitor; you should see the board start, begin connecting to the wifi, connect and then report the IP address it has been assigned.
36-
Go to the URL given in the serial output, the web UI should appear with the settings open. Click away!
3749

38-
## Specifics:
50+
![Like This](Docs/board-selection-small.png)
51+
52+
Compile and upload the code from the IDE, while keeping **GPIO0** grounded. Open the serial monitor; you should see the board start, begin connecting to the wifi, connect and then report the IP address it has been assigned.
53+
54+
Go to the URL given in the serial output, the web UI should appear with the settings panel open. Click away!
55+
56+
## My Modifications:
3957
The basic example is extended to allow control of a high power LED FlashLamps like the ones used on mobile phones, which are present on some modules. It can also blink a status LED to show when it connects to WiFi.
4058

4159
The WiFi details can be stored in an (optional) header file to allow easier further development, and a camera name for the UI title can be configured. The lamp and status LED's are optional, and the lamp uses a exponential scale for brightness so that the control has some finess.
4260

43-
The compressed and binary encoded HTML used in the example has been unpacked to raw text, this makes it much easier to access and modify the Javascript and UI elements. Given the relatively small size of the index page there is very little benefit from compressing it, .
61+
The compressed and binary encoded HTML used in the example has been unpacked to raw text, this makes it much easier to access and modify the Javascript and UI elements. Given the relatively small size of the index page there is very little benefit from compressing it.
4462

4563
I have left all the Face Recognition code untouched, it works, and with good lighting and camera position it can work quite well. But you can only use it in low-resolution modes, and it is not something I wil be using.
4664

4765
The web UI has had minor changes to add the lamp control (only when enabled), I also made the 'Start Stream' and 'Snapshot' controls more prominent, and added feedback of the camera name + firmware.
4866

4967
## Notes:
5068
* I only have AI-THINKER modules with OV2640 camera installed; so I have only been able to test with this combination. I have attempted to preserve all the code for other boards and the OV3660 module, and I have merged all changes for the WebUI etc, but I cannot guarantee operation for these.
51-
* I created a small board with a handy switch for power, a pushbutton for the GPIO0 programming switch, and a socket for the AI-THINKER board. This proved very useful for development work.
52-
* I found some excellent [cases on Thingieverse](https://www.thingiverse.com/thing:3708345)
69+
* I created a small board with a handy switch for power, a pushbutton for the GPIO0 programming switch, and a socket for the AI-THINKER board. This proved very useful for development work and programming multiple devices.
70+
* I found some excellent [cases on Thingieverse](https://www.thingiverse.com/thing:3708345).
5371

5472
## Plans
5573
* Improve Wifi, add a captive portal for setup and fallback, better disconnect/reconnect behaviour.

0 commit comments

Comments
 (0)