I've decided to build a mesh network using Raspberry Pi 4 devices.
I have 4 Raspberry Pi 4 units, each with a TP-Link TL-WN721N Wi-Fi adapter connected via USB.
Here's what I've done:
- Removed the
wpad-mbedtls
package. - Installed the
wpad-mesh-openssl
package. - Installed the full driver package for the Wi-Fi adapter:
ath9k-htc-firmware
kmod-ath9k
kmod-ath9k-common
kmod-ath9k-htc
That's all regarding the software setup.
Next, I proceeded to configure the mesh network itself.
- My wireless configuration:
/etc/config/wireless
config wifi-device 'radio1'
option type 'mac80211'
option path 'scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.1/1-1.1:1.0'
option channel '13'
option band '2g'
option cell_density '0'
config wifi-iface 'wifinet0'
option device 'radio1'
option mode 'mesh'
option mesh_fwding '1'
option encryption 'sae'
option mesh_id 'mymeshvini'
option mesh_fwding '1'
option mesh_rssi_threshold '0'
option network 'lan'
option key '123456789'
- My network configuration:
/etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd68:861a:cb06::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0'
config interface 'lan'
option device 'br-lan'
option proto 'dhcp'
- My firewall configuration:
/etc/config/firewall
config zone
option name lan
list network 'lan'
option input ACCEPT
option output ACCEPT
option forward ACCEPT
config zone
option name wan
list network 'wan'
list network 'wan6'
option input REJECT
option output ACCEPT
option forward REJECT
option masq 0
option mtu_fix 0
When the devices are arranged as shown in Picture 1, all devices are within direct line of sight. They can all see each other, and I can connect to each of them via SSH from my laptop, and so on.
However, when I simulate the situation shown in Picture 2, Rpi_1 (acting as the gateway) doesn't see Rpi_3 and Rpi_4 through Rpi_2. But Rpi_2 sees Rpi_3 and Rpi_4.
If I place each of them at maximum distance in a line, it looks like this:
Rpi_1 ---- Rpi_2 ---- Rpi_3 ---- Rpi_4
- Rpi_1 only sees Rpi_2
- Rpi_2 sees Rpi_1 and Rpi_3
- Rpi_3 sees Rpi_2 and Rpi_4
- Rpi_4 only sees Rpi_3
I can't figure out what the problem is. Where did I misconfigure something? Please advise what I need to do to make the mesh network work as shown in Picture 2, so that I can access Rpi_4 from my laptop.
Additional Information:
- I'm aiming for a fully connected mesh network where data can be relayed through intermediary nodes.
- From Rpi_1, I want to be able to communicate with Rpi_4 even if they are not in direct range, using Rpi_2 and Rpi_3 as intermediate nodes.
Any help or guidance would be greatly appreciated!