Welcome to ESP32 WiFi Camera Lite repository
9.RDK X5 driving servo gimbal
X5 remote control servo gimbal
Note: esp32 camera needs to be burned with factory firmware. If you have not flashed the firmware after receiving the esp32 camera, it does not need to be burned. The factory default firmware is
1. Experimental preparation
ESP32 camera
X5 development board
2-DOF gimbal
24-channel servo driver board
2. Wiring diagram
Note: Due to insufficient voltage, esp32 camera and 24-channel servo driver board need additional power supply via type-c data cable
| x5 motherboard | esp32 camera |
|---|---|
| GPIO22 | RX |
| GPIO25 | TX |
| GND | GND |
| n'c | 5V |
| X5 motherboard | 24-channel servo driver board |
|---|---|
| BOARD8 | RX |
| BOARD10 | TX |
| GND | GND |
| 5V | 5V |
| 24-way servo driver board | Servo |
|---|---|
| s5 | Vertical servo |
| s6 | Horizontal servo |
Physical connection diagram:

x5 pin diagram:

3. Experimental steps and experimental results
Quick method: You can directly connect to the wifi opened by esp32. The name of this experiment is ESP32_WIFI_TEST. Then the IP address camera information of the mobile app is 192.169.4.1. You can use the app to control the servo
Upload the provided program source code "sunrise_servo.py" file to your own x5 motherboard.
The official image of the x5 motherboard only opens serial port 1 by default. Now you need to open serial port 2 as well. Enter in the terminal,
xxxxxxxxxxsudo srpi-config

Select Interface Options,

Select I3 Peripheral bus config, look down and see if the serial2 suffix is okay. If not, press Enter to enable it. Then restart the x5 and it will be ready for use.

Open the code just uploaded, and change it to the name and password of the wifi you want to connect to. You can also change the name of the hotspot and the corresponding wifi mode.

Run the program in the terminal, and it will return the IP address of the current network connection and the address of the hotspot.
xxxxxxxxxxpython3 sunrise_servo.py

Use the app to control the movement of the car. After installing the "ESP32Cam" app, open it.
On the login page, set it according to the IP obtained by the serial port assistant. If the IP obtained by the serial port assistant is "192.168.2.110", then the configuration is as follows

Then click login directly
(Optional) If you want to connect to the hotspot of the wifi camera, the IP address must be set to 192.168.4.1, as shown in the figure

When the IP address is configured correctly and connected successfully, you can control the servo gimbal through the app console page
Horizontal screen

Note: Every time you restart the app, you need to click the exit button in the upper right corner, then exit and reconfigure the IP address information before logging in