Communication Modules
The framework includes 15 communication modules organized into two main categories:Wired Communication
I2C Systems
I2C scanner, expander, and I/O expansion modules
Modbus Protocol
Industrial RTU/ASCII protocol with master/slave support
Serial Variants
Enhanced, hardware, software, and NMEA serial implementations
SPI Communication
SPI-based serial and dot matrix display control
Wireless Communication
LoRa
Long-range communication with multiple implementations
ESP-NOW
Mesh networking for ESP32/ESP8266 devices
Protocol Comparison
| Protocol | Range | Speed | Power Usage | Primary Use Case |
|---|---|---|---|---|
| I2C | <1m | 400kHz | Low | Sensors, displays, peripheral expansion |
| SPI | <1m | 10MHz+ | Low | High-speed peripherals, displays |
| Serial | <100m | 115200+ bps | Low | Debug, GPS, modems, general communication |
| Modbus | <1000m | 9600-115200 bps | Medium | Industrial control and monitoring |
| LoRa | 10km+ | 0.3-50 kbps | Low | IoT, remote sensing, long-range telemetry |
| ESP-NOW | 200m | 1 Mbps | Medium | Mesh networks, peer-to-peer communication |
Platform Support
- ESP32
- ESP8266
- AVR (Arduino)
Full Support - All communication protocols available
- Multiple hardware serial ports
- WiFi-based protocols (ESP-NOW)
- Custom GPIO pin mapping
- LoRa with SPI interface
- I2C with flexible pin assignment
Module Enable System
All communication modules use conditional compilation for memory optimization:Quick Start Examples
I2C Device Scanning
LoRa Communication
Modbus Slave Device
Architecture Patterns
Callback-Driven Communication
Most modules support asynchronous operations with callbacks:Template-Based Data Handling
Type-agnostic data operations across all modules:Common Features
Data Buffering
Data Buffering
Most modules implement buffering mechanisms:
- EnhancedSerial: Circular buffer with overflow protection
- NemaSerial: Platform-adaptive buffering (64B-512B)
- LoRaComV2: TX/RX buffers (256 bytes)
- Modbus: Register banks for data storage
Error Handling
Error Handling
Comprehensive error detection and reporting:
- EnhancedSerial: Enum-based error codes
- NemaSerial: CRC validation with ACK/NAK
- LoRa: Signal quality metrics (RSSI, SNR)
- Modbus: CRC16 error checking
String Parsing
String Parsing
Unified parsing utilities across modules:
Application Examples
Industrial Automation
Use Modbus for PLC communication and sensor monitoring
IoT Sensor Networks
Deploy LoRa for long-range environmental monitoring
Mesh Networking
Implement ESP-NOW for peer-to-peer device communication
Device Expansion
Add I2C/SPI peripherals to extend I/O capabilities
Best Practices
Testing: Always test communication modules with actual hardware. Loopback testing may not reveal timing or electrical issues.
Next Steps
I2C Expansion
Learn about I2C scanner and expander modules
Modbus Protocol
Implement industrial communication protocols
Serial Variants
Explore different serial implementations
LoRa Communication
Set up long-range wireless communication