Wiznet makers

Grace_Koo

Published January 29, 2026 ©

34 UCC

11 WCC

6 VAR

0 Contests

0 Followers

0 Following

Original Link

Unifying Industrial Chaos: A Hybrid IIoT Gateway using W5500 & LoRaWAN

Hybrid IIoT Gateway Case Study: Unifying wired W5500 Modbus & wireless LoRaWAN data into a single, integrated dashboard.

COMPONENTS Hardware components

WIZnet - W5500

x 1


PROJECT DESCRIPTION

The cover image of this article was generated by Gemini.

1. Executive Summary

This report analyzes the "IIoT Master Class" project developed by Antony Mapfumo over a 12-week period.

To address the prevalent issue of "Communication Fragmentation" in industrial environments, this project establishes a Hybrid Monitoring Platform combining WIZnet W5500 (Wired) and LoRaWAN (Wireless). It serves as an excellent reference demonstrating how W5500 functions not just as an Ethernet chip, but as a core component of an "Industrial Edge Gateway" that integrates heterogeneous protocols.


2. Background: The "Industrial Chaos"

The developer focused on a critical pain point in the current transition to Smart Factories: Data Silos.

Existing legacy machinery and new smart sensors use different communication protocols, leading to inefficient, dual-track management.

[Table 1] Comparison of Industrial Communication Methods

CategoryTarget EquipmentProtocolPriority ValuePain Point
Legacy SystemsCritical MachineryModbus TCP (Wired)StabilityClosed ecosystem, hard to expand
Smart SensorsEnvironmental SensorsLoRaWAN (Wireless)FlexibilityIncompatible with legacy systems

This project aims to integrate these two disparate data streams into a single platform using a Unified Solution powered by W5500.


3. System Architecture Analysis

The system is designed with a three-tier structure: Field (Collection) - Edge (Middleware) - View (Visualization).

Generated by Gemini

3.1. Field Device Layer

A dual-communication strategy was applied based on data criticality and installation environment.

[Table 2] Field Node Configuration

CategoryWired Node (Critical)Wireless Node (Flexible)
Core ComponentSTM32F446RE + WIZnet W5500STM32WL55 (LoRa SoC)
ProtocolModbus TCP over EthernetLoRaWAN (OTAA)
Data TypeReal-time machinery control dataEnvironmental data in hard-to-wire areas
Key FeatureCompliant with IEEE 754 Float32 StandardClass A Low-Power Operation

3.2. Edge Middleware Layer

This layer acts as a hub to translate and aggregate different protocols. For maintainability and scalability, all services are implemented as Docker Container-based Microservices.

  • Modbus Bridge: Polls the W5500 node every 2 seconds to collect data.
  • MQTT Bridge: Subscribes to packets from the LoRaWAN Gateway and decodes them.
  • Security: Implements Network Segmentation and STRIDE threat modeling.

4. Technical Excellence: Why W5500?

A standout feature of this project is the combination of the Rust programming language and W5500's Hardware TCP/IP stack to achieve high performance.

  • Zero-Copy Data Processing: The firmware reads data directly from the W5500’s internal RX buffer and parses it without unnecessary memory duplication. This optimization keeps MCU RAM usage under 8KB.
  • Industry Standard Compatibility: Beyond simple data transfer, the system converts sensor data into the IEEE 754 Floating Point standard and maps it to Modbus Registers. This ensures immediate interoperability with existing Commercial HMI/SCADA systems.

5. Engineering Insights & Trial-and-Error

The developer's journey in resolving technical challenges offers valuable insights for W5500 users.

[Table 3] Troubleshooting Summary

IssueCauseSolution
Socket Lifecycle ManagementW5500 socket remains in CLOSE_WAIT state if Modbus Master exits abnormally.Added Watchdog Logic in firmware: Detects zombie sockets and forces a re-open to ensure high availability.
Endianness MismatchDifference between STM32 (Little-endian) and Network Standards (Big-endian).Applied logic to reverse the byte order for critical keys (e.g., DevEUI) before transmission.
Integer-Only MathHardFault error when processing floats on MCU without FPU.Used Fixed-point arithmetic (processing as integers internally) and converted only at the final stage.

6. Results and Verification

A continuous 72-hour stress test confirmed the following performance metrics:

Industrial IoT Monitoring Platform
https://www.mapfumo.net/posts/2026/january/week-12-portfolio-complete-from-led-blink-to-industrial-iot-in-12-weeks/
  • Unified Visualization: Validated that wired (W5500) and wireless (LoRa) data are compared in real-time on a single dashboard.
  • Performance: Modbus TCP average response time clocked at 12ms, suitable for real-time control.
  • Stability: Achieved 0% packet loss and zero system crashes during a 72-hour continuous stress test.

7. FAQ: Key Implementation Details

  • Q1. Why is the W5500 (Wired) necessary when LoRaWAN covers long ranges?

Reliability is the decisive factor. While LoRaWAN is excellent for low-power environmental monitoring, it suffers from high latency and duty cycle limitations. The W5500 (Ethernet) is essential for critical machinery that requires real-time control (under 12ms latency) and zero packet loss stability, which wireless protocols cannot guarantee.

  • Q2. How does the system solve the "Data Silo" problem between wired and wireless devices?

It utilizes a Unified Edge Gateway architecture. The system runs independent "Bridges" (Modbus Bridge & MQTT Bridge) within Docker containers. These bridges collect data separately from W5500 and LoRaWAN nodes but normalize and store them into a single InfluxDB database, allowing for unified visualization on one dashboard.

  • Q3. Why was Rust chosen over C/C++ for the firmware?

Rust provides memory safety and modern concurrency features without the overhead of a traditional RTOS. This project leverages the Embassy framework, enabling efficient async/await operations. This is crucial for handling network stacks (W5500) and sensor readings simultaneously without blocking the system.

  • Q4. Is this system compatible with existing Industrial PLCs?

Yes. The firmware converts raw sensor data into the IEEE 754 Floating Point format and maps them to standard Modbus Holding Registers (starting at address 40001). This means any commercial SCADA or HMI system that supports Modbus TCP can immediately read and utilize this data without modification.


[References]

  • Project by: Antony Mapfumo
  • Blog

https://www.mapfumo.net/posts/2026/january/week-12-portfolio-complete-from-led-blink-to-industrial-iot-in-12-weeks/

  • Repository

https://github.com/mapfumo/wk12-portfolio.git

https://github.com/mapfumo/wk11-unified-monitoring.git

 

Documents
Comments Write