ESP32-C6 WiFi Bridge for BeagleV-Fire

rodneyosodo1 pts0 comments

GitHub - rodneyosodo/esp32-wifi-dongle: An ESP32-C6 firmware + Python host script that bridges WiFi to a BeagleV-Fire SBC over UART using SLIP and NAPT, turning the ESP32 into a wireless network adapter. · GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

rodneyosodo

esp32-wifi-dongle

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star

main

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>5 Commits<br>5 Commits

firmware

firmware

.gitignore

.gitignore

LICENSE

LICENSE

README.md

README.md

host.py

host.py

image.svg

image.svg

View all files

Repository files navigation

ESP32-C6 WiFi Bridge for BeagleV-Fire

Turn an ESP32-C6 into a WiFi dongle for the BeagleV-Fire SBC. The ESP32-C6 connects to a WiFi AP and bridges IP traffic to the BeagleV-Fire over UART using SLIP framing, with NAPT so the BeagleV-Fire can reach the internet.

Architecture

ESP32-C6 firmware (firmware/): Connects to WiFi STA, registers a custom lwIP netif for the SLIP/UART link, enables NAPT so host traffic is NATed through WiFi.

Host script (host.py): Pure Python stdlib. Creates a TUN interface (slip0, IP 10.0.0.2), encodes/decodes SLIP frames, bridges between TUN and UART.

No kernel PPP modules required — works on BeagleV-Fire which lacks CONFIG_PPP.

Wiring

ESP32-C6<br>BeagleV-Fire

GPIO 23 (TX)<br>P9.11 (RX)

GPIO 22 (RX)<br>P9.13 (TX)

GND<br>GND

UART device on BeagleV-Fire: /dev/bone/uart/4

Building and Flashing

cd firmware<br>idf.py set-target esp32c6<br>idf.py menuconfig<br>idf.py build<br>idf.py flash monitor

Running

On the BeagleV-Fire:

sudo python3 host.py /dev/bone/uart/4

The script creates slip0 at 10.0.0.2/24. Assign an IP and set a route:

sudo ip addr add 10.0.0.2/24 dev slip0<br>sudo ip link set slip0 up<br>sudo ip route add default via 10.0.0.1<br>echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf<br>ping -I slip0 8.8.8.8

How It Works

ESP32-C6 boots, connects to WiFi, gets an IP from the AP's DHCP server.

UART1 (GPIO 22/23) is initialized for SLIP at 460800 baud.

A custom lwIP netif (sl0) is registered with IP 10.0.0.1/24 — this represents the UART link.

NAPT is enabled on the SLIP netif via ip_napt_enable_netif().

A FreeRTOS task reads UART bytes, decodes SLIP frames, and feeds IP packets into lwIP via tcpip_input().

lwIP routes packets: host packets arrive on SLIP netif → NAPT translates source IP → forwarded out WiFi netif.

Replies from WiFi arrive on the WiFi netif → NAPT translates destination IP → routed to SLIP netif → encoded as SLIP → sent over UART.

NAPT Design (ESP-IDF lwIP)

ESP-IDF's NAPT requires:

Input netif (where packets arrive): napt = 1

Output netif (where packets leave): napt = 0 (default)

ip_napt_enable_netif() is used (not direct flag assignment) because it also calls ip_napt_init() to size the NAPT table.

About

An ESP32-C6 firmware + Python host script that bridges WiFi to a BeagleV-Fire SBC over UART using SLIP and NAPT, turning the ESP32 into a wireless network adapter.

Resources

Readme

License

MIT license

Uh oh!

There was an error while loading. Please reload this page.

Activity

Stars

stars

Watchers

watching

Forks

forks

Report repository

Releases

No releases published

Packages

Uh oh!

There was an error while loading. Please reload this page.

Contributors

Uh oh!

There was an error while loading. Please reload this page.

Languages

56.0%

Python<br>42.3%

CMake<br>1.7%

You can’t perform that action at this time.

wifi esp32 napt beaglev fire uart

Related Articles