---
title: "ESP8266 / W5500 Ethernet Gateway"
url: "https://maker.wiznet.io/eric_g/projects/esp8266-w5500-ethernet-gateway-1/"
markdown_url: "https://maker.wiznet.io/eric_g/projects/esp8266-w5500-ethernet-gateway-1/md"
type: "UCC: User Created Content"
author: "John"
author_url: "https://hackaday.io/project/79753-esp8266-w5500-ethernet-gateway"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "John"
original_url: "https://hackaday.io/project/79753-esp8266-w5500-ethernet-gateway"
license: "GNU General Public License, version 3 or later (GPL3+)"
published: "2022-12-02"
language: "en"
tags: ["W5500"]
hardware: ["WIZnet W5500"]
likes: 4
views: 826
comments: 1
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# ESP8266 / W5500 Ethernet Gateway

> Cheap W5500 Ethernet modules have started to appear on all of the usual supplier channels on the 'net. Priced at about $4.50.

Original author: John (source: https://hackaday.io/project/79753-esp8266-w5500-ethernet-gateway)

## Components

- **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

Detailed project link: <https://esp8266hints.wordpress.com/2018/02/13/adding-an-ethernet-port-to-your-esp-revisited/>

This article was posted on the **exp8266hints site by ID PuceBaboon** on Feb. 13. 2018

This particular project uses the W5500 board in conjunction with the**ESP8266 to create an MQTT gateway for ESP-Now sensor nodes**. The same basic hardware and software configuration could be used to provide a wired gateway for a completely different service (and the Ethernet library has example code for a telnet client, a web server, a Twitter gateway, a chat server, a Xively client and more).

The **W5500** handles **more sockets than the older versions** of the chip and is generally recommended for newer designs (it’s a little cheaper, too).

![](https://maker.wiznet.io/upload/ckeditor5/94080735%5F1670008345%2Epng)

**One issue (which is actually an ESP problem, not a W5500 one)** is that the **chip-select** for the external SPI is actually routed via GPIO15 and, as we pretty much all know from experience by now, that’s one of **the “magic” pins at boot-up/reset which changes the way that the ESP8266 behaves**. In fact, there’s a pull-up resistor on the W5500 (and, as far as I know, all of the other Wiznet modules) CS line which will cause the ESP to drop into programming mode if the W5500 CS line is simply connected directly to GPIO15. The solution to that is quite easy — **put a PNP transistor buffer** (configured as an emitter follower) between the two.

![](https://maker.wiznet.io/upload/ckeditor5/94080735%5F1670008379%2Epng)

Because of **the pull-up on the W5500 board**, you don’t need an emitter resistor, but you do need to add a base resistor of somewhere in the region of **3k3 between GPIO15 and the transistor’s base** (and the collector of the transistor goes directly to ground). Any small-signal PNP transistor, such as the BC560 or 2N3906 should work in this situation; it’s not that critical. You might have to add the emitter resistor if the target board doesn’t already have a pull-up.

**The second hardware** requirement is that we need to dedicate another,** non-SPI GPIO as a reset** driver for the W5500. On the test board, **GPIO5 is used** which allows us to hold the W5500 in reset until the ESP has completed its own housekeeping and is ready to bring up the network connection.

So, with that addition, the pin connects between an ESP8266 and the W5500 are:-![Pin interconnects between ESP8266 and W5500](https://esp8266hints.files.wordpress.com/2018/02/w5500-esp-interconnects-e1518527359307.jpg?w=700)

[the Wiznet Ethernet Library for the Arduino 1.5.x IDE](https://github.com/Wiznet/WIZ_Ethernet_Library) is used for Software-side.

There are good instructions in the README.md file on how to install and use it, but –**don’t**– uncomment the “**#define WIZ550io_WITH_MACADDRESS” **line referred to in those instructions. The normal, cheap W5500 boards do **-not- have a built-in MAC address** and you must set one manually in the software before you can use them.

MQTT broker to both publish and subscribe.

Github: <https://github.com/PuceBaboon/ESP-Now-Gateway>

---

Source: https://maker.wiznet.io/eric_g/projects/esp8266-w5500-ethernet-gateway-1/
