Mesh network on raspberry pi 4

Dear comrades, welcome! Please tell me how to organize a mesh network on several raspberry pi 4, which is installed Openwrt? Below is a diagram, approximately, on which we would like to implement a mesh network. 1. This is the first raspberry pi 4 that will accept the Internet, and is also networked with other, 3,4 and 5 raspberry pi 4 and all this over a wireless network. That is, roughly speaking, the first device is the head device. Do you have any instructions on how to do this? Is there anyone who managed to implement a similar one, namely on the raspberry pi 4? Please give me some advice, I really need it. Thank you very much.

You want them all to be on the same IP network, or to route between them? You want to do this over the wifi interface? The devices will be mobile or you can rely on those dashed links to be statically configured? What is the distance between these? What objects between them? Is this all within a single building, across between buildings? In an open warehouse, or office? This is connecting to the internet or to a private network, with WAN being also private? Can you get by with IPv6 only and maybe run NAT64 on node 1?

Need more info.

1 Like

I think they should all be on the same network

It turns out that I connect as a client to the WiFi network and the client has the Internet.

What devices are you talking about, those that will connect (clients) or those that are configured as access points?

no more than 10-15 meters

it's on the same floor in an open area


No, I need IPv4

It sounds to me like you want node 2,3,4 to be RPis connected to node 1 via onboard WiFi, and also providing an AP functionality to some roaming laptops and phones etc throughout the space. Is that about right?

The problem is that the wifi hardware on the RPi 4 supports: (from iw list)

	Supported interface modes:
		 * IBSS
		 * managed
		 * AP
		 * P2P-client
		 * P2P-GO
		 * P2P-device


        valid interface combinations:
                 * #{ managed } <= 1, #{ P2P-device } <= 1, #{ P2P-client, P2P-GO } <= 1,
                   total <= 3, #channels <= 2
                 * #{ managed } <= 1, #{ AP } <= 1, #{ P2P-client } <= 1, #{ P2P-device } <= 1,
                   total <= 4, #channels <= 1

So it doesn't support 802.11s meshing... it does support some other modes that are somewhat interesting... But I think you might be best off using an IBSS (ad-hoc) network. But I'm not clear on whether you can support ad-hoc together with AP on this hardware. The basic idea though would be to use ad-hoc as the back end and managed to provide the network access points for the laptops etc that are around.

Nevertheless, if an RPi can talk to node 1, then it's likely that so can the laptop... the only place you're likely extending your range doing this is in the vicinity of node 3... farthest from node 1. Can you really not just run a wire from 1 to 3? you'll get the same coverage, and you can use proper high quality antenna access points and much better performance.

Basically I don't see this providing anything like the benefit you are probably imagining.

Yes, you understand me correctly.

strange, I saw the 802.11 s option in the Openwrt settings

no, only WiFi connection

it turns out that I need additional WiFi equipment on Rpi, in order to distribute WiFi? when is the main WiFi that is on the Board only used for connecting the mesh network?

Well, as I infer that the APs will be stationary, I think WDS would be just fine.

Having said so, with the distance given, I estimate the furthest clinet with be with 25 to 30m from the first Pi, so you could probably do with just that Pi. You could try that and if it doesn't do well then you could try WDS.

I don't know about Raspberry Pi in particular, but in other routers running OpenWrt you can do WDS with one radio.

But again, if it's an open space, try with 1 Pi first and see if the speed is good enough.

So, you aren't going to get an 802.11s mesh, that is, a mesh using official WiFi meshing. What you might be able to get is a mesh created by some software running on the RPi that uses the AdHoc mode to talk with the other nodes. AdHoc is basically just "anyone can talk to anyone", so the store and forward meshing stuff needs to come from some software on top of that. It seems that the BATMAN packages are explicitly for this purpose.

On the other hand, you should be aware that the physical limitations of the RPi built in wireless are significant. The antenna on this thing is tiny, and antennas are an area where size and design/type matter a LOT.

If I had the task of distributing wifi over a large open space without long wires, I'd start by looking at a point-to-point radio link, and a regular access point.

something like this:

                                                Access Point
WAN --RTR-- PointToPoint   )))   )))      (((   ((( Point To Point
    Access Point

The point-to-point link gets your network to the far end of your space, and then access points at the two ends of the space give the coverage.

This basically means buying a pair of point to point radios, and a pair of standard access points, probably with 1 RPi4 at the spot labeled RTR acting as a wired router.

I'd look at the TP-link EAP series access point, a little cheaper than the Ubiquiti and they have a stand-alone mode without a controller. Or use an OpenWrt capable wireless router. But something with good antennas.

For the point to point mode, I think Ubiquiti nanostation

Note that this will give you dramatically better performance than mesh, particularly when the stations are stationary. Mesh really helps when you need to move devices around and they can come-and-go.

If you insist on doing mesh, I'd look at different hardware, something with some real antennas and that supports 802.11s meshing.

RPi 4 for the router is definitely the way to go though.

By the way, Raspberry Pi 4, 2GB model price was reduced to $35.


Were you able to progress on your planned implementation of a Mesh on Raspberry Pi 4?

I am looking for a similar solution and would appreciate some inputs.


1 Like

Sorry for the long answer, I was not able to implement my plan, now I'm looking for a suitable wi-fi adapter that will support 802.11 s and will work on openwrt

I am also looking to work the solution,
RPI4 as main router and Pizero W as satellite nodes.
I strongly believe it should work.

  1. 802.11s is L2 layer protocol it now supported in linux kernel not dependent of wifi driver or radio.
  2. openwrt doesn't use 802.11s it uses BATMAN Protocol.
  3. All the mesh wifi solutions sold in market have single wifi radio.

Raspberry pi 4 and in general all pi's don't have 802.11s support. This support has to be present in the kernel driver on openwrt..
By choice Broadcom wifi driver is closed sourced. you can't even modify it.. only way to support mesh is via ibss and batcl... here is a decent link...