An open API service indexing awesome lists of open source software.

https://github.com/themactep/esp32c3oled-uart-bridge

ESP32-C3 Wireless UART Bridge
https://github.com/themactep/esp32c3oled-uart-bridge

Last synced: 10 days ago
JSON representation

ESP32-C3 Wireless UART Bridge

Awesome Lists containing this project

README

          

# ESP32-C3 Wireless UART Bridge

Turns the ESP32-C3 0.42" OLED board into a TCP↔UART bridge. Connect to a remote device's serial port over WiFi using any telnet client.

## Features

- Bidirectional UART ↔ TCP bridge at 115200 baud
- Telnet-compatible (port 23), single client
- OLED shows IP address and connection state
- Hardcoded WiFi credentials

## Hardware

See [BOARD.md](BOARD.md) for full board details and pinout.

| Signal | GPIO |
|--------|------|
| UART RX (← remote TX) | GPIO1 |
| UART TX (→ remote RX) | GPIO3 |
| I2C SDA (OLED) | GPIO8 |
| I2C SCL (OLED) | GPIO9 |

## Setup

### 1. Dependencies

Install via Arduino IDE → Tools → Manage Libraries:

- **U8g2** by olikraus

### 2. Board configuration

- Board: `ESP32C3 Dev Module`
- USB CDC On Boot: `Enabled`
- Flash Mode: `QIO`

### 3. Configure credentials

Edit `uart_bridge.ino`:

```cpp
#define WIFI_SSID "your_ssid"
#define WIFI_PASS "your_password"
```

### 4. Flash

Hold **B** (boot), tap **R** (reset), keep holding **B**, trigger upload in Arduino IDE, release **B** once upload starts connecting.

### 5. Connect

**Recommended — netcat (clean, no CR/LF issues):**
```bash
nc 23
```

> Use `nc`, not `telnet`. Telnet sends `\r\n` on Enter which causes double prompts on the remote shell.

**Full terminal (screen/minicom) via socat:**

`socat` creates a virtual serial port that tunnels to the TCP bridge, giving you proper terminal behavior (arrow keys, backspace, Ctrl+C):

```bash
# Install socat if needed
sudo apt install socat

# In one terminal — create virtual serial port
socat PTY,link=/tmp/ttyCAM,rawer TCP::23

# In another terminal — connect with screen or minicom
screen /tmp/ttyCAM 115200
# or
minicom -D /tmp/ttyCAM -b 115200
```

**USB (direct serial passthrough):**

The board also bridges via USB. Open `/dev/ttyACM0` at 115200 in any serial terminal — works simultaneously with the TCP connection.

## Wiring to Remote Device

```
ESP32-C3 Remote Device
GPIO1 (RX) ←── TX
GPIO3 (TX) ──→ RX
GND ─── GND
```

> Do not use GPIO20/21 for the bridge — they are UART0 (bootloader/console) and will cause flashing issues.

## OLED Display States

| Display | Meaning |
|---------|---------|
| `Connecting / WiFi...` | Joining WiFi |
| ` / Waiting...` | Ready, no client |
| ` / Connected` | Client active |