Home >Industry dynamics>Industry dynamics
Technical Selection Recommendation: WiFi MODBUS TCP Slave Solution Based on E103-W06 vs. ESP32

Requirement Analysis and Pain Point Confirmation

core requirements can be summarized as follows:

  • Main System Communication Protocol: MODBUS TCP (Master communicates via WiFi).

  • Network Environment: 5G AP WiFi coverage (Module must operate in STA mode, connecting to a 5G router).

  • Number of Slave Devices: Estimated at 30, each device must support at least 2 DI (Digital Input) and 2 DO (Digital Output).

  • Current Proposed Solution: E103-W06 + STM32 Chip, implementing MODBUS TCP to RTU conversion.

  • Main Constraint: Extremely small installation space (Length 140mm × Width 60mm × Height 20mm), making it difficult to find a suitable off-the-shelf module.

pain point is: Finding a compact solution that integrates a WiFi module, a main MCU, and I/O interfaces within a very limited space.


It is strongly recommended to abandon the “E103-W06 + STM32” solution and instead adopt the “ESP32 series chip (e.g., ESP32-WROOM-32) + Custom I/O expansion baseboard” solution.

Why Abandon the E103-W06 + STM32 Solution?

  1. Space Constraints: The E103-W06 module itself measures 40mm × 27mm. Adding the STM32 minimum system board, along with necessary power, isolation, and I/O interface circuits, will result in a total size far exceeding 140×60mm and will be difficult to fit into a 20mm height.

  2. Functional Redundancy: The E103-W06 is a high-performance dual-band WiFi module. Its integrated ARM Cortex-M4 processor is fully capable of independently running the MODBUS TCP protocol stack and control logic, eliminating the need for an additional STM32 MCU. Adding an STM32 would only increase cost, power consumption, and PCB area.

  3. Development Complexity: Communication between the STM32 and the E103-W06 requires AT commands or serial communication, adding latency and increasing the difficulty of development and debugging.

Why Recommend the ESP32 Solution?

The ESP32 series chip (e.g., the ESP32-WROOM-32 module) is an ideal solution for this problem, perfectly matching your requirements:

RequirementSolution AdvantageDetailed Description
Integrated WiFiSingle-chip WiFiThe ESP32 integrates 2.4GHz WiFi, compliant with IEEE 802.11 b/g/n standard, supporting STA mode, allowing direct connection to the WiFi hotspot of the 5G router.
MODBUS TCPNative SupportThe ESP32 features a powerful Xtensa dual-core 32-bit processor running at up to 240MHz, easily running open-source libraries like FreeMODBUS or libModbus to natively implement the MODBUS TCP slave protocol.
I/O ControlRich GPIOsThe ESP32 has 34 programmable GPIOs, capable of directly driving 2 DI and 2 DO without external expansion. With external optocoupler isolation and relays, industrial-grade I/O control can be achieved.
Compact SizeExtremely MiniaturizedThe ESP32-WROOM-32 module measures only 18mm × 25.5mm. With necessary power, isolation, and driver circuits, the PCB size can be easily controlled to Length 50mm × Width 40mm, far smaller than your space constraint of 140×60mm.
Cost and EcosystemExcellent Value for MoneyThe ESP32 chip is extremely low-cost and boasts a very mature Arduino IDE and ESP-IDF development environment. Development resources are abundant, and the community is active, greatly shortening the development cycle.

 Detailed Solution Design (Based on ESP32 + Custom I/O Baseboard)

3.1 Hardware Architecture

Function ModuleRecommended ComponentFunctionReference from Knowledge Base
Main ControllerESP32-WROOM-32 ModuleCore processor, implementing WiFi communication, MODBUS TCP protocol stack, I/O logic controlESP32 series modules in the knowledge base (e.g., E101-32WN4) are based on ESP32, with similar functionality.
WiFi AntennaOnboard PCB Antenna or IPEX AntennaConnect to WiFi networkChoose based on space; IPEX antenna can provide better signal quality if space allows.
Power ModuleWide Input Voltage DCDC (e.g., LM2596)Convert external voltage (e.g., 12V or 24V) to 3.3V for ESP32 and peripheralsChoose based on your actual external power supply voltage.
DI Input CircuitOptocoupler Isolation + Voltage Divider ResistorsConvert external 12-24V digital input signals to 3.3V and isolate/protect the ESP32Refer to the DI input design of the MA01/MA02 series remote I/O modules in the knowledge base.
DO Output CircuitRelay Driver + RelayAmplify the 3.3V GPIO signal from ESP32 to drive relays and control external devicesRefer to the DO output design of ME31-AAAX2240 and other network IO modules.
RS485 InterfaceMAX485/SP485Reserved for connecting other extended MODBUS RTU slave devicesMany serial device servers in the knowledge base (e.g., E103-W06) use this interface.

Software Development Process

  1. Environment Setup: Install the Arduino IDE or ESP-IDF development environment and configure ESP32 board support.

  2. WiFi Connection: Write code to enable the ESP32 to connect to your specified 5G WiFi hotspot in STA mode.

  3. MODBUS TCP Slave Implementation:

    • Use the ModbusIP library (e.g., EthernetModbus or ModbusIP_ESP8266) from the Arduino libraries or ESP-IDF components.

    • Define the MODBUS slave address and register mapping in the code (e.g., map DI1 and DI2 to discrete input registers, map DO1 and DO2 to coil registers).

    • Listen on port 502 (the default MODBUS TCP port) and handle read/write requests from the master.

  4. I/O Control Logic:

    • Initialize GPIOs, configure DIs as inputs, and DOs as outputs.

    • In the main loop, periodically read the DI pin states and update the corresponding MODBUS registers.

    • When the master writes to the coil registers via MODBUS TCP, immediately update the corresponding DO pin states.

  5. Firmware Flashing and Testing: Flash the firmware to the ESP32 using a USB-UART tool. Use Modbus Poll software to simulate a master and verify that communication and I/O control are functioning correctly.

Comparison with E103-W06+STM32 Solution

Comparison DimensionE103-W06 + STM32ESP32 + Custom I/O BaseboardConclusion
Space UsageLarge (two modules + baseboard)Small (single chip + baseboard)ESP32 solution wins decisively
Development ComplexityHigh (dual-chip communication, AT commands)Low (single-chip software implementation)ESP32 solution is simpler
CostHigh (cost of two chips)Low (cost of single chip)ESP32 solution is cheaper
FlexibilityHigh (different I/O expansions possible)High (GPIOs can be directly defined)Comparable
ReliabilityMedium (communication between chips is a potential failure point)High (higher integration with single chip)ESP32 solution is more reliable
Software EcosystemMedium (STM32 + ESP8266/CC3200)Very Rich (Arduino/ESP-IDF)ESP32 ecosystem is superior

Final Recommendation: Abandon the E103-W06+STM32 solution and adopt a custom development solution based on the ESP32-WROOM-32 module.

Your Next Steps:

  1. Evaluate Samples: Purchase an ESP32-DevKitC development board (approx. 20-30 USD). Use the Arduino IDE to write a simple test code to verify WiFi connection and MODBUS TCP functionality.

  2. Prototype Verification: Build the DI/DO circuits on a breadboard and test the I/O control functions. Confirm that the number of ESP32 GPIOs meets your DO/DI requirements (if you need more than 20 GPIOs, consider the ESP32-S3).

  3. PCB Design: Based on the verified circuit, design your own Custom I/O Baseboard. Integrate the ESP32-WROOM-32 module, power supply, isolation, and I/O interfaces onto a single PCB. The size can be controlled to Length 50mm × Width 40mm or less, perfectly fitting your space requirement.

  4. Mass Production: Contact EBYTE or a PCB manufacturer for small batch prototyping and production.

Choosing EBYTE means choosing a professional, reliable, and efficient industrial IoT solution. Although the core solution we recommend has shifted from E103-W06 to ESP32, EBYTE also provides WiFi modules based on the ESP32 series (like the E101-32WN4 series), which you can reference for designing your core module.