---
title: "W55RP20-S2E HTTP Client Example (MicroPython)"
url: "https://maker.wiznet.io/Grace_Koo/projects/w55rp20-s2e-http-client-example-micropython/"
markdown_url: "https://maker.wiznet.io/Grace_Koo/projects/w55rp20-s2e-http-client-example-micropython/md"
type: "WCC: WIZnet Created Content"
author: "Grace"
author_url: "https://maker.wiznet.io/Grace_Koo/"
original_author: "Grace_Koo"
published: "2026-02-06"
language: "en"
tags: ["MicroPython", "wow-contest-ref"]
hardware: ["WIZnet W55RP20"]
likes: 0
views: 728
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# W55RP20-S2E HTTP Client Example (MicroPython)

> This example demonstrates HTTP client on W55RP20 S2E via UART/SPI using MicroPython on a Raspberry Pi Pico (Master)

Original author: Grace_Koo

## Components

- **WIZnet W55RP20** x 1 ([docs](https://wiznet.io/products/ionic-chips/w55rp20))
- Software: **MicroPython** ([docs](http://micropython.org/))

## Documents and links

- [GitHub : W55RP20-S2E_master_Micropython](https://github.com/WIZnet-ioNIC/WoW-io-Design-Contest/tree/main/MicroPython) (code)

## Article

## How to HTTP Client Example (MicroPython)

This program demonstrates how to implement a simple HTTP Client using the W55RP20 S2E board via UART or SPI interface. The Raspberry Pi Pico (Host) configures the W55RP20 S2E as a TCP Client (OP4) using AT commands. Once connected to a web server (e.g., httpbin.org), it enters Data Mode to send an HTTP GET request and print the received HTML/JSON response to the console.

## Step 1: Prepare software

The following software is required to run and test the MicroPython example.

- [**Thonny**](https://thonny.org/) : An integrated development environment for MicroPython. used to write, upload, and run code.

- Public Test Server: We will use `httpbin.org` (a simple HTTP Request & Response Service) for testing, so no local server software is strictly required.

## Step 2: Prepare hardware

1. Connect GPIO13 according to the selected UART/SPI mode of the W55RP20 EVB Pico, as illustrated below.

| GPIO13 Pin | Desc |
| --- | --- |
| LOW(GND) | UART mode (default) |
| HIGH(3.3V) | SPI mode |

2. Connect the Raspberry Pi Pico and the W55RP20 EVB Pico using jumper wires as shown below, depending on the selected UART/SPI mode.

- Important Note on Mode Switching: In this example setup, GPIO 13 of the W55RP20 EVB Pico is physically connected to GPIO 13 of the Raspberry Pi Pico. The Host Pico sets the mode (High/Low) automatically based on the software configuration.

- If you change the **`**MODE**`** in the code (e.g., UART ↔ SPI): You MUST reset both boards (Raspberry Pi Pico and W55RP20 EVB Pico) to ensure the mode is switched and recognized correctly.

**If UART mode :**

| Raspberry Pi Pico | W55RP20 EVB Pico |
| --- | --- |
| GPIO4 (UART_TX) | GPIO5 (UART_RX) |
| GPIO5 (UART_RX) | GPIO4 (UART_TX) |
| GPIO13 (MODE_SEL) | GPIO13 (MODE_SEL) |
| GND | GND |

**If SPI mode :**

| Raspberry Pi Pico(Master) | W55RP20 EVB Pico(Slave) |
| --- | --- |
| GPIO2 (SPI_CLK) | GPIO2 (SPI_CLK) |
| GPIO3 (SPI_TX) | GPIO4 (SPI_RX) |
| GPIO4 (SPI_RX) | GPIO3 (SPI_TX) |
| GPIO5 (SPI_CS) | GPIO5 (SPI_CS) |
| GPIO26 (SPI_INT) | GPIO26 (SPI_INT) |
| GPIO13 (MODE_SEL) | GPIO13 (MODE_SEL) |
| GND | GND |

3. Connect the Raspberry Pi Pico to your PC (desktop or laptop) using a 5-pin Micro USB cable.

4. Connect the W55RP20 EVB Pico to your PC (desktop or laptop) using a USB Type-C cable.

## Step 3: Setup Example

- Raspberry Pi Pico (Master) : [Getting started with Raspberry Pi Pico (MicroPython)](https://www.raspberrypi.com/documentation/microcontrollers/micropython.html)

Please refer to the link below to install the MicroPython firmware on the Raspberry Pi Pico.

- **W55RP20 EVB Pico : **[Getting started with W55RP20 EVB Pico](https://docs.wiznet.io/Product/Chip/MCU/Pre-programmed-MCU/W55RP20-S2E/w55rp20-evb-pico-s2e)

Please refer to the link below for instructions on how to use the W55RP20 S2E.

## Step 4: Upload Code

- **Raspberry Pi Pico**

Open Thonny IDE and connect to the Raspberry Pi Pico. Upload the following driver and example files to the Pico's storage.

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

*PICO's storage*

Required Files:

1. `w55rp20_s2e_uart.py` (Required for UART mode)

2. `w55rp20_s2e_spi.py` (Required for SPI mode)

Example Application Files (Choose one to test):

- `05_http_client.py`

Configuration: Before running an example, open the Python file you intend to use and modify the User Configuration section at the top.

```c
# 05_http_client.py
#
# HTTP client example (Supports both SPI and UART modes):
# - Configure the module as TCP client + DHCP
# - Connect to httpbin.org and send HTTP GET requests
# Select mode by changing the MODE variable below.

import time

# -------------------------------------------------------------------------
# Configuration
# -------------------------------------------------------------------------
MODE = "uart"   # Set to "spi" or "uart"

# IP Configuration Mode
USE_DHCP = True  # True: DHCP (IM=1), False: Static IP (IM=0)

# Network Configuration
LOCAL_IP    = "192.168.11.100"  # Local IP (Used when USE_DHCP=False)
SUBNET_MASK = "255.255.255.0"   # Subnet Mask (Used when USE_DHCP=False)
GATEWAY     = "192.168.11.1"    # Gateway (Used when USE_DHCP=False)
DNS_SERVER  = "8.8.8.8"         # DNS Server (Used when USE_DHCP=False)
REMOTE_IP   = "httpbin.org"  # HTTP server (domain or IP)
REMOTE_PORT = "80"           # HTTP port
.
.
```

- **W55RP20 EVB Pico**

Following Step 3 in the Getting Started Guide, program the W55RP20 EVB Pico with the UF2 file and write the MAC address to complete the setup.

## Step 5: Run

Check IP

Open a command prompt on your PC and type `ping httpbin.org`. Copy the IP address and paste it into the `REMOTE_IP` variable in `07_http_client.py`.

---

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

Pico (Thonny):

- Open `07_http_client.py`.

- Run the script (Press F5).

---

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

Monitor:

- Watch the Thonny shell.

- You should see the initialization logs.

- After the reboot, the script will send the data.

---

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

Success: You will see the HTTP headers and a JSON body printed in the console, similar to:

Plaintext

```
--- HTTP Response Start ---
HTTP/1.1 200 OK
Date: Mon, 01 Jan 2024 12:00:00 GMT
Content-Type: application/json
Content-Length: 300
Connection: close
Server: gunicorn/19.9.0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true

{
  "args": {}, 
  "headers": {
    "Host": "httpbin.org", 
    "User-Agent": "W55RP20-S2E", 
    ...
  }, 
  "origin": "xxx.xxx.xxx.xxx", 
  "url": "http://httpbin.org/get"
}
--- HTTP Response End ---
```

---

Source: https://maker.wiznet.io/Grace_Koo/projects/w55rp20-s2e-http-client-example-micropython/
