Wiznet makers

ronpang

Published June 24, 2026 ©

199 UCC

109 WCC

35 VAR

0 Contests

1 Followers

0 Following

W55RP20-EVB-MKR MicroPython Tutorial (6):UDP Multicast & Broadcast for LAN Batch Communication

This article is Part 6 of the WIZnet W55RP20 MicroPython tutorial series, written based on the latest official firmware.

COMPONENTS
PROJECT DESCRIPTION

W55RP20-EVB-MKR MicroPython Tutorial (6):UDP Multicast & Broadcast for LAN Batch Communication

This article is Part 6 of the WIZnet W55RP20 MicroPython tutorial series, written based on the latest official firmware. All code has been verified and can be flashed and run directly. Copyright Notice: This article is an original technical article by WIZnet. Please credit the source when reposting.


Preface

In the previous tutorial, we completed the UDP unicast data communication functionality using the W55RP20 chip.

This article focuses on a core technology for multi-device batch communication within a local network — UDP Multicast and Broadcast.

In the era of smart hardware and IoT, MicroPython and Raspberry Pi MKR are leading the new wave of embedded development with their unique advantages. MicroPython, as a streamlined and optimized Python 3 language, provides an efficient development and easy debugging experience for microcontrollers and embedded devices.

When combined with the WIZnet W5500 network module, the development potential of MicroPython and Raspberry Pi MKR is further amplified. The module features a built-in hardware TCP/IP stack, making it easier to implement UDP multicast, broadcast, and other multi-device communication on embedded devices. Whether for multi-device synchronous control, batch data push, or simple IoT control systems, UDP multicast/broadcast provides efficient and convenient support.

The W55RP20 integrates a hardware TCP/IP stack, and with the MicroPython development environment, you can implement stable UDP multicast/broadcast communication with just a few lines of code — no need to worry about low-level socket details — enabling effortless LAN batch data transmission.

After completing this article, you will master:

Core principles of the UDP protocol, and the differences and application scenarios of multicast vs. broadcast

Network initialization and UDP multicast/broadcast configuration methods for the W55RP20-EVB-MKR module

Ultra-compact code to implement UDP broadcast and multicast data transmission

UDP parameter configuration tips for multi-device communication scenarios

Verification methods for UDP multicast/broadcast communication results and common troubleshooting

Advantages of the WIZnet hardware protocol stack in UDP multi-device communication


Tutorial Series Learning Path

This series consists of 16 articles, progressively covering everything from basic networking to industrial-grade applications:

Part 1: Static IP Configuration and Network Basics

Part 2: DHCP Auto-Connection and Network Diagnostics

Part 3: TCP Client Communication

Part 4: TCP Server Communication

Part 5: UDP Unicast Data Communication

Part 6: UDP Multicast/Broadcast Data Communication (this article)

Part 7: DNS Domain Name Resolution

Part 8: NTP — Getting Time from the Network

Part 9: HTTP Client Requests

Part 10: HTTP Server Setup

Part 11: HTTP Protocol and OneNET Cloud Data Upload

Part 12: MQTT Protocol Basic Communication Verification

Part 13: MQTT Protocol with Alibaba Cloud Integration

Part 14: MQTT Protocol with OneNET Platform Integration

Part 15: MQTT Protocol with ThingSpeak Platform Integration

Part 16: Modbus Industrial Protocol Communication

It is recommended to bookmark this series and follow the tutorials step by step. All code will be synchronously updated to the official Gitee repository.


Table of Contents

1 UDP Multicast/Broadcast Principles

1.1 Introduction to UDP Protocol

1.2 Differences and Workflows of UDP Broadcast vs. Multicast

1.3 Core Advantages of UDP

1.4 Typical Application Scenarios

2 Prerequisites

2.1 Software Preparation

2.2 Hardware Preparation

3 Flashing the W55RP20-EVB-MKR Dedicated MicroPython Firmware

4 Hardware Connection and Development Environment Setup

4.1 Hardware Connection

4.2 Thonny Development Environment Configuration

5 Core Code Walkthrough

5.1 Basic Notes

5.2 UDP Broadcast Code Walkthrough

5.3 UDP Multicast Code Walkthrough

6 Execution Results and Test Verification

6.1 Serial Output Results

6.2 UDP Communication Verification Methods

7 One-Stop Troubleshooting Guide

7.1 Flashing Issues

7.2 Port Recognition Issues

7.3 Network Connection and UDP Communication Issues

8 WIZnet Hardware Protocol Stack Core Advantages Comparison

9 Typical Application Scenarios

10 Summary

11 Upcoming Tutorials and Resources

11.1 Series Preview

11.2 Resource Access


1. UDP Multicast/Broadcast Principles

1.1 Introduction to UDP Protocol

UDP (User Datagram Protocol) is a connectionless, unreliable transport layer protocol, sitting alongside TCP. Its core characteristic is "fast transmission, no connection required." It does not provide retransmission mechanisms or flow control, and does not confirm whether the receiver has received the data after sending. It is suitable for scenarios requiring high real-time performance where minor data loss is tolerable.

In embedded IoT development, UDP is widely used in multi-device communication scenarios, where multicast and broadcast are two common methods for pushing data to multiple devices. There is no need to establish a connection for each device individually, greatly simplifying multi-device networking complexity. Combined with the W5500 hardware protocol stack, efficient and stable UDP communication can be achieved.

Simply put, the core advantage of the UDP protocol is "lightweight, fast, low latency," while multicast and broadcast are two multi-device data transmission methods based on UDP, suitable for different networking requirements.

1.2 Differences and Workflows of UDP Broadcast vs. Multicast

The core logic for implementing UDP broadcast and multicast on the W55RP20-EVB-MKR module is consistent (both based on UDP sockets), but the transmission range and target devices differ.

UDP Broadcast Workflow

The development board connects to the router via Ethernet and completes network initialization (automatically obtaining IP address, gateway, and other parameters via DHCP)

Create a UDP socket and enable broadcast mode (set the SO_BROADCAST option)

Configure the broadcast address (typically 255.255.255.255, representing all devices within the same subnet) and communication port

The development board sends broadcast data, which is received by all devices within the same subnet

Receiving devices listen for UDP data on the corresponding port and can retrieve the broadcast content, achieving multi-device synchronous data reception

UDP Multicast Workflow

The development board completes network initialization and obtains its own IP address

Create a UDP socket — there is no need to enable broadcast mode

Configure the multicast address (range: 224.0.0.0 ~ 239.255.255.255; all receiving devices must join the same multicast group) and communication port

The development board sends data to the multicast address; only devices that have joined that multicast group can receive the data

Receiving devices listen for UDP data by binding the multicast address and port, enabling targeted multi-device communication

Key Differences

Comparison DimensionUDP BroadcastUDP Multicast
Transmission ScopeAll devices within the same subnet, non-directionalOnly devices that have joined the specified multicast group, directional transmission
Resource UsageHigher (all devices receive data)Lower (only target group devices receive)
Use CaseAll devices within the same subnet receiving data synchronously (e.g., notifications, command push)Multi-device group communication (e.g., data aggregation from multiple sensor groups)
Configuration DifficultySimple (only need to configure broadcast address and port)Slightly more complex (all devices must join the same multicast group)

1.3 Core Advantages of UDP (for Multicast/Broadcast Scenarios)

Low Latency: No connection establishment or acknowledgement required, fast data transmission speed, suitable for high real-time scenarios (e.g., device status synchronization)

Lightweight & Concise: Low protocol overhead, minimal MCU resource consumption, well-suited to the resource characteristics of the W55RP20-EVB-MKR module

Multi-Device Friendly: Multicast/broadcast mode eliminates the need to establish connections for each device individually, greatly simplifying multi-device networking development

Strong Ease of Use: The W55RP20-EVB-MKR module's MicroPython firmware has encapsulated the underlying UDP logic — no need to write complex protocol code; just a few lines of code to implement multicast/broadcast

1.4 Typical Application Scenarios

ScenarioDescription
IoT Multi-Device SynchronizationMultiple sensors and actuators within the same subnet synchronously receiving control commands (e.g., broadcast start/stop commands)
Data Batch PushServer pushing configuration parameters and time sync info to multiple devices (e.g., multicast push for NTP time)
Device DiscoveryNewly connected devices broadcasting their own information for automatic device discovery and networking within the network
Real-Time MonitoringMultiple monitoring devices sending monitoring data to the same monitoring center via multicast (e.g., temperature/humidity, device status)
Industrial ControlIn industrial scenarios, controllers broadcasting control commands to multiple execution devices for synchronous linkage

2. Prerequisites

Insert image description here

2.1 Software Preparation

SoftwareVersionDownload LinkDescription
Thonny4.0 and aboveThonny Official DownloadLightweight MicroPython IDE, supports code editing, flashing and serial debugging; beginner-friendly
W55RP20-EVB-MKR MicroPython FirmwareLatest stableWIZnet Official Firmware DownloadTailored for the W55RP20-EVB-MKR module, with integrated WIZnet hardware drivers and protocol stack

2.2 Hardware Preparation

The following hardware is required:

W55RP20-EVB-MKR development board × 1

Micro USB data cable (must support data transfer, not a charge-only cable) × 1

Standard Ethernet cable × 1

Router/switch with DHCP enabled × 1

Tip: The W55RP20-EVB-MKR module already integrates Ethernet-related components — no additional soldering or jumper wires needed. Paired with the RP2040 development board, the development environment can be set up quickly, greatly reducing wiring errors and hardware failure rates.


3. Flashing the W55RP20-EVB-MKR Dedicated MicroPython Firmware

The W55RP20-EVB-MKR module is fully compatible with the Raspberry Pi MKR UF2 flashing method. Follow these steps:

Hold down the BOOTSEL button on the RP2040 development board

Connect the development board to your computer using a Micro USB data cable

Once the computer recognizes a USB drive named RPI-RP2, release the BOOTSEL button

Drag the downloaded .uf2 firmware file into the RPI-RP2 USB drive

The development board will automatically reboot — firmware flashing is complete

Note: If the computer does not recognize the RPI-RP2 USB drive, try re-plugging the USB cable, using a different data-capable USB cable, or switching to a different USB port (preferably USB 2.0).


4. Hardware Connection and Development Environment Setup

4.1 Hardware Connection

Connecting the W55RP20-EVB-MKR is extremely simple — only two steps:

Use a Micro USB data cable to connect the RP2040 development board to your computer (for power, code flashing, and serial debugging)

Use an Ethernet cable to connect the Ethernet interface of the W55RP20-EVB-MKR module to a LAN port on the router

Insert image description here

4.2 Thonny Development Environment Configuration

Open Thonny, click the top menu bar "Run" → "Configure Interpreter"

Switch to the "Interpreter" tab

In the "Interpreter" dropdown list, select MicroPython (generic)

In the "Port" dropdown list, select the serial port corresponding to the W55RP20-EVB-MKR (usually displayed as Board CDC @ COMx)

Check "Restart interpreter before running code" and "Sync device's real-time clock"

Click "OK" to complete the configuration

If the development board does not appear in the port list, try:

Re-plugging the USB data cable

Using a different data-capable USB cable

Closing other software that uses the serial port (e.g., serial monitor, Arduino IDE, etc.)

Re-flashing the MicroPython firmware

Installing the Raspberry Pi MKR USB driver


5. Core Code Walkthrough

The W55RP20-EVB-MKR module's MicroPython library has already encapsulated all UDP low-level details. Combined with the wiznet_init module, implementing UDP broadcast and multicast functionality requires only a minimal amount of core code — no need to write complex low-level drivers or protocol parsing logic. The code can be flashed and run directly.

5.1 Basic Notes

The code in this article is based on the wiznet_init module for network initialization. This module encapsulates the network configuration logic for the W55RP20-EVB-MKR module — no need to manually configure SPI pins and network parameters. Simply call the wiznet function to complete initialization. All code uses pure ASCII text to avoid character encoding issues, ensuring compatibility with embedded device communication requirements.

5.2 UDP Broadcast Code Walkthrough

The following code can be directly copied into Thonny. Once flashed, it implements UDP broadcast functionality, sending data to all devices within the same subnet:

from wiznet_init import wiznet
import usocket as socket
import time

# Initialize network
nic = wiznet("W55RP20-EVB-Pico", dhcp=True)
local_ip = nic.ifconfig()[0]

# Broadcast configuration
BROADCAST_IP = "255.255.255.255"
PORT = 8087

# Create UDP socket and enable broadcast
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)

print("UDP Broadcast sending in progress...")
count = 0

while True:
   # Pure ASCII text, avoid encoding issues
   msg = f"Board Broadcast {count}".encode("ascii")
   
   # Send broadcast
   s.sendto(msg, (BROADCAST_IP, PORT))
   
   print("Sent broadcast:", msg)
   count += 1
   time.sleep(1)

[video(video-uLtNReDO-1781147089253)(type-csdn)(url-https://live.csdn.net/v/embed/524130)(image-https://v-blog.csdnimg.cn/asset/3925a25feaff53b49084aa7084d46fcd/cover/Cover0.jpg)(title-)]

Key Steps Explained for Broadcast Code

Module Import: Import the wiznet function from the wiznet_init module (for network initialization), the usocket module (for creating UDP sockets), and the time module (for controlling send frequency)

Network Initialization: Call the wiznet function, specifying the device name and enabling DHCP to automatically obtain an IP address — no need to manually configure a static IP, making it suitable for multi-device networking (all devices are automatically in the same subnet). Also obtain the local IP address for subsequent debugging

Broadcast Parameter Configuration: Set the broadcast address to 255.255.255.255 (all devices within the same subnet can receive), and set the port to 8087 (customizable; must match the receiving port and avoid port conflicts)

UDP Socket Creation and Configuration: Create a UDP-type socket (SOCK_DGRAM indicates UDP protocol), and enable broadcast mode via the setsockopt function (set the SO_BROADCAST option to 1) — this is the key step for implementing broadcast functionality

Loop Sending Broadcast: Continuously send broadcast data through a while True loop; data uses pure ASCII encoding to avoid garbled characters. The sent content is printed after each transmission; the count variable tracks the number of transmissions; time.sleep(1) controls the frequency at 1-second intervals, which can be adjusted as needed

5.3 UDP Multicast Code Walkthrough

The following code can be directly copied into Thonny. Once flashed, it implements UDP multicast functionality, sending data to devices within the specified multicast group:

from wiznet_init import wiznet
import usocket as socket
import time

# Initialize network
nic = wiznet("W55RP20-EVB-Pico", dhcp=True)
local_ip = nic.ifconfig()[0]

# Multicast configuration
MULTICAST_IP = "224.0.0.100"
PORT = 8087

# Create UDP socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

print("UDP Multicast sending in progress...")
count = 0

while True:
   # Pure ASCII text, avoid encoding issues
   msg = f"Board Multicast {count}".encode("ascii")
   s.sendto(msg, (MULTICAST_IP, PORT))
   
   print("Sent multicast:", msg)
   count += 1
   time.sleep(1)

video(video-uWrqMv2a-1781147105650)(type-csdn)(url-https://live.csdn.net/v/embed/524132)(image-https://v-blog.csdnimg.cn/asset/926f920dcacab8273abddd7eb9bba9ba/cover/Cover0.jpg)

Key Steps Explained for Multicast Code

Module Import and Network Initialization: Same as the broadcast code — call the wiznet function to enable DHCP auto-networking and obtain the local IP address

Multicast Parameter Configuration: Set the multicast address to 224.0.0.100 (within the multicast address range, customizable; all receiving devices must join this multicast group), and set the port to 8087 (can be the same as the broadcast port — no conflict)

UDP Socket Creation: Unlike the broadcast code, multicast does not require enabling broadcast mode; simply create a UDP-type socket directly

Loop Sending Multicast: Same logic as the broadcast code — continuously send pure ASCII-encoded data, print the sent content, and control the send frequency. Only devices that have joined this multicast group can receive the data


6. Execution Results and Test Verification

6.1 Serial Output Results

Flash the broadcast/multicast sending code to the W55RP20-EVB-MKR module, open the Thonny Shell window at the bottom, and click the run button (or press F5). You will see output similar to the following, indicating normal UDP data transmission:

UDP Broadcast Sending Output

MPY: soft reboot UDP Broadcast sending in progress...
Sent broadcast: b'Board Broadcast 0'
Sent broadcast: b'Board Broadcast 1'
Sent broadcast: b'Board Broadcast 2'
Sent broadcast: b'Board Broadcast 3'
... (looping continuously)

UDP Multicast Sending Output

MPY: soft reboot
UDP Multicast sending in progress...
Sent multicast: b'Board Multicast 0'
Sent multicast: b'Board Multicast 1'
Sent multicast: b'Board Multicast 2'
Sent multicast: b'Board Multicast 3'
... (looping continuously)

Receiver Output (Broadcast/Multicast)

MPY: soft reboot Waiting to receive UDP data (IP: 192.168.1.101, Port: 8087)...
Received from ('192.168.1.100', 54321): Board Broadcast 0
Received from ('192.168.1.100', 54321): Board Broadcast 1
... (continuously receiving sender data)

6.2 UDP Communication Verification Methods

After communication is established, you can verify the correctness of UDP broadcast/multicast functionality using the following two methods:

Method 1: Multi-Device Receiver Verification

Flash the receiving code to multiple W55RP20-EVB-MKR modules, ensuring all devices are connected to the same router (same subnet) as the sender

Broadcast Verification: Run the broadcast code on the sender; all receivers should receive data, confirming that the broadcast function is working properly

Multicast Verification: Run the multicast code on the sender; only receivers that have joined the specified multicast group will receive data; devices not in the group will not receive data, confirming that the multicast function is working properly

Method 2: PC-Based Receiver Verification

Use a serial monitor or network debugging tool (e.g., NetAssist) on your computer, set to UDP receive mode, with the same port as the sender (8087):

Broadcast Verification: The computer does not need to set a target IP; simply listen on port 8087 to receive the sender's broadcast data

Multicast Verification: The computer must join the specified multicast group (224.0.0.100) and listen on port 8087 to receive multicast data, verifying correct communication


7. One-Stop Troubleshooting Guide

7.1 Flashing Issues

ProblemTroubleshooting Steps
Computer cannot recognize the RPI-RP2 USB drive1. Make sure you are holding BOOTSEL before plugging in the USB cable 2. Use a different data-capable USB cable 3. Try a different USB port (preferably USB 2.0) 4. Try a different computer
Development board unresponsive after firmware drag1. Confirm you downloaded the W55RP20-EVB-MKR dedicated firmware, not the generic Raspberry Pi MKR firmware 2. Re-flash the firmware, ensuring the data cable is not disconnected during the transfer 3. Check that USB power supply is stable and sufficient

7.2 Port Recognition Issues

ProblemTroubleshooting Steps
Development board port not found in Thonny1. Re-plug the USB cable to ensure a firm connection 2. Close other software that uses the serial port (e.g., serial monitor, Arduino IDE, etc.) 3. Check Device Manager for a Board CDC device; if absent, install the Raspberry Pi MKR USB driver 4. Re-flash the MicroPython firmware 5. Try a different USB cable or USB port

7.3 Network Connection and UDP Communication Issues

ProblemTroubleshooting Steps
Long display of "Configuring DHCP", unable to obtain IP1. Check that the Ethernet cable is firmly connected and the network port indicator is blinking 2. Confirm the Ethernet cable is connected to a LAN port on the router, not the WAN port 3. Confirm the router has DHCP enabled 4. Try a different router LAN port or Ethernet cable 5. Restart the router and the development board 6. If multi-device networking is not required, switch to static IP configuration and manually set network parameters
IP address shows 0.0.0.01. Perform the network connection troubleshooting steps above 2. Confirm the SPI pin, CS pin, and RST pin configuration in the code matches the hardware wiring (especially important for discrete modules) 3. Confirm you are using the W55RP20-EVB-MKR dedicated firmware 4. Re-flash the firmware and restart the development board
UDP sending is normal, but receiver does not receive data1. Confirm the sender and receiver are in the same subnet (check IP address via ifconfig to ensure matching subnet) 2. Check that the sender and receiver ports are the same to avoid port conflicts 3. For multicast receive: confirm the receiver has joined the specified multicast group. For broadcast receive: confirm the broadcast address is set to 255.255.255.255 4. Check whether the router has multicast forwarding enabled (some routers disable it by default; manual activation may be required) 5. Disable the computer's firewall and antivirus software (when the computer acts as the receiver) 6. Try a different Ethernet cable or router LAN port to rule out hardware connection issues
Sender reports error, unable to create UDP socket1. Confirm the firmware is the W55RP20-EVB-MKR dedicated firmware; generic firmware may not support the wiznet_init module 2. Check that module imports in the code are correct (from wiznet_init import wiznet with no spelling errors) 3. Re-initialize the network, restart the development board, and re-run the code 4. Check if the port is occupied by another program (try a different port)

8. WIZnet Hardware Protocol Stack Core Advantages Comparison

To give you a more intuitive understanding of the value of the W5500 hardware protocol stack chip in UDP multicast/broadcast communication, we compare three mainstream embedded Ethernet solutions:

Comparison DimensionW5500 Hardware Stack SolutionExternal PHY Chip SolutionExternal Serial-to-Ethernet Module Solution
BOM CostMedium (MCU + network module, no additional components needed)Medium-High (MCU + PHY chip + peripheral components)High
PCB AreaSmall (high module integration, only module mounting space needed)Large (chip layout, routing space, and peripheral circuits required)Varies
Development DifficultyLow (MicroPython firmware encapsulates low-level details; minimal code for UDP multicast/broadcast)Medium-High (requires protocol stack debugging, low-level driver writing; high R&D capability required)Low
Network StabilityExtremely High (WIZnet has focused on hardware TCP/IP stacks for 25 years; strong anti-interference, low UDP packet loss)Variable (depends on the developer's proficiency in protocol stacks and network development; UDP prone to packet loss)Variable (depends on the module vendor's capability)
CPU Resource Usage0% (protocol stack fully handled by hardware, no MCU resource consumption, no impact on data send frequency)50%+ (protocol stack runs on MCU, consuming significant CPU and memory, affecting UDP send efficiency)0%
Hardware Socket CountW5500 8 independent hardware sockets, supporting multiple concurrent multicast/broadcast streamsDepends on MCU capability; theoretically supports multiple channels, but practically limited by CPU resourcesGenerally single-channel passthrough
Network ThroughputW5500 up to 15Mbps, smooth UDP data transmission, no noticeable latencyDepends on MCU capability; generally lower than hardware stack solutions; multi-device communication prone to stutteringApprox. 3-5Mbps
Interface Ease of UseSPI interface, simple wiring, compatible with most MCUs, supports high-speed communicationMCU requires dedicated interfaces such as MII/RMII, limited compatibilityTTL interface
Deployment DifficultyLow (mature MicroPython firmware, library files for application-layer protocols, rapid deployment for multi-device networking)High (application-layer protocols require manual porting of open-source libraries; high debugging cost)Depends on module integration; lacking features require custom packet packing/unpacking

The W55RP20-EVB-MKR development board already has an onboard Ethernet interface, making it ideal for quickly completing Ethernet functionality verification.

For UDP multicast/broadcast examples, the advantage of the W55RP20-EVB-MKR development board is that no additional Ethernet module connection is needed, nor is manual configuration of complex low-level drivers required. UDP multicast/broadcast communication testing can be accomplished with just a few lines of MicroPython example code, and the hardware protocol stack does not consume MCU resources, making multi-device communication more stable.


9. Typical Application Scenarios

The W55RP20-EVB-MKR module, combining the rapid development advantages of MicroPython with the stability of the WIZnet hardware protocol stack, is well-suited for the following UDP multicast/broadcast-based embedded and IoT application scenarios:

IoT Multi-Device Synchronous Control: Multiple smart devices (e.g., lights, sensors) within the same subnet receiving control commands via UDP broadcast for synchronous start/stop and parameter configuration

Industrial Equipment Status Monitoring: Multiple industrial sensors sending equipment status and collected data (e.g., temperature/humidity, pressure) to a monitoring center via UDP multicast for centralized monitoring

Smart Gateway Data Aggregation: Multiple sub-devices sending data to a gateway via UDP broadcast; the gateway aggregates and uploads to a cloud platform, simplifying multi-device networking architecture

Automatic Device Discovery: Newly networked devices broadcasting their own information (e.g., device ID, IP address) via UDP broadcast; gateways or master controllers receive this and complete automatic networking without manual configuration

Embedded Teaching Experiments: Suitable for embedded development teaching in universities and training institutions, intuitively demonstrating UDP protocol principles and multicast/broadcast differences while reducing teaching difficulty

Real-Time Data Push: In scenarios such as smart transportation and environmental monitoring, multiple devices synchronously receiving real-time data (e.g., traffic conditions, monitoring indicators) for rapid response


10. Summary

This article started from the principle differences between UDP multicast and broadcast, systematically introducing how to rapidly implement LAN multi-device batch communication using the W55RP20-EVB-MKR development board. With the WIZnet hardware TCP/IP stack, whether it is the network-wide push of broadcast or the group-directed transmission of multicast, only a small amount of MicroPython code is needed to accomplish it.

Reviewing the core takeaways of this article:

UDP Multicast/Broadcast Principles: Mastered the key differences between broadcast (network-wide undifferentiated push) and multicast (group-directed transmission), their workflows, and respective use cases

Development Environment Setup: Completed flashing of the W55RP20-EVB-MKR dedicated firmware and Thonny IDE configuration

Broadcast Code Implementation: Enabled broadcast mode via the SO_BROADCAST option, sending to 255.255.255.255 to achieve synchronous reception by all network-wide devices

Multicast Code Implementation: Directly created a UDP socket and sent to the multicast address 224.0.0.100; only devices that have joined the multicast group can receive

Multi-Device Verification: Fully verified the correctness of broadcast and multicast communication using both multi-device receiver testing and PC-based network debugging tools

Troubleshooting: Summarized troubleshooting methods for four major categories of common issues — flashing, port recognition, network connection, and UDP communication

Solution Comparison: Compared the W5500 hardware protocol stack, external PHY chip, and serial-to-Ethernet solutions; the W55RP20's 8 hardware sockets offer particularly outstanding advantages in concurrent multicast/broadcast scenarios

After mastering the UDP multicast/broadcast communication techniques in this article, you will be able to efficiently manage multiple devices within a LAN, laying a solid foundation for subsequent more complex network applications such as NTP time synchronization, HTTP services, and MQTT cloud connectivity.


11. Upcoming Tutorials and Resources

11.1 Series Preview

The next tutorial will cover NTP — Getting Time from the Network with W55RP20-EVB-MKR MicroPython Development, covering:

NTP protocol principles

Network time synchronization process

Local time calibration

Key mechanisms such as periodic synchronization

Mastering the core capability of accurately obtaining network time for embedded devices, providing a foundation for log timestamping, scheduled task execution, and IoT device timing control


11.2 Resource Access

Complete code for this article: WIZnet Pico MicroPython Example Project

W55RP20 Chip Datasheet: WIZnet Official Resources Page

If you found this article helpful, feel free to like, bookmark, and follow. Your support is our motivation to keep updating!

If you have any questions, please leave a comment below and we will respond promptly.

 
Documents
Comments Write