---
title: "ioNIC Loopback Arduino Example"
url: "https://maker.wiznet.io/Grace_Koo/projects/ionic-loopback-arduino-example/"
markdown_url: "https://maker.wiznet.io/Grace_Koo/projects/ionic-loopback-arduino-example/md"
type: "WCC: WIZnet Created Content"
author: "Grace"
author_url: "https://maker.wiznet.io/Grace_Koo/"
original_author: "Grace_Koo"
published: "2026-03-18"
language: "en"
tags: ["wow-contest-ref"]
hardware: ["WIZnet W55RP20-EVB-Pico", "Raspberry Pi Pico"]
likes: 0
views: 522
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# ioNIC Loopback Arduino Example

> This guide explains how to control the W55RP20-S2E module using a Raspberry Pi Pico and implement network loopback functionality.

Original author: Grace_Koo

## Components

- **WIZnet W55RP20-EVB-Pico** x 1 ([docs](https://wiznet.io/products/powered-by-raspberry-pi/w55rp20-evb-pico))
- **Raspberry Pi Pico** x 1 ([docs](https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html))
- Software: **Arduino IDE** ([docs](https://www.arduino.cc/en/software))

## Documents and links

- [GitHub: WoW-io-Design-Contest](https://github.com/WIZnet-ioNIC/WoW-io-Design-Contest) (code)

## Article

#### How to Run Loopback Example

This project uses the Raspberry Pi Pico as the main controller to operate the W55RP20-S2E module. Connect to the W55RP20-S2E module via SPI or UART communication to implement TCP Client, TCP Server, and UDP Loopback functionality.

Supported Communication Methods:

1. **SPI Communication**

2. **UART Communication**

Supported Loopback Modes:

- **TCP Client Loopback**

- **TCP Server Loopback**

- **UDP Loopback**

### Step 1: Prepare Software

Download and install the following software:

**Required Software:**

- [Arduino IDE](https://www.arduino.cc/en/software/)

- [Tera Term](https://teratermproject.github.io/index-en.html)

- [Hercules](https://www.hw-group.com/software/hercules-setup-utility)

### Step 2: Hardware Connections

#### 2.1 SPI Mode Connection

When controlling the W55RP20-S2E module via SPI, connect as follows:

| **Raspberry Pi Pico** | **W55RP20-S2E Module** | **Description** |
| --- | --- | --- |
| **GP4 (SPI0 RX/MISO)** | **GP3 (SPI_MISO)** | Master In Slave Out |
| **GP3 (SPI0 TX/MOSI)** | **GP4 (SPI_MOSI)** | Master Out Slave In |
| **GP2 (SPI0 SCK)** | **GP2 (SPI_SCK)** | Clock Signal |
| **GP5 (SPI0 CSn)** | **GP5 (SPI_CSn)** | Chip Select |
| **GP13** | **GP13 (SPI_INT)** | SPI Master Recv data pending pin |
| **GP26** | **GP26 (UART_SPI_SEL)** | UART/SPI interface select pin (High:SPI, Low/NC:UART) |
| **3.3V** | **3V3** | Power Supply |
| **GND** | **GND** | Ground |

#### 2.2 UART Mode Connection

When controlling the W55RP20-S2E module via UART:

| **Raspberry Pi Pico** | **W55RP20-S2E Module** | **Description** |
| --- | --- | --- |
| **GP4 (UART1 TX)** | **GP5 (UART1 RX)** | Pico TX → Module RX |
| **GP5 (UART1 RX)** | **GP4 (UART1 TX)** | Pico RX → Module TX |
| **GND** | **GND** | Ground |
| **3.3V** | **VCC/3V3** | Power Supply |

### Step 3: Arduino IDE Setup

#### **Install Board Support Package**

1. Open Arduino IDE

2. Go to **File → Preferences**

3. Add the following to "Additional Boards Manager URLs": https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json

4. Go to **Tools → Board → Boards Manager**

5. Search for **"Raspberry Pi Pico"** and install **Raspberry Pi Pico/RP2040 by Earle F. Philhower, III**

6. Select **Tools → Board → Raspberry Pi RP2040 Boards → Raspberry Pi Pico**

### Step 4: Code Examples

Each example provides a .ino file to upload to the Pico.

1. **SPI Communication**

- [**Loopback**](https://github.com/WIZnet-ioNIC/WoW-io-Design-Contest/tree/main/Arduino/loopback)

2.** UART Communication**

- [**Loopback**](https://github.com/WIZnet-ioNIC/WoW-io-Design-Contest/tree/main/Arduino/loopback)

### Step 5: Upload and Test

#### 5.1 Select Raspberry Pi Pico

1. Go to **Tools → Board → Raspberry Pi RP2040 Boards → Raspberry Pi Pico**

2. Select **Tools → Port** → Choose your COM port

#### 5.2 Upload Code

1. Open the desired example .ino file

2. Modify **IP addresses and port numbers** as needed

- TCP Server

```plaintext
  void setup() {
  ... 
  at_set("LI192.168.11.2"); // Local IP
  at_set("SM255.255.255.0");
  at_set("GW192.168.11.1");
  at_set("DS8.8.8.8");
  at_set("LP5000");         // Local port
  ...
  }
```

- TCP Client

```plaintext
void setup() {

...
  at_set("LI192.168.11.2"); // Local IP
  at_set("SM255.255.255.0");
  at_set("GW192.168.11.1");
  at_set("DS8.8.8.8");
  at_set("RH192.168.11.100"); // Remote host (server)
  at_set("RP5000");         // Remote port

...
}
```

- UDP

```plaintext
void setup() {
... 
  at_set("OP3");            // UDP mode
  at_set("LI192.168.11.2"); // Local IP
  at_set("SM255.255.255.0");
  at_set("GW192.168.11.1");
  at_set("DS8.8.8.8");
  at_set("LP5000");         // Local port
  at_set("RH192.168.11.100"); // Remote host for UDP echo
  at_set("RP5000");         // Remote port
  ...
}
```

3. Click **Upload** button or press **Ctrl+U**

4.Wait for upload to complete

#### 5.3 Open Serial Monitor

1. Go to **Tools → Serial Monitor**

2. Set baud rate to **115200**

3. Verify network information and connection status

### Step 6: Testing with Hercules

#### TCP Client Test

**Hercules Server Setup:**

1. Launch Hercules

2. Select **TCP Server** tab

3. Port: **5000**

4. Click **Listen**

5. Verify messages from Pico appear

6. Type response message and click **SendExpected Results:**

- Hercules receives "W55RP20 S2E TCP Server Demo" message

- Serial Monitor displays Hercules response

#### TCP Server Test

**Hercules Client Setup:**

1. Launch Hercules

2. Select **TCP Client** tab

3. IP: **192.168.11.2** (Pico IP address)

4. Port: **5000**

5. Click **Connect**

6. Type message (e.g., "W55RP20 S2E TCP Server Demo")

7. Click **SendExpected Results:**

- Serial Monitor displays "W55RP20 S2E TCP Server Demo"

- Hercules receives echoed message

#### UDP Test

**Hercules UDP Setup:**

1. Launch Hercules

2. Select **UDP** tab

3. Module IP: **192.168.11.2**

4. Module Port: **5000**

5. Local Port: **5000** (or other available port)

6. Type message (e.g., "W55RP20 S2E TCP Server Demo")

7. Click **SendExpected Results:**

- Serial Monitor displays "W55RP20 S2E TCP Server Demo"

- Hercules receives echoed packet

---

Source: https://maker.wiznet.io/Grace_Koo/projects/ionic-loopback-arduino-example/
