📡 About
This Proof of Concept (PoC) demonstrates a transparent bridge between wired UART communication and the wireless ESP-NOW protocol.
It creates a simple, unidirectional data pipeline using three microcontrollers:
- Generic MCU → UART → ESP32-C6 (bridge) → ESP-NOW → ESP32 (receiver)
Raw ASCII strings sent from the source are forwarded wirelessly and displayed (with sender MAC) on the receiver.
graph LR
A[Source MCU<br>e.g. Arduino / STM32] -- UART --> B[Bridge<br>ESP32-C6-DevKitM-1<br>ESP-IDF]
B -- ESP-NOW --> C[Receiver<br>ESP32 WROOM-32<br>Arduino / PlatformIO]
1. Source: Any microcontroller sending plain text strings over UART (9600–115200 baud typical).
2. Bridge – ESP32-C6: Board: ESP32-C6-DevKitM-1 Framework: ESP-IDF v5.x Responsibilities: Receive data via UART Forward payload using ESP-NOW Cycle onboard WS2812 LED color (R → G → B) on each boot using NVS (persistence) Precise WS2812 control via RMT peripheral
3. Receiver – ESP32: Board: ESP32 DevKit / NodeMCU-32S / etc. Framework: Arduino + PlatformIO Responsibilities: Listen for ESP-NOW packets Print sender MAC address + received payload to Serial
-
Protocol Bridging: Seamlessly converts standard UART serial streams (wired) to ESP-NOW frames (wireless).
-
NVS State Persistence: The ESP32-C6 utilizes Non-Volatile Storage (NVS) to remember its configuration state across reboots.
-
Demo: Upon every reset, the C6 cycles its boot indicator color (Red → Green → Blue → Yellow → Purple) and saves the index to flash.
-
Visual Feedback (RMT): Utilizes the RMT peripheral to drive an onboard addressable RGB LED (WS2812), providing real-time status of data transmission.
-
Hybrid Frameworks: Demonstrates interoperability between ESP-IDF (running on the C6) and Arduino (running on the Receiver).
🔌 Hardware & Pinout
| Pin | Function | Description |
|---|---|---|
| GPIO17 (ESP32-C6) | UART RX | Connect to Source MCU TX |
| GPIO8 (ESP32-C6) | WS2812 | DataOnboard RGB LED (usually pre-connected) |
| PA2 (STM32-F407G) | UART TX | Connected to Bridge MCU RX |
| 3V3/GND | Power/GND | Share ground with source MCU |
**Note: Most ESP32-C6 dev boards already connect the onboard WS2812 to GPIO8. Double-check your board schematic.
1. Bridge – ESP32-C6 (ESP-IDF)
# 1. Clone or download the project
git clone https://github.com/yourusername/Data_Exchange.git
cd Data_Exchange/Sender/ESP-IDF
# 2. Set target (only needed once)
idf.py set-target esp32c6
# 3. Optional: configure project settings
idf.py menuconfig
# 4. Build & flash & monitor
idf.py -p /dev/ttyUSB0 flash monitor
# ↑ replace with your portAfter flashing, the LED should change color on every reset (proof of NVS working).
2. Receiver – ESP32 (Arduino / PlatformIO)
# Open the Receiver/Arduino folder in VS Code with PlatformIO extension
# Then either:
# • Click Upload (→) in PlatformIO toolbar
# • or run in terminal:
pio run --target uploadOpen the Serial Monitor (115200 baud) to see incoming messages.
Data_Exchange/
├── Source/
│ └── STM32CubeIDE/
│ ├── Core/ # Auto-generated HAL + startup code
│ │ ├── Inc/
│ │ └── Src/
│ │ └── main.c # User code: UART transmit example
│ ├── Drivers/ # STM32 HAL + CMSIS
│ ├── .ioc # STM32CubeMX configuration file
│ └── STM32xxxxxx_FLASH.ld # Linker script
│
├── Sender/ # (Bridge) ESP32-C6
│ └── ESP-IDF/
│ ├── main/
│ │ ├── CMakeLists.txt
│ │ ├── main.c # UART -> ESP-NOW bridge + NVS + RMT
│ │ └── Kconfig.projbuild # (optional)
│ ├── CMakeLists.txt
│ └── sdkconfig.defaults # (optional)
│
├── Receiver/ # (Receiver) ESP32
│ └── Arduino/
│ ├── src/
│ │ └── main.cpp # ESP-NOW receive + Serial print
│ ├── include/ # (optional)
│ └── platformio.ini
│
└── README.md