Skip to content

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.

rena

Published December 06, 2022 · © Apache License 2.0 (Apache-2.0)

Original author: Rena Kim · South Korea

How to use the W5500 as Azure Sphere Ethernet adapter

Components

Hardware components
Software Apps and online services

Project description

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.

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.

How to use the W5500 as Azure Sphere Ethernet adapter, Pin connection

 

Connecting all the pins will look like this:

How to use the W5500 as Azure Sphere Ethernet adapter, Pin connection
 

Board Config

Board config imagepackage

How to use the W5500 as Azure Sphere Ethernet adapter, Board Config
 

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.

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

azsphere device image list-installed
How to use the W5500 as Azure Sphere Ethernet adapter, Board Config
 

Check network interface

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

azsphere device network list-interfaces
How to use the W5500 as Azure Sphere Ethernet adapter, Board Config
(The following is a capture after running the application.)
How to use the W5500 as Azure Sphere Ethernet adapter, Board Config
 

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.

Networking_IpConfig_EnableDynamicIp(&ipConfig);
Sample Application Test #1: PrivateNetworkServices
Below is the part that sets up the DHCP server for Azure Sphere, but I commented it out because it was not necessary.
Sample Application Test #1: PrivateNetworkServices
 

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 for details.

Sample Application Test #1: PrivateNetworkServices
 

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).

azsphere device network list-interfaces
Sample Application Test #1: PrivateNetworkServices
 

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.

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.

Sample Application Test #1: PrivateNetworkServices
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.

Sample Application Test #1: PrivateNetworkServices
The telemetry transmission period can be set through the telemtryPeriod variable. The default is 5 seconds, I changed it to 30 seconds.
Sample Application Test #1: PrivateNetworkServices
Sample Application Test #1: PrivateNetworkServices
 

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.

Sample Application Test #1: PrivateNetworkServices

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

Sample Application Test #1: PrivateNetworkServices

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

Documents

Comments

Comments