---
title: "How to use the W5500 as Azure Sphere Ethernet adapter"
url: "https://maker.wiznet.io/rena/projects/using-the-w5500-as-azure-sphere-ethernet-adapter/"
markdown_url: "https://maker.wiznet.io/rena/projects/using-the-w5500-as-azure-sphere-ethernet-adapter/md"
type: "WCC: WIZnet Created Content"
author: "Rena Kim"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "Rena Kim"
license: "Apache License 2.0 (Apache-2.0)"
published: "2022-12-06"
language: "en"
tags: ["W5500"]
hardware: ["Avnet Azure Sphere MT3620 Starter Kit", "WIZnet WIZ850io"]
likes: 7
views: 2659
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# How to use the W5500 as Azure Sphere Ethernet adapter

> As the W5500 has been selected as the Azure sphere official Ethernet adapter, I'll introduce how to simply set up and use it.

Original author: Rena Kim

## Components

- **Avnet Azure Sphere MT3620 Starter Kit** x 1 ([docs](https://www.avnet.com/shop/us/products/avid-technologies/aes-ms-mt3620-sk-g-3074457345636825680/?aka_re=1/?utm_source=hackster))
- **WIZnet WIZ850io** x 1 ([docs](https://docs.wiznet.io/Product/ioModule/WIZ850io))
- Software: **Microsoft Azure IoT Hub** ([docs](https://learn.microsoft.com/en-gb/azure/iot-hub/))

## Documents and links

- [AzureIoT Sample Code](https://github.com/renakim/azure-sphere-samples/tree/use-eth0-w5500/Samples/AzureIoT) (code)

## Article

### **Introduction**

Recently, WIZnet W5500 was adopted as Azure Sphere’s 10/100 Ethernet network interface adapter and was updated in the 22.09 release version.

You can check the update for the 22.09 release at the link below.

- [Azure Sphere: What’s new in the 22.09 release](https://learn.microsoft.com/en-us/azure-sphere/product-overview/whats-new#whats-new-in-the-2209-release)

- [General Availability: Azure Sphere version 22.09 new and updated features](https://techcommunity.microsoft.com/t5/internet-of-things-blog/general-availability-azure-sphere-version-22-09-new-and-updated/ba-p/3638460)

Avnet Azure Sphere Starter Kit can be used to connect and test with W5500.

### **Hardware configuration**

- Avnet Azure Sphere Starter Kit V1

- Can use the V2

- WIZ850io (W5500 ethernet module)

- Micro 5 pin USB cable

- LAN cable

- Jumper cables

### **Pin connection**

Connect Avnet Azure Sphere Starter Kit V1 board and WIZ850io module using jumper cables.

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

Connecting all the pins will look like this:

![](https://hackster.imgix.net/uploads/attachments/1531597/azsphere_starterkit-w5500.jpg?auto=compress%2Cformat&w=740&h=555&fit=max)

### **Board ConfigBoard config imagepackage**

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

If you go to the path where Azure Sphere SDK is installed, there is a Board Config Presets folder, and preset files are included in it.

Among them, `lan-w5500-isu1-int2.imagepackage` file is used.

When using Starter Kit V2, the lan-w5500-isu0-int5.imagepackge file can be used.

Reference: Azure Sphere: Supported Ethernet adapters

Upload the imagepackage file to the device using the command below.

When the image is uploaded, the device will be reset automatically, and you can check the installed image as follows.

```plaintext
azsphere device sideload deploy --image-package lan-w5500-isu1-int2.imagepackage

azsphere device image list-installed
```

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

**Check network interface**

If you connected the pins well, you can see that the new network interface has been added. (eth0)

```plaintext
azsphere device network list-interfaces
```

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

(The following is a capture after running the application.)

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

### **Network settings**

To check and verify the network operation, I used two sample applications.

### **Sample Application Test #1: PrivateNetworkServices**

<https://github.com/Azure/azure-sphere-samples/tree/main/Samples/PrivateNetworkServices>

**DHCP setting**

Instead of static IP configuration of default code, I used a DHCP configuration function.

```plaintext
Networking_IpConfig_EnableDynamicIp(&ipConfig);
```

- API Reference: <https://learn.microsoft.com/en-us/azure-sphere/reference/applibs-reference/applibs-networking/function-networking-ipconfig-enabledynamicip>

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

Below is the part that sets up the DHCP server for Azure Sphere, but I commented it out because it was not necessary.

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

**Run**

Below is the Device debug output. This part gets a list of available network interfaces and reads the status for each one.

Interface #1 is eth0 (Ethernet), and the status is 0x0f, meaning that it is connected to the network and the Internet.

The Hex value representing the status is a bit mask, refer to [Azure Sphere Application Libraries guide](https://learn.microsoft.com/en-us/azure-sphere/reference/applibs-reference/applibs-networking/enum-networking-interfaceconnectionstatus)for details.

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

Once check the network status with the command again, can see that device is connected to the Internet with an IP assigned through the DHCP server (router).

```plaintext
azsphere device network list-interfaces
```

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

**Sample Application Test #2: Azure IoT**

After verifying that device was connected to the internet, I tried connecting to IoT Central using the Azure IoT sample.

The process of setting up the application is well documented in the official documentation, so it is omitted here. I’ll try to sort it out later.

- [azure-sphere-samples: AzureIoT: StartWithIoTCentral](https://github.com/renakim/azure-sphere-samples/blob/master/Samples/AzureIoT/READMEStartWithIoTCentral.md)

- [MS Guide: Set up Azure IoT Central to work with Azure Sphere](https://learn.microsoft.com/en-us/azure-sphere/app-development/setup-iot-central?tabs=cliv2beta)

To summarize the process:

- Create an Azure IoT Central application

- Create device registration group
  - Download Tenant CA Certificate (with Azure Sphere CLI)
  - CA Certificate Upload (Auto Verify)

- Obtain the Azure IoT Central endpoint value using the Tools script in the AzureIoT samples directory

- Execute after updating app_manifest.json

The updated app_manifest.json contents are as follows.

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

Additionally, to transmit telemetry values, the variable that determines whether or not to transmit telemetry must be changed to true in `main.c`.

In the previous version, it was set to transmit by default, but it seems to have changed recently.

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

The telemetry transmission period can be set through the telemtryPeriod variable. The default is 5 seconds, I changed it to 30 seconds.

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

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

Now, once you run debug after building (click the Run button or press the shortcut key ‘F5’), device authentication and connection will proceed, and Telemetry will be transmitted.

Below is a part of the device debug output message when connected successfully.

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

As shown in the snapshot below, you can see that real-time data is received in the IoT Central device Raw Data tab.

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

Since the network connection and sample operation through the W5500 have been verified, it seems that it can be used in various applications. 🙂

---

Source: https://maker.wiznet.io/rena/projects/using-the-w5500-as-azure-sphere-ethernet-adapter/
