---
title: "WIZnet Ethernet HAT[RP2040] + HTTP WebServer"
url: "https://maker.wiznet.io/WIZnet/projects/wiznet-ethernet-hat%5Brp2040%5D-http-webserver/"
markdown_url: "https://maker.wiznet.io/WIZnet/projects/wiznet-ethernet-hat%5Brp2040%5D-http-webserver/md"
type: "UCC: User Created Content"
author: "louis_m"
author_url: "https://www.hackster.io/louis_m/wiznet-ethernet-hat-rp2040-http-webserver-197620"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "louis_m"
original_url: "https://www.hackster.io/louis_m/wiznet-ethernet-hat-rp2040-http-webserver-197620"
published: "2023-02-16"
language: "en"
hardware: ["WIZnet Ethernet HAT"]
likes: 6
views: 460
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# WIZnet Ethernet HAT[RP2040] + HTTP WebServer

> A source from which a WIZnet Ethernet module becomes an HTTP server and another module becomes a Client.

Original author: louis_m (source: https://www.hackster.io/louis_m/wiznet-ethernet-hat-rp2040-http-webserver-197620)

## Components

- **WIZnet Ethernet HAT** x 1

## Article

## **Overview**

WIZnet Ethernet HAT (Hardware Attached on Top) is a Raspberry Pi Pico pin-compatible board that utilizes W5100S and supports both 3.3V & 5V.

Please refer to this link to find more information about [W5100S.](https://docs.wiznet.io/Product/iEthernet/W5100S/overview)

- Raspberry Pi Pico Pin-Compatible

- Ethernet (W5100S Hardwired TCP/IP CHIP)

![WIZnet Ethernet HAT](https://hackster.imgix.net/uploads/attachments/1363507/image_ot1Du7k3q0.png?auto=compress%2Cformat&w=740&h=555&fit=max)

![RP2040](https://hackster.imgix.net/uploads/attachments/1363508/image_rjXDwkzhto.png?auto=compress%2Cformat&w=740&h=555&fit=max)

> ***Prepare Hardware***

1.Combine WIZnet Ethernet HAT with Raspberry Pi Pico.

2.Connect ethernet cable to Ethernet HAT ethernet port.

3.Connect Raspberry Pi Pico to desktop or laptop using 5 pin micro USB cable.

– If you use W5100S-EVB-Pico, you can skip ‘1. Combine…’

> ***Prepare Software*Installing CircuitPython**

Install `CircuitPython` on Raspberry Pi Pico by referring to the link above.

<https://learn.adafruit.com/getting-started-with-raspberry-pi-pico-circuitpython/circuitpython>

**Setup WIZnet Ethernet Library**

Copy the [**WIZnet library**](https://github.com/Wiznet/RP2040-HAT-CircuitPython/tree/master/lib)<https://github.com/Wiznet/RP2040-HAT-CircuitPython/tree/master/lib>into the lib folder inside the Raspberry Pi Pico. <https://learn.adafruit.com/ethernet-for-circuitpython/circuitpython-setup>

Before continuing, make sure your board’s lib folder has at least the following files and folders copied over: <https://github.com/Wiznet/RP2040-HAT-CircuitPython>

`adafruit_bus_device`

`adafruit_wiznet5k`

`adafrui_wsgi`

`adafruit_requests.py`

![](https://hackster.imgix.net/uploads/attachments/1363515/image_7Qw9LfKYjy.png?auto=compress%2Cformat&w=740&h=555&fit=max)

**RunPICO**

Before this, you should find the Raspberry Pi Pico COM port number from “**Device Manager**” on your PC.

Press “**Ctrl+D**” on the terminal window. you can see the messages as follows.

![](https://hackster.imgix.net/uploads/attachments/1363532/image_mKSU46vpf5.png?auto=compress%2Cformat&w=740&h=555&fit=max)

### **How to WebServer Example**

> ***Setup Webserver Example***

– download <https://github.com/Wiznet/RP2040-HAT-CircuitPython/tree/master/examples/HTTP/Webserver>

– Copy all code from download **W5x00_WebServer.py** file or below code section.

– Paste code into **code.py **on your Raspberry Pi Pico and Save it.

![](https://hackster.imgix.net/uploads/attachments/1363608/image_rF5Fk70vki.png?auto=compress%2Cformat&w=740&h=555&fit=max)

– Press “Ctrl+D” on the terminal window. you can see the messages as follows.

![](https://hackster.imgix.net/uploads/attachments/1363527/image_wgaRWw3BKM.png?auto=compress%2Cformat&w=740&h=555&fit=max)

> ***Start WebServer***

if you open the HTML web page and enter 192.168.1.4, you will see the page. In addition, you will see the IP address of the server connected and WIZnet chip.

![](https://hackster.imgix.net/uploads/attachments/1363528/image_JEhh9GQG0g.png?auto=compress%2Cformat&w=740&h=555&fit=max)

if you press the** ON** button below, the LED built into the Pico turns on.

![](https://hackster.imgix.net/uploads/attachments/1363533/image_ZO70YNT9Nh.png?auto=compress%2Cformat&w=740&h=555&fit=max)

![](https://hackster.imgix.net/uploads/attachments/1363534/image_08tIgXJOtw.png?auto=compress%2Cformat&w=740&h=555&fit=max)

Turn on LED, Likewise, if you press OFF, the LED turns off.

![](https://hackster.imgix.net/uploads/attachments/1363592/image_tsvOl00eZN.png?auto=compress%2Cformat&w=740&h=555&fit=max)

**DOCUMENTS**

Code

W5x00_WebServer.py[![](https://oldmaker.wiznet.io/wp-content/themes/onepress/assets/images/icon-link.png)](https://github.com/Wiznet/RP2040-HAT-CircuitPython/tree/master/examples/HTTP/Webserver)

Schematics

WIZnet Ethernet HAT

---

Source: https://maker.wiznet.io/WIZnet/projects/wiznet-ethernet-hat%5Brp2040%5D-http-webserver/
