---
title: "W55RP20-EVB-PICO https example"
url: "https://maker.wiznet.io/josephsr/projects/w55rp20-evb-pico-https-example/"
markdown_url: "https://maker.wiznet.io/josephsr/projects/w55rp20-evb-pico-https-example/md"
type: "WCC: WIZnet Created Content"
author: "Joseph"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "Joseph"
license: "MIT license (MIT)"
published: "2025-03-04"
language: "en"
hardware: ["WIZnet W55RP20-EVB-Pico"]
likes: 0
views: 1735
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# W55RP20-EVB-PICO https example

> Secure HTTPS Client Example Using WIZnet W5x00 Ethernet Module on MicroPython

Original author: Joseph

## Components

- **WIZnet W55RP20-EVB-Pico** x 1 ([docs](https://wiznet.io/products/powered-by-raspberry-pi/w55rp20-evb-pico))
- Software: **WIZnet-ioNIC-micropython**

## Documents and links

- [ioNIC micropython HTTPS client](https://github.com/WIZnet-ioNIC/WIZnet-ioNIC-micropython-examples/blob/main/HTTPS_Client.py) (code)

## Article

---

`Source Code Explanation`
`Imports:`

- socket, ussl: Used for establishing TCP connections and wrapping them in SSL/TLS for secure HTTPS communication.

- network: Handles network interface configuration.

- time: Provides timing functionalities for delays or timeouts.

- w5x00_init: Initializes the WIZnet W5x00 Ethernet module, setting up the network hardware.

`Connection Settings:`

- host: Defines the target HTTPS server domain (e.g., “api.github.com” or similar).

- port: Set to 443, the standard port for HTTPS communication.

- The server’s IP address is resolved using socket.getaddrinfo() based on the provided host and port.

`https_client():`

- Initializes the Ethernet interface by calling w5x00_init(), which configures the WIZnet module and retrieves the board’s IP address.

- Resolves the server’s address via socket.getaddrinfo() to obtain the connection endpoint.

- Creates a TCP socket and connects to the resolved server address.

- Wraps the connected socket with SSL using ussl.wrap_socket(), establishing a secure (encrypted) channel.

- Constructs an HTTP GET request (including the appropriate Host header) targeting the root path (“/“).

- Sends the HTTP request over the SSL-wrapped socket.

- Receives the response (likely the HTTP response headers and body) from the HTTPS server and prints it.

- Closes the socket to clean up the connection.

`Execution Flow:`

- The script runs as the main module.

- Upon execution, the https_client() function is invoked, performing the following steps:
  1. Ethernet initialization via w5x00_init().
  2. Server address resolution and secure TCP connection establishment.
  3. Sending of an HTTP GET request and receiving the server’s response.
  4. Closing of the connection post data exchange.

`▶ How to Run`
`Prepare Hardware:`

- Connect the WIZnet W5x00 Ethernet module to the MicroPython board.

- Ensure the board is connected to a network (via Ethernet).

`Deploy Code:`

- Upload HTTPS_Client.py to the MicroPython board.

- Execute the script via the REPL or configure it to run on boot.

`Execution Result:`

- On Success:
  • The board initializes its Ethernet interface.
  • Establishes a secure connection to the HTTPS server.
  • Sends an HTTP GET request and prints the received HTTP response.

- On Failure:
  • Error messages (e.g., network connection issues or SSL handshake failures) are displayed.

---

Source: https://maker.wiznet.io/josephsr/projects/w55rp20-evb-pico-https-example/
