---
title: "ESP32-S3 4G Gateway with WiFi + W5500 Wired Ethernet Dual Output"
url: "https://maker.wiznet.io/Benjamin/projects/4g-nic-example/"
markdown_url: "https://maker.wiznet.io/Benjamin/projects/4g-nic-example/md"
type: "UCC: User Created Content"
author: "lyxer123"
author_url: "https://github.com/lyxer123/4g_nic"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "lyxer123"
original_url: "https://github.com/lyxer123/4g_nic"
published: "2026-04-01"
language: "en"
hardware: ["Espressif ESP32", "WIZnet W5500"]
likes: 0
views: 571
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# ESP32-S3 4G Gateway with WiFi + W5500 Wired Ethernet Dual Output

> 4G cellular uplink shared via WiFi SoftAP and W5500 Ethernet simultaneously using esp-iot-bridge on ESP32-S3

Original author: lyxer123 (source: https://github.com/lyxer123/4g_nic)

## Components

- **Espressif ESP32** x 1 ([docs](https://www.espressif.com/en/products/socs/esp32))
- **WIZnet W5500** x 1 ([docs](https://docs.wiznet.io/Product/Chip/Ethernet/W5500))

WIZnet parts: W5500 ([Datasheet](https://docs.wiznet.io/Product/Chip/Ethernet/W5500/datasheet?utm_source=maker&utm_medium=project&utm_campaign=w5500), [product hub](https://maker.wiznet.io/products/w5500/))

## Article

## 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.

> ![](https://maker.wiznet.io/upload/ckeditor5/216553906%5F1775465877%2Epng)
>
> *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.

---

Source: https://maker.wiznet.io/Benjamin/projects/4g-nic-example/
