4G cellular uplink shared via WiFi SoftAP and W5500 Ethernet simultaneously using esp-iot-bridge on ESP32-S3
COMPONENTSHardware components
Espressif - ESP32
x 1
WIZnet - W5500
x 1
PROJECT DESCRIPTION
4G to WiFi + Wired Ethernet: A Hybrid Network Gateway on ESP32-S3
This project turns an ESP32-S3 into a pocket-sized 4G gateway that shares cellular internet through two simultaneous downlinks: WiFi SoftAP for wireless clients and W5500 SPI Ethernet for wired clients.
data flow diagram (Generated by Gemini)
Based on Espressif's esp-iot-bridge v1.0.2, developer lyxer123 customized the official 4G NIC example to get WiFi and W5500 Ethernet working as dual downlink interfaces. A web configuration page lets users set WiFi credentials through a browser after connecting to the SoftAP hotspot.
Why This Project Matters: The Debugging Log
The most valuable part of this repository is 调试.md — a detailed debugging log documenting every problem encountered while integrating W5500 with ESP32-S3.
W5500 chip ID reads 0x00 instead of 0x04 — SPI communication was failing silently. The ESP32's own MAC address log appeared normal, misleading the developer. Root cause: power supply ripple from a cheap buck converter caused the W5500 to fail reset. Fix: add decoupling capacitors and reduce SPI clock for testing.
esp-iot-bridge Ethernet path bug — The bridge component's DHCP server and PHY reset sequencing had issues on the W5500 LAN output. The developer patched bridge_eth.c and carefully documented which IDF/bridge versions the fix applies to.
Multi-WAN analysis — Source-level analysis confirmed that esp-iot-bridge does not support multi-WAN failover between 4G and WiFi. The developer implemented basic uplink selection logic as a custom module.
These notes are a practical reference for anyone attaching a W5500 to an ESP32 via SPI.
Limitations
The core bridge/NAT logic is Espressif's official component. The developer's custom code covers uplink management, web config, and diagnostics. No CI, no releases, 0 stars. Commit messages are in Chinese. The value lies in the working hybrid network example and the candid debugging documentation.
FAQ
Q: Does this use the W5500's TOE? A: No. W5500 operates as L2 MAC only via ESP-IDF's esp_eth driver. TCP/IP runs on ESP32's lwIP.
Q: Is this a Hybrid Network project? A: Yes. WiFi SoftAP and W5500 Ethernet serve as simultaneous downlinks from a 4G uplink.
Q: What 4G modems work? A: USB LTE modems supporting AT commands and PPP mode, via Espressif's esp_modem component.