[solved][BPI-R64] Mesh (802.11s) on internal WiFi card (MT7622AV)

Do you still think that it is not implemented in the driver ?

If not, do you have an idea where I can look into to solve this issue ?

I think driver is missing this part…i don’t know where iw get the information about β€œmesh point”

I see some mesh_point references. Have you added this option?

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/wireless/mediatek/mt76/mt7615/init.c#n234

In main.c mesh seems handled like normal AP

Yes, it is included in the kmod-mac80211 package:

 .config - OpenWrt Configuration
 > Kernel modules > Wireless Drivers > Search (CONFIG_MAC80211_MESH) 
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ Search Results ─────────────────────────────────────────────────────────────────────────────────────────────────────────┐
  β”‚ Symbol: PACKAGE_MAC80211_MESH [=y]                                                                                                                                                                                              β”‚  
  β”‚ Type  : bool                                                                                                                                                                                                                    β”‚  
  β”‚ Defined at tmp/.config-package.in:21883                                                                                                                                                                                         β”‚  
  β”‚   Prompt: Enable 802.11s mesh support                                                                                                                                                                                           β”‚  
  β”‚   Depends on: PACKAGE_kmod-mac80211 [=y]                                                                                                                                                                                        β”‚  
  β”‚   Location:                                                                                                                                                                                                                     β”‚  
  β”‚     -> Kernel modules                                                                                                                                                                                                           β”‚  
  β”‚       -> Wireless Drivers                                                                                                                                                                                                       β”‚  
  β”‚ (1)     -> kmod-mac80211..................... Linux 802.11 Wireless Networking Stack (PACKAGE_kmod-mac80211 [=y])                                                                                                               β”‚  
  β”‚

Mhm,i guess the ifdef i linked above only tells iw that mesh is supported…but i do not see that driver handles mesh anyhow in hardware (set any bit in any hardware register)

I’m sure that the driver has issues with starting a mesh. They don’t send any beacons out. However, I still see ipv6 link local traffic when opening a monitor mode on a different device.

I had the time to debug today and finally wrote my first rfc-upstream-commit. :slight_smile:

https://lore.kernel.org/linux-wireless/[email protected]/T/#u

2 Likes

Mesh works with this?

Congratulation to your fist patch submission :tada:

Small note…Fixes-tag needs to be directly above signed-off

2 Likes

Thanks! It works. You can try it here: https://github.com/openwrt/openwrt/pull/4652

I also updatet there the Patch. I think I will resend it via mailinglist with the correct Fixes: ... position.

1 Like

@frank-w Here it is correct, or? https://github.com/openwrt/openwrt/pull/4652/files#diff-ce1668220610e9a21eba50965aef387a3e87b8475d010ce209f822e6bc884344R27

yes now it’s right…

edit: have now added it to my 5.15-rc tree

1 Like

Nice, I have now increase tx-power. However, without my patch I still have no adhoc network… :wink:

Edit: @frank-w Could you maybe also ACK that on the wireless mailing list?

I cannot test mesh as i use only normal ac (mt7612)/bgn (r2 ap0).

If you give me some advice (hostapd config+how to test if mesh is working) i can test with mt7615 in second r2 + r64 with mt7622 wifi

To test unencrypted mesh you don’t need hostapd nor wpa_supplicant. You can create the mesh interface and join/create network using iw util.

For encrypted mesh (SAE) you do need wpa_supplicant.

hostapd is not used for mesh interfaces at all, unless you want combined Mesh+AP on the same radio, in that case you do need hostapd for the AP part and quite a bit of extra magic (see OpenWrt patches).

can you post the iw commands to create meshpoint and mesh client (connecting my 2 devices) and show commands to verify mesh works?

Can you point me to these openwrt patches?

Here is a good explanation: https://wiki.archlinux.org/title/ad-hoc_networking

iw wlan0 set type ibss
ip link set wlan0 up
iw interface ibss join bpi-mesh 2412

Now you should already see in a scan the other pi.

1 Like

For 802.11s mesh mode it’s similar, just use type mesh instead of of type ibss and mesh join instead of ibss join.

1 Like
root@bpi-r2:~# iw wlp1s0 set type ibss
root@bpi-r2:~# ip link set wlp1s0 up                                                                                                                                                            
RTNETLINK answers: Input/output error
root@bpi-r2:~# dmesg | grep wlp1s0
[   15.208512] mt7615e 0000:01:00.0 wlp1s0: renamed from wlan0
root@bpi-r2:~# uname -a
Linux bpi-r2 5.15.0-rc4-bpi-r2 #1 SMP Sat Oct 16 20:43:57 CEST 2021 armv7l GNU/Linux

with patch

I think you probably have already an instance of wpa_supplicant running (usually this happens when people forget that NetworkManager takes care of all their interfaces and they will either have to stop NetworkManager or use NetworkManager for all configuration…)

Do you try to do this with banana pi r2? I thought it has a different wifi card?

It is my r2,using mt7615 card.but not interal wifi (ap0)

and no wpa_supplicant/ hostapd running…but network-config done with systemd

tried stopping it, but error comes again

root@bpi-r2:~# service systemd-networkd stop
Warning: Stopping systemd-networkd.service, but it can still be activated by:
  systemd-networkd.socket
root@bpi-r2:~# iw wlp1s0 set type ibss
root@bpi-r2:~# ip link set wlp1s0 up
RTNETLINK answers: Input/output error
root@bpi-r2:~#

maybe i need to set ip address first?

edit: wpa_supplicant is not installed in my (nearly fresh) bullseye image, hostapd is installed, but not running. i got the same error without the patch…so at least not related to the patch…