ESP32 EtherNet/IP Scanner
EtherNet/IP scanner on ESP32-P4 + Ethernet (Waveshare ESP32-P4 Dev Kit, IP101)
Status: This project is a proof-of-concept implementation and requires further development, testing, and validation before production use.
Overview
An ESP32-P4 EtherNet/IP scanner implementation that provides explicit messaging capabilities for communicating with industrial EtherNet/IP devices. This project enables ESP32 devices to act as EtherNet/IP scanners, discovering devices on the network and reading/writing assembly data.
The scanner is specifically designed for the Waveshare ESP32-P4 Dev Kit (or compatible ESP32-P4 board) with Ethernet connectivity. It provides a complete solution for communicating with industrial EtherNet/IP devices using explicit messaging, with optional support for Micro800 PLC tag operations and Motoman robot CIP classes.
Key Features
- Device Discovery: Scan the network for EtherNet/IP devices using UDP broadcast
- Assembly I/O: Read and write assembly data using TCP-based explicit messaging
- Tag Support: Read and write tags on Micro800 PLCs using symbolic names (20 CIP data types supported)
- Motoman Robot Support: Read/write robot status, I/O signals, variables, and registers via vendor-specific CIP classes
- Implicit Messaging: Real-time Class 1 I/O data exchange for time-critical applications
- Web Interface: Built-in web UI for device configuration and monitoring
- Network Configuration: DHCP and static IP support with NVS persistence
- Thread-Safe: All operations protected with mutexes for concurrent access
Hardware Platform
This project targets the Waveshare ESP32-P4 Dev Kit with the following specifications:
- Microcontroller: ESP32-P4 (Espressif)
- Development Board: Waveshare ESP32-P4 Dev Kit (or compatible)
- Ethernet PHY: IP101 (10/100 Mbps)
- Ethernet Configuration: MDC GPIO31, MDIO GPIO52, REF_CLK GPIO50, PHY Reset GPIO51
Core Functionality
- EtherNet/IP explicit messaging (TCP port 44818)
- EtherNet/IP implicit messaging (UDP port 2222, Class 1 I/O)
- Device discovery via UDP List Identity requests
- Assembly read/write operations
- Assembly instance discovery
- Session management (automatic)
Tag Operations (Optional)
When enabled, the scanner supports tag read/write for Micro800 series PLCs:
- Support for 20 CIP data types via API
- 6 data types via web UI (BOOL, SINT, INT, DINT, REAL, STRING)
- Symbolic tag name support (e.g., "MyTag", "MyArray[0]")
Motoman Robot Support (Optional)
Complete support for all 18 Motoman CIP classes:
- Robot status reading (Class 0x72) - Running, Error, Hold, Alarm, Servo On
- Alarm reading (Classes 0x70, 0x71) - Current alarm and alarm history
- Job information (Class 0x73) - Active job name, line number, step, speed override
- Axis configuration (Class 0x74) - Axis coordinate names
- Robot position (Class 0x75) - Current robot position with configuration
- Position deviation (Class 0x76) - Deviation of each axis
- Torque (Class 0x77) - Torque of each axis
- I/O signal read/write (Class 0x78) - General Input/Output, Network I/O
- Register read/write (Class 0x79)
- Variable access - Byte (B), Integer (I), Double (D), Real (R), String (S) types
- Position variables - Robot (P), Base (BP), External axis (EX) position types
Testing Status: Read operations validated on a live Motoman DX200 controller; write operations not yet tested.
Web Interface
After the device boots and obtains an IP address, access the web interface at http://<device-ip>/:
- Device Discovery: Scan network for EtherNet/IP devices and read/write assembly data
- Read Tag: Read tags from Micro800 PLCs using symbolic names
- Write Tag: Write tags to Micro800 PLCs (supports BOOL, SINT, INT, DINT, REAL, STRING types)
- Implicit Messaging: Connection management for Class 1 I/O
- Network Configuration: Configure DHCP or static IP settings with NVS persistence
- Real-time Device Status: Monitor connection status and device information
Software Requirements
- ESP-IDF: Version 5.0 or later
- CMake: 3.16 or later
- Python: 3.6 or later (for ESP-IDF tools)
Example Applications
The repository includes complete example code demonstrating:
- GPIO I/O Mapping: Reading input assemblies and controlling GPIO outputs based on assembly data
- Bidirectional Translator: Micro800 PLC ↔ Motoman Robot translator application
- Pick-and-Place Application: Example demonstrating bidirectional translation patterns
Note: Examples are untested demonstration code - use as reference for your own implementation.