Turns any ESP32 board into a Wi-Fi adapter for a VESC motor controller. The ESP32 sits on the VESC UART port and runs a TCP server, so VESC Tool can connect over the network instead of a USB cable. Handy when the controller is buried in a board, scooter or e-bike and you just want to read values or change a setting.
The bridge doesn't touch the data. Every byte from TCP goes to the UART and back, so it works with any VESC firmware that talks over UART.
- Joins your router or phone hotspot. If it can't, it starts its own access point.
- While on its own access point it keeps checking for the router, so it doesn't matter which one comes up first.
- Shows up as
vesc-bridge.local(mDNS), no need to look up the IP. - Non-blocking in both directions. A slow or dying Wi-Fi link can't stall it, and bytes never get reordered.
- A new connection takes over from the old one, so a phone that went to sleep doesn't lock you out. Dead connections are dropped after about 10 seconds (TCP keepalive).
- Status LED, plus a serial log showing what it's doing.
- No external libraries, only the ESP32 Arduino core.
Any ESP32 dev board works. The main target is the classic ESP32 (DevKit / WROOM); it also builds for ESP32-S3 and ESP32-C3, but check the pin numbers for those.
| VESC UART port | ESP32 |
|---|---|
| TX | GPIO 16 (RX) |
| RX | GPIO 17 (TX) |
| GND | GND |
| 5V | VIN / 5V |
TX goes to RX and the other way around. The VESC UART is 3.3 V, so no level shifter is needed. Some VESC 5V rails dip when Wi-Fi starts transmitting; if the ESP32 resets at boot, put a 10 µF (or larger) capacitor between 5V and GND near the board.
In VESC Tool, under App Settings → General, set App to Use to UART (or
PPM and UART / ADC and UART if you already use one of those). The default
baud rate is 115200, which matches the bridge. Write the app configuration.
- Install the Arduino IDE and add the ESP32 boards package (Boards Manager, search for "esp32" by Espressif). Core 3.x is recommended, 2.0.x should also work.
- Open
vesc_wifi/vesc_wifi.ino. - Edit
vesc_wifi/config.h. At minimum setWIFI_SSIDandWIFI_PASSWORD, and changeAP_PASSWORDto something of your own. - Pick your board (for a generic one: ESP32 Dev Module) and upload. If the upload doesn't start, hold the BOOT button until it does.
With arduino-cli:
arduino-cli compile --fqbn esp32:esp32:esp32 vesc_wifiarduino-cli upload --fqbn esp32:esp32:esp32 -p COM5 vesc_wifiAll settings live in config.h:
| Setting | Default | Notes |
|---|---|---|
WIFI_SSID / WIFI_PASSWORD |
Network to join | |
AP_SSID / AP_PASSWORD |
VESC-Bridge / vescbridge |
Own access point. Password 8+ chars, or "" for open |
AP_CHANNEL |
6 | |
WIFI_AP_ONLY |
0 | 1 = always run as access point |
WIFI_CONNECT_TIMEOUT_MS |
15000 | How long to wait for the router at boot |
WIFI_LOST_FALLBACK_MS |
30000 | Router gone this long, switch to access point |
WIFI_RETRY_INTERVAL_MS |
60000 | Retry the router from access point mode, 0 = never |
MDNS_HOSTNAME |
vesc-bridge |
|
TCP_PORT |
65102 | VESC Tool default |
VESC_RX_PIN / VESC_TX_PIN |
16 / 17 | |
VESC_BAUD |
115200 | Must match the VESC UART setting |
STATUS_LED_PIN |
2 | -1 to disable |
The router retry only happens while nobody is connected to the bridge's access
point. During the retry (up to WIFI_CONNECT_TIMEOUT_MS) the access point is off.
VESC Tool (desktop): Connection page, TCP tab. Host vesc-bridge.local (or
the IP), port 65102, then Connect.
Access point mode: join the VESC-Bridge network and use 192.168.4.1.
If .local names don't resolve on your machine, use the IP address printed on
the serial monitor at boot (115200 baud).
| LED | Meaning |
|---|---|
| Fast blinking | Connecting to the router |
| Slow blinking | On the router, waiting for VESC Tool |
| Short flashes | Running its own access point |
| Solid | Client connected |
tools/detect_vesc_bridge.py finds the bridge, opens a connection and asks the
VESC for its firmware version. If that works, VESC Tool will work too.
python tools/detect_vesc_bridge.pyResolving vesc-bridge.local ...
192.168.1.57
Connecting to 192.168.1.57:65102 ...
connected
Asking the VESC for its firmware version ...
firmware 6.05, hardware 60_MK6
round trip 24 ms
You can also pass an IP or another host name, e.g.
python tools/detect_vesc_bridge.py 192.168.4.1. Needs Python 3.7+, no extra
packages.
- Connects, but VESC Tool gets no answer: RX and TX not crossed, GND missing, or the UART app isn't enabled on the VESC. Run the Python script, it tells you whether the bridge or the VESC is the problem.
- Keeps falling back to the access point: wrong SSID/password, or the network is 5 GHz only. The ESP32 only does 2.4 GHz.
- ESP32 resets when Wi-Fi starts: power issue, see the capacitor note above.
- Laggy realtime data: move closer to the router, or use access point mode so the phone or laptop connects to the bridge directly.
Don't flash VESC firmware over this bridge. Wi-Fi can drop for a moment, and if that happens in the middle of an upload you'll need a USB cable or SWD to get the controller back. Use it for monitoring, tuning and configuration.
See CHANGELOG.md.