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.
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
| Category | Target Equipment | Protocol | Priority Value | Pain Point |
|---|---|---|---|---|
| Legacy Systems | Critical Machinery | Modbus TCP (Wired) | Stability | Closed ecosystem, hard to expand |
| Smart Sensors | Environmental Sensors | LoRaWAN (Wireless) | Flexibility | Incompatible 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).
3.1. Field Device Layer
A dual-communication strategy was applied based on data criticality and installation environment.
[Table 2] Field Node Configuration
| Category | Wired Node (Critical) | Wireless Node (Flexible) |
|---|---|---|
| Core Component | STM32F446RE + WIZnet W5500 | STM32WL55 (LoRa SoC) |
| Protocol | Modbus TCP over Ethernet | LoRaWAN (OTAA) |
| Data Type | Real-time machinery control data | Environmental data in hard-to-wire areas |
| Key Feature | Compliant with IEEE 754 Float32 Standard | Class 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
| Issue | Cause | Solution |
|---|---|---|
| Socket Lifecycle Management | W5500 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 Mismatch | Difference 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 Math | HardFault 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:

- 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
- Repository
https://github.com/mapfumo/wk12-portfolio.git
https://github.com/mapfumo/wk11-unified-monitoring.git

