
开源 Arduino 库 TinyWifiDongle 可以把 ESP32-S2/S3 和 Raspberry Pi Pico W/2 W 开发板变成 USB WiFi 适配器。该库使用 USB CDC-NCM(Network Control Model,网络控制模型)为 Linux、macOS 和 Windows 11 电脑提供网络连接,无需安装额外驱动。
该库在 MCU 的 WiFi 与 USB 接口之间实现了一个透明的第二层(Layer-2)网桥,让所连接的电脑可以通过 DHCP 直接从路由器获取 IP 地址,无需 NAT 或单独的网络。它支持硬编码的 WiFi 凭据或基于浏览器的配置;在开发者的测试中,ESP32-S3 上可达约 5 Mbps,Pico 2 W 上约 2 Mbps。
支持的硬件:ESP32-S3 与 ESP32-S2,需具备原生 USB-OTG 支持;已在 ESP32-S3 上测试。Raspberry Pi Pico 2 W(RP2350)与 Pico W(RP2040);已在 Pico 2 W 上测试。ESP32-P4(+ESP32-C6)支持尚属实验性,USB 联网尚未测试。
ESP32-S3 与 ESP32-S2,需具备原生 USB-OTG 支持;已在 ESP32-S3 上测试。
Raspberry Pi Pico 2 W(RP2350)与 Pico W(RP2040);已在 Pico 2 W 上测试。
ESP32-P4(+ESP32-C6)支持尚属实验性,USB 联网尚未测试。
USB 联网——在 ESP32 上使用 TinyUSB、在 Raspberry Pi 开发板上使用 Arduino-Pico USB 协议栈来实现 USB CDC-NCM。
网络桥接——在 USB 与 WiFi 之间透明转发第二层(Layer-2)以太网帧,正常工作时无需 NAT,MCU 也不占用单独的 IP 地址。
主机兼容性——Linux、macOS 和 Windows 11 自带 CDC-NCM 驱动;Windows 10 需要额外安装驱动。
WiFi 配置——硬编码凭据,或通过强制门户(captive portal)进行配置,支持 WiFi 扫描并将凭据存储在闪存中。
USB 速率——在 ESP32-S2/S3 和 Pico W/2 W 上为 USB 全速(12 Mbps)。
吞吐量:ESP32-S3 为 530–615 KB/s(约 5 Mbps);Raspberry Pi Pico 2 W 为 110–325 KB/s(平均约 2 Mbps)。
Raspberry Pi Pico 2 W——110–325 KB/s(平均约 2 Mbps)。
该库提供了一个基础的 WiFiDongle 示例,通过 dongle.begin(“ssid”, “password”) 来初始化 USB 网络适配器。ESP32-S2/S3 用户必须在 Arduino IDE 中选择 USB-OTG(TinyUSB)选项,并通过开发板原生的 USB-OTG 端口连接。对于 Pico W 和 Pico 2 W,该库使用 Arduino-Pico 核心及其默认的 Pico SDK USB 协议栈。该库不支持最初的 ESP32 或 ESP32-C3/C6,因为它们缺少所需的 USB 设备功能。
该库还通过 TinyWifiDongleSetup 类和 WifiManager 示例支持基于浏览器的 WiFi 配置。它会创建一个临时的 TinyWifiDongle-Setup 接入点,你可以在其中输入凭据,随后凭据会被保存到闪存中。此功能已在 Pico 2 W 上测试,但尚未在 ESP32-S3 硬件上测试。
开发者 Phil Schatzmann 指出,该项目仍存在一些稳定性问题:ESP32-S3 在传输 100–200 MB 数据后偶尔会出现 USB 停滞。Pico 2 W 在测试中也出现过一次原因不明的重启。两者都是在 Linux 上测试的,而 Windows 11 和 macOS 则内置了 CDC-NCM 驱动支持。开源库 TinyWifiDongle 已按 MIT 许可证发布。你可以在 GitHub 上找到源代码、安装说明、示例和文档。
该项目看起来与用于 Raspberry Pi Pico W 的 pico-usb-wifi 固件相似,后者同样依赖 CDC-NCM 和透明第二层(Layer-2)桥接方案。不过,TinyWifiDongle 通过一个可复用的 Arduino 库提供该功能,兼容 ESP32 和 Raspberry Pi Pico 两类开发板,并且用基于浏览器的 WiFi 设置取代了 USB 串口管理控制台。此前那款固件报告称在 Pico W 上平均吞吐量达 4.75 Mbps,不过结果来自不同的实现和测试配置。现在也出现了 pico-usb-wifi 的 ESP32-S3 移植版,报告速率约 5.7 Mbps,但它基于 ESP-IDF 框架,而非 Arduino。
Debashis Das 是一名技术内容撰稿人和嵌入式工程师,拥有五年多的行业经验。凭借在嵌入式 C、PCB 设计和 SEO 优化方面的专长,他能把晦涩的技术主题与清晰易懂的表达巧妙结合起来。
支持 CNX Software!可以通过加密货币捐赠、在 Patreon 成为赞助人,或在 Amazon 或 Aliexpress 上购物。我们也会在文章中使用联盟链接,如果你点击这些链接后购买,我们会获得佣金。
本文来源:https://www.cnx-software.com/2026/11/24/tinywifidongle-arduino-library-turns-esp32-s3-and-raspberry-pi-pico-2-w-boards-into-usb-wifi-adapters/
若有版权问题,请来信告知:13951431913#139.com 或在右方提交评论。

TinyWifiDongle open-source Arduino library turns ESP32-S2/S3 and Raspberry Pi Pico W/2 W boards into USB WiFi adapters. The library uses USB CDC-NCM (Network Control Model) to provide network connectivity to Linux, macOS, and Windows 11 computers without installing additional drivers.
The library implements a transparent Layer-2 bridge between the MCU’s WiFi and USB interfaces, allowing the connected computer to get an IP address directly from the router via DHCP, without NAT or a separate network. It supports hard-coded WiFi credentials or browser-based configuration and achieves approximately 5 Mbps on the ESP32-S3 and 2 Mbps on the Pico 2 W in the developer’s tests.
Supported hardware ESP32-S3 and ESP32-S2 with native USB-OTG support; tested on ESP32-S3 Raspberry Pi Pico 2 W (RP2350) and Pico W (RP2040); tested on Pico 2 W ESP32-P4 (+ESP32-C6) support is experimental, with USB networking not yet tested
ESP32-S3 and ESP32-S2 with native USB-OTG support; tested on ESP32-S3
Raspberry Pi Pico 2 W (RP2350) and Pico W (RP2040); tested on Pico 2 W
ESP32-P4 (+ESP32-C6) support is experimental, with USB networking not yet tested
USB networking – USB CDC-NCM using TinyUSB on ESP32 and the Arduino-Pico USB stack on Raspberry Pi boards
Network bridge – Transparent Layer-2 Ethernet frame forwarding between USB and WiFi, with no NAT or separate MCU IP address during normal operation
Host compatibility – Linux, macOS, and Windows 11 with native CDC-NCM drivers; Windows 10 requires an additional driver
WiFi configuration – Hard-coded credentials or captive portal with WiFi scanning and flash-based credential storage
USB speed – USB full-speed (12 Mbps) on ESP32-S2/S3 and Pico W/2 W
Throughput ESP32-S3 – 530–615 KB/s (approximately 5 Mbps) Raspberry Pi Pico 2 W – 110–325 KB/s (approximately 2 Mbps on average)
Raspberry Pi Pico 2 W – 110–325 KB/s (approximately 2 Mbps on average)
The library provides a basic WiFiDongle example that initializes the USB network adapter using dongle.begin(“ssid”, “password”). ESP32-S2/S3 users must select the USB-OTG (TinyUSB) option in the Arduino IDE and connect through the board’s native USB-OTG port. For the Pico W and Pico 2 W, the library uses the Arduino-Pico core with its default Pico SDK USB stack. The library does not support the original ESP32 or ESP32-C3/C6 because they lack the required USB device functionality.
The library also supports browser-based WiFi configuration through the TinyWifiDongleSetup class and WifiManager example. It creates a temporary TinyWifiDongle-Setup access point where you can enter credentials, which are then saved in flash. This feature has been tested on the Pico 2 W but not yet on ESP32-S3 hardware.
The developer, Phil Schatzmann, notes that the project still has some stability issues, where the ESP32-S3 occasionally experiences USB stalls after transferring 100–200 MB of data. The Pico 2 W also showed an unexplained reboot during testing. Both were tested on Linux, while Windows 11 and macOS have built-in CDC-NCM driver support. The open-source TinyWifiDongle library has been released under the MIT license. You’ll find the source code, installation instructions, examples, and documentation available on GitHub .
The project looks similar to the pico-usb-wifi firmware for the Raspberry Pi Pico W, which relies on a CDC-NCM and transparent Layer-2 bridging approach. However, the TinyWifiDongle provides the functionality through a reusable Arduino library compatible with both ESP32 and Raspberry Pi Pico boards, along with browser-based WiFi setup instead of a USB serial management console. The previous firmware reported an average throughput of 4.75 Mbps on the Pico W, though the results came from a different implementation and test setup. An ESP32-S3 port of pico-usb-wifi is now also available, reporting around 5.7 Mbps, but it’s based on the ESP-IDF framework rather than Arduino.
Debashis Das is a technical content writer and embedded engineer with over five years of experience in the industry. With expertise in Embedded C, PCB Design, and SEO optimization, he effectively blends difficult technical topics with clear communication
Support CNX Software! Donate via cryptocurrencies , become a Patron on Patreon, or purchase goods on Amazon or Aliexpress . We also use affiliate links in articles to earn commissions if you make a purchase after clicking on those links.
本文来源:https://www.cnx-software.com/2026/11/24/tinywifidongle-arduino-library-turns-esp32-s3-and-raspberry-pi-pico-2-w-boards-into-usb-wifi-adapters/
若有版权问题,请来信告知:13951431913#139.com 或在右方提交评论。