An example firmware to use the ESP32 as WiFi repeater.
Requires this lwIP library with NAT support to be used as ESP-IDF lwIP component: https://github.com/martin-ger/esp-lwip
Based on: https://github.com/espressif/esp-idf/blob/release/v3.3/examples/wifi/getting_started/softAP/
Example network setup using ESP32 as WiFi repeater. The diagram was created with Draw.io.
The following are the steps required to run this project on the ESP32 and turn it into a WiFi repeater. The example is for version 4.0 of ESP-IDF. If you want to use ESP-IDF v3.3 use the esp-idf-v3.3 branch.
Download and setup the ESP-IDF.
Download the repository of the NAT lwIP library using the follwing command:
git clone https://github.com/martin-ger/esp-lwip.git
Note: It is important to clone the repository. If it is only downloaded it will be replaced by the orginal lwIP library during the build.
make menuconfig
(or idf.py menuconfig
for cmake).A detailed instruction on how to build, configure and flash a ESP-IDF project can also be found the official ESP-IDF guide.
By Default the DNS-Server which is offerd to clients connecting to the ESP32 AP is set to 8.8.8.8. Replace the value of the MY_DNS_IP_ADDR with your desired DNS-Server IP address (in hex) if you want to use a different one.