Welcome to ESP32 WiFi Camera Lite repository
Configure camera on PC
Configure camera on PC
Note: The camera has been burned with factory firmware. If you have not burned other AI single-instance firmware, you do not need to burn the factory firmware again. The factory firmware of the camera only provides bin file burning, and does not provide program source code.
1. esp camera connected to computer
Connect the computer and esp32 camera via type-c data cable,

2. Serial port configuration
Baud rate 115200, no parity check, no hardware flow control, 1 stop bit
If you use the serial port assistant configuration, you need to remove the automatic sending of new lines (additional bits) when sending commands
As shown in the figure: The following figure indicates that the factory firmware has been burned.

2.1 Setwifi command in STA mode (mode for connecting to LAN)
| Command | Description | Example | Remarks |
|---|---|---|---|
| sta_ssid: | wifi name to connect | sta_ssid:yahboom | yahboom: is the wifi to connect |
| sta_pd: | wifi password to connect | sta_pd:12345678 | 12345678: is the wifi password to connect |


Notes
- Whether it is sta_ssid or sta_pd, it must be followed by an English character such as a comma (,), colon (:), period (.), etc.**
- When the wifi to be connected does not have a password, just send sta_pd: once.
- The above command will return OK if it is successful. If it does not return any information, check the serial port connection.
- When sending the sta_ssid: command, it will return fail,ssid is null!, indicating that the connected wifi name cannot be empty.
- The command can be sent in all uppercase or lowercase.
- The wifi name and password cannot exceed 30 characters in length, otherwise the configuration fails.
- The wifi name and password cannot contain Chinese characters.
- Every time the wifi password is changed, it will be automatically reset. If you only change the wifi name, you need to manually power off and reset
2.2. Configure the wifi command in AP mode (module self-heating point mode)
| Command | Description | Example | Remarks |
|---|---|---|---|
| ap_ssid: | The wifi name to be set | ap_ssid:my_wifi | my_wifi: the wifi you want to set |
| ap_pd: | the wifi password you want to set | sta_pd:12345678 | 12345678: the wifi password you want to set |
Use the default hotspot name. You don't need to set a password.
Notes
- Whether it is ap_ssid or ap_pd, it must be followed by an English character such as a comma (,), colon (:), period (.), etc.**
- When the wifi you want to set has no password, you only need to send ap_pd: once.
- The above command will return OK if it is successful. If it does not return any information, check the serial port connection.
- When sending the ap_ssid: command, it will return fail,AP_Name is null!, indicating that the wifi name cannot be empty.
- The command can be sent in all uppercase or lowercase letters.
- The wifi name and password cannot exceed 30 characters in length, otherwise the configuration will fail.
- The wifi name and password cannot contain Chinese characters.
- The wifi password will be automatically reset every time it is changed. If you only change the wifi name, you need to manually power off and reset
2.3 Configure wifi mode
| Command | Description | Example | Remarks |
|---|---|---|---|
| wifi_mode: | Configure wifi mode | wifi_mode:2 | 0: AP mode 1: STA mode 2: AP+STA mode |

Notes
- wifi_mode must be followed by an English character such as comma (,), colon (:), period (.), etc.
- wifi_mode can only be set to 3 modes. If a negative number is passed in, the default is AP mode. If the number is greater than 2, the default is AP+STA mode
2.4 Set AI mode
| Command | Description | Example | Remarks |
|---|---|---|---|
| ai_mode: | Configure AI recognition mode | ai_mode:0 | 0: Normal mode 1: Cat and dog detection 2: Face detection 3: Color recognition 4: Face recognition 5: QR code recognition |

The module will be reset after changing the ai mode.
Notes
- ai_mode must be followed by an English character such as comma (,), colon (:), period (.), etc.
- ai_mode can only set 5 modes in total. If an illegal number is passed in, the default is normal mode.
- After each mode change, the image transmission module will automatically restart. After the module restarts successfully, refresh the web page or mobile app to re-enter
- ai_mode: You can also use all-capitalized English AI_MODE:
- Factory firmware mode: The default is normal mode.
- In face recognition mode, the type-c serial port configuration and network transparent transmission functions will be invalid. The main reason is that there is not enough space to create tasks. If you need to use the failed function, just don't use the face recognition mode. The face detection mode is for normal use.
2.5 Read IP address
| sta_ip | Query the IP address of sta mode | sta_ip | Return the IP address connected to the LAN (such as sta_ip:192.168.2.111) |
|---|---|---|---|
| ap_ip | Query the IP address of ap mode | ap_ip | Return the IP address of the wifi mode (such as ap_ip:192.168.4.1) |


3. Browser to view the screen
3.1 LAN remote viewing
Now that we know the sta_ip (192.168.2.105) obtained by the module connecting to the LAN, we can use this ip to view the real-time screen on the network.

Click start stream to view the screen,

Because the face detection mode (ai_mode:2) has just been set, the face can be recognized normally when it is placed in front of the camera,

3.2 Remote viewing of module hotspot
Connect the computer to the module's hotspot

Open the browser and enter the IP address 192.168.4.1, which is the fixed address of the hotspot.

Click start stream to view the screen,

Because the face detection mode (ai_mode:2) has just been set, the face can be recognized normally when it is placed in front of the camera, (other ai modes can be configured by yourself)
