Wi-Fi mesh builder

A Raspberry Pi batman-adv mesh lab

Use two or three Raspberry Pis and USB Wi-Fi adapters to learn batman-adv on a desk: why onboard Wi-Fi cannot mesh, which driver families can, and the limits.

Difficulty
Advanced
Time
A weekend (our estimate, not from a source)
Cost
Two or three Raspberry Pis and USB Wi-Fi adapters whose chipset you have checked

Updated 4 Nov 2026

Overview

A lab of a few Raspberry Pis is a cheap way to see batman-adv do its work: originator messages, neighbour tables, a single virtual interface across several machines. The catch is Wi-Fi. A mesh lab over Wi-Fi needs adapters whose driver can run as an 802.11s mesh point, and the Pi's own Wi-Fi cannot.

Read this alongside Build a batman-adv node on OpenWrt, which documents the same protocol on routers, and the batman-adv explainer for how it works. For what a Pi can do on a LoRa mesh instead, see Pi gateway with meshtasticd.

Why the onboard Wi-Fi cannot do it

The Pi's onboard Wi-Fi sits on an SDIO bus and is bound to the brcmfmac driver in the mainline device tree (bcm283x-rpi-wifi-bt.dtsi has a brcm,bcm4329-fmac node). In the brcmfmac source, the code that adds and removes interfaces returns -EOPNOTSUPP for NL80211_IFTYPE_MESH_POINT:

  • Mainline drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c (file last touched 2026-10-05): the add-interface switch returns ERR_PTR(-EOPNOTSUPP) for ad-hoc, AP_VLAN, WDS and mesh point; the delete-interface switch returns -EOPNOTSUPP for mesh point.
  • The Raspberry Pi kernel tree, branch rpi-6.18.y (pushed 2026-11-03), has the same lines.
  • The modes the driver advertises are station, ad-hoc and AP (plus monitor and P2P when features allow). Mesh point is not in the list.

So the Pi's built-in Wi-Fi can be a client or an access point, not a mesh point. Ad-hoc (IBSS) is advertised, but we found no document saying it works on any Pi firmware or band, and the add-interface path rejects creating a new ad-hoc interface, so we do not recommend building a lab on it.

Which Wi-Fi chip each Pi model has: the datasheets we read do not name it, so we do not print part numbers. What they say: Pi 3 B+ "2.4 GHz and 5 GHz IEEE 802.11b/g/n/ac wireless LAN"; Pi 4 "802.11 b/g/n/ac Wireless LAN"; Pi 5 "Dual-band 802.11ac Wi-Fi"; Zero 2 W "2.4GHz 802.11 b/g/n wireless LAN" only, so it has no 5 GHz at all.

USB adapters: which drivers advertise mesh point

Retail dongle names change and one product name can hide different chips between batches. We did not map any retail product to a chipset, so this table names drivers and chipsets. Find the chipset of the adapter you hold, then check it here.

Driver (USB chips) What the source shows Mesh point?
ath9k_htc (Atheros AR9271; AR7010 with AR928x chips) htc_drv_init.c lists station, ad-hoc, AP, P2P and MESH_POINT; the Linux wireless wiki page lists "IBSS Mode" and "Mesh Mode"; the OpenWrt 802.11s page prints an ath9k_htc USB stick showing mesh point Yes, in three sources
mt76x0u (MediaTek MT7610U), mt76x2u (MT7612U, MT7662U) mt76x02_util.c includes MESH_POINT in the interface combination limits under CONFIG_MAC80211_MESH; we did not locate the base mode list for these chips Partial
rt2800usb (rt2x00 family) rt2x00dev.c adds ad-hoc and mesh point when the device has beacon slots, under CONFIG_MAC80211_MESH Advertised if the device has beacon slots
mt7921 and the mt792x family mt792x_core.c lists station, AP and P2P modes, no mesh point and no ad-hoc No, in the shared setup; chip-specific additions not ruled out
mt7601u (MediaTek MT7601U) init.c lists station only No
rtl8xxxu (Realtek 8xxx USB) station, plus AP when supported No mesh, no ad-hoc
rtw88 (including USB variants) station, AP and ad-hoc Ad-hoc yes, mesh point no
rtl8187 station and ad-hoc Ad-hoc only
brcmfmac (Broadcom FullMAC; also used over USB and SDIO) see above No

Notes:

  • The Linux wireless wiki page for MediaTek lists "MT7610U ... USB Chip" and "MT7612/MT7602/MT7662 ... PCIe/USB Chip" but does not mention mesh. The rt2800usb page exists but we did not search it for mesh.
  • We did not establish the 5 GHz capability of AR9271-class devices. Do not assume it.
  • Per-chip firmware limits are not covered by driver source.
  • The reader's own check is the one OpenWrt's pages print. The 802.11s page: iw list | grep "Supported interface modes" -A 9, with a sample showing * mesh point. The batman page: iw phy | fgrep mesh, looking for “mesh point” (or “IBSS”). Run it on the Pi with the adapter plugged in before you build anything.

The Raspberry Pi kernel's default configuration for the Pi 4 family (bcm2711_defconfig, branch rpi-6.18.y, read 2026-11-04) enables what a lab needs: CONFIG_BATMAN_ADV=m, CONFIG_MAC80211_MESH=y, CONFIG_ATH9K_HTC=m, CONFIG_MT76x0U=m, CONFIG_MT76x2U=m and CONFIG_RT2800USB=m, along with CONFIG_BRCMFMAC=m. That is the kernel configuration in the repository; it does not prove that a particular Raspberry Pi OS image ships those modules, and we did not check one.

Two ways to build the lab

A wired lab, to learn the protocol. batman-adv does not need Wi-Fi. The OpenWrt batman page says it can run over "multiple point-to-point links, wired or wireless", and the kernel documentation describes it as working on "anything with ethernet-style layer 2". Two kernel-documentation commands attach an Ethernet interface to a batman-adv instance:

ip link add name bat0 type batadv
ip link set dev eth0 master bat0

(Kernel documentation, read 4 November 2026; do this on an interface you are not using to reach the Pi, because it takes the interface out of normal use.) We do not paste the other batctl lines from that page: they use option letters that do not match the batctl manual page.

A Wi-Fi lab, to learn the radio side. Use two or more USB adapters with a mesh-point driver. The batctl manual page's own example block shows the order, once a mesh0 interface exists:

$ batctl meshif bat0 interface create routing_algo BATMAN_IV
$ batctl meshif bat0 orig_interval 5000
$ batctl meshif bat0 distributed_arp_table disable
$ ip link set up dev bat0
$ batctl meshif bat0 neighbors
$ batctl meshif bat0 originators
$ batctl meshif bat0 interface destroy

These are from the manual page for batctl 2026.3-2 (the 2025.4 manual uses the same meshif prefix). We left out the manual's example line that adds the mesh interface to bat0; read its exact form on the manual page. The lines also assume you have already created the mesh interface; this guide does not tell you how to do that on Raspberry Pi OS, because we did not source it. The OpenWrt 802.11s page's configuration is written for OpenWrt, not for a Pi, and that page carries a warning that "This document contains many errors and misconceptions." Treat everything on it as needing a test. See the carrier discussion in Build a batman-adv node on OpenWrt. We have not confirmed that batctl and the iw tools are packaged in Raspberry Pi OS.

What you learn

  • How originator messages and neighbour tables build up: batctl meshif bat0 neighbors and batctl meshif bat0 originators show who sees whom. See batman-adv explained.
  • What a layer 2 mesh looks like from a host: every node appears to be on one Ethernet segment.
  • How the same protocol behaves over a wired link and over an 802.11s link, and why the driver check matters.
  • How the 802.11s layer and the batman-adv layer fit together: the OpenWrt page for batman-adv tells you to turn off 802.11s forwarding (mesh_fwding '0') so batman-adv does the routing.

What it is not

  • It is not a range test. Adapters on a desk in one room tell you nothing about how far a rooftop link reaches.
  • It is not a community network. Nothing here gives you an uplink or gateway; for that, see the gateway section of the OpenWrt guide.
  • It is not a safe place to learn radio rules by accident: adapters transmit, and the UK limits apply to a desk as to a roof.
  • It does not make the Pi a good router. We have no performance numbers for Pis as mesh nodes and give none.
  • It does not prove a driver works. For a deployment, follow Build a batman-adv node on OpenWrt or Build a LibreMesh node, or join an existing network.

UK note

What we could not confirm

  • Which Broadcom or Cypress chip each Pi model carries: the datasheets do not name it.
  • Whether IBSS works on the Pi's onboard Wi-Fi, on any firmware or band.
  • Whether Raspberry Pi OS images ship the modules that the Pi kernel's defconfigs enable.
  • Which retail USB adapters use which chipset, and whether AR9271-class devices work at 5 GHz.
  • The base interface-mode assignment for mt76x0u and mt76x2u; we found only the combination limits.
  • How to create the mesh interface and install the tools on Raspberry Pi OS: we found no sourced procedure.
  • The transmit power of any adapter, and how well a Pi performs as a mesh node.

Sources

  1. Linux kernel: brcmfmac cfg80211.c (mainline master)
  2. Linux kernel: bcm283x-rpi-wifi-bt.dtsi (Pi onboard Wi-Fi on SDIO)
  3. Raspberry Pi kernel, branch rpi-6.18.y: bcm2711_defconfig
  4. Raspberry Pi 4 datasheet (Release 1.1)
  5. Raspberry Pi 3 Model B+ product brief
  6. Raspberry Pi 5 product brief
  7. Raspberry Pi Zero 2 W product brief
  8. Raspberry Pi documentation: configuring networking (GitHub source, master branch)
  9. Linux wireless: ath9k_htc
  10. Linux wireless: MediaTek drivers
  11. Linux wireless: rt2800usb
  12. OpenWrt wiki: batman-adv mesh (archive copy of 2026-02-17; page last modified 2024/06/05)
  13. OpenWrt wiki: 802.11s mesh (archive copy of 2025-03-04; page last modified 2024/09/23)
  14. Linux kernel documentation: batman-adv
  15. batctl manual page (html, v2026.3-2-ge01cdd8)
  16. Ofcom IR 2030 v1.17 (published 23 October 2026)