---
title: "[Digi-Key Follow me Issue 4] Getting Started Tasks | Basic Task 1: Setting up the Environment and Pi"
url: "https://maker.wiznet.io/ronpang/projects/digi-key-follow-me-issue-4-getting-started-tasks-basic-task-1-setting-up-the-environment-and-pi/"
markdown_url: "https://maker.wiznet.io/ronpang/projects/digi-key-follow-me-issue-4-getting-started-tasks-basic-task-1-setting-up-the-environment-and-pi/md"
type: "UCC: User Created Content"
author: "alanlan86"
author_url: "https://bbs.eeworld.com.cn/thread-1271784-1-1.html"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "alanlan86"
original_url: "https://bbs.eeworld.com.cn/thread-1271784-1-1.html"
published: "2024-06-28"
language: "en"
hardware: ["WIZnet W5500-EVB-Pico"]
likes: 0
views: 496
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# [Digi-Key Follow me Issue 4] Getting Started Tasks | Basic Task 1: Setting up the Environment and Pi

> [Digi-Key Follow me Issue 4] Getting Started Tasks | Basic Task 1: Setting up the Environment and Pinging the Network

Original author: alanlan86 (source: https://bbs.eeworld.com.cn/thread-1271784-1-1.html)

## Components

- **WIZnet W5500-EVB-Pico** x 1 ([docs](https://docs.wiznet.io/Product/Chip/Ethernet/W5500/w5500-evb-pico))

## Article

Target Build the development environment of RP2040 Pico + W5500 EVB Control the onboard LED to blink to confirm that the hardware is normal Initialize W5500, and confirm that the network connection is normal through the Ethernet Ping (Packet Internet Groper) command Capture packets through wireshark and analyze ICMP packets Theory ICMP packet frame structure: ICMP (Internet Control Message Protocol) is a network protocol that is used to transmit control information and error messages in IP networks. It is usually used with the IP protocol. The IP protocol is responsible for sending and routing data packets, while the ICMP protocol is responsible for checking whether the network is reachable, whether the route is correct, whether the host is reachable, and other network status feedback information. The main functions of the ICMP protocol are as follows: Discover network errors: When a data packet has an error during transmission, the ICMP protocol discovers network errors by sending an error notification to the sender. Check whether the network is reachable: By sending ICMP ECHO requests and receiving ICMP ECHO reply messages, you can determine whether the target host is reachable. Detect host errors: When a host fails to work properly, the ICMP protocol detects host errors by sending error notifications to the sender. Send routing information: The ICMP protocol can send routing information to other hosts to help them find appropriate routes in the network. Reference link For more information about the ping command, please refer to: ping command For more information about ICMP commands: Detailed analysis of ICMP commands Hardware When performing the experiment for this task, the expansion baseboard of Follow M3 Phase 1 Pico is used to facilitate the connection of subsequent peripheral devices. At the same time, if you need to use SPI externally, try to avoid SPI multiplexing or mutual interference with the W5500 connection. Other notes: The learning video provided by EEWorld uses the W5500 Pico EVB to connect through a router or switch, and then uses a PC to test the network. Therefore, the Ethernet cable is connected with a straight line. If the W5500 development board is directly connected to the Ethernet port of the PC, a crossover cable is required. ps: Since this experiment was conducted during the holiday, there are no "high-end devices" such as routers/switches in my hometown, so the following experiments are all conducted using a PC and W5500 development link method. software Burning firmware Connect the USB of W5500 Pico EVB to the computer via micro USB cable, then press and hold the bootlsel button, and then click the RUN button. The USB drive letter will appear on the PC.。 Download the UF2 file from the following download link: adafruit-circuitpython-wiznet_w5500_evb_pico-en_GB-8.2.9.uf2. Download the firmware Then drag the UF2 file into the drive letter. After the firmware is successfully burned, you can use MUEditor to program cirupython. Test LED Blink Use the simplest blinky program to test that the development environment and hardware are working properly. Copy # SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries # # SPDX-License-Identifier: MIT """Example for Pico. Turns on the built-in LED.""" import board import digitalio led = digitalio.DigitalInOut(board.LED) led.direction = digitalio.Direction.OUTPUT while True: led.value = True Ping network Refer to the lib file in the RP2040-HAT-CircuitPython example repository and import the W5500 library file into the development board. Refer to the network ping test example in the RP2040-HAT-CircuitPython example repository for testing. Copy import board import busio import digitalio import time from adafruit_wiznet5k.adafruit_wiznet5k import WIZNET5K ##SPI0 SPI0_SCK = board.GP18 SPI0_TX = board.GP19 SPI0_RX = board.GP16 SPI0_CSn = board.GP17 ##reset W5x00_RSTn = board.GP20 print("Wiznet5k Ping Test (no DHCP)") # Setup your network configuration below # random MAC, later should change this value on your vendor ID MY_MAC = (0x00, 0x01, 0x02, 0x03, 0x04, 0x05) IP_ADDRESS = (192, 168, 1, 100) SUBNET_MASK = (255, 255, 255, 0) GATEWAY_ADDRESS = (192, 168, 1, 1) DNS_SERVER = (8, 8, 8, 8) led = digitalio.DigitalInOut(board.GP25) led.direction = digitalio.Direction.OUTPUT ethernetRst = digitalio.DigitalInOut(W5x00_RSTn) ethernetRst.direction = digitalio.Direction.OUTPUT # For Adafruit Ethernet FeatherWing cs = digitalio.DigitalInOut(SPI0_CSn) # For Particle Ethernet FeatherWing # cs = digitalio.DigitalInOut(board.D5) spi_bus = busio.SPI(SPI0_SCK, MOSI=SPI0_TX, MISO=SPI0_RX) # Reset W5500 first ethernetRst.value = False time.sleep(1) ethernetRst.value = True # Initialize ethernet interface with DHCP # eth = WIZNET5K(spi_bus, cs) # Initialize ethernet interface without DHCP eth = WIZNET5K(spi_bus, cs, is_dhcp=False, mac=MY_MAC) # Set network configuration eth.ifconfig = (IP_ADDRESS, SUBNET_MASK, GATEWAY_ADDRESS, DNS_SERVER) print("Chip Version:", eth.chip) print("MAC Address:", [hex(i) for i in eth.mac_address]) print("My IP address is:", eth.pretty_ip(eth.ip_address)) while True: led.value = not led.value time.sleep(1) print("Done!") Baidu cloud Ping the network On the PC side, you need to configure the IPv4 IP address in the 192.168.1.xx network segment. Open a cmd window and execute ping: ping 192.168.1.100 -t Serial port data log IP address printing Packet capture By capturing the packet as follows, you can see the ICMP data packet, and through the Type field, you can see the request packet and the response packet.

---

Source: https://maker.wiznet.io/ronpang/projects/digi-key-follow-me-issue-4-getting-started-tasks-basic-task-1-setting-up-the-environment-and-pi/
