Hi, after upgrade of Unifi AP to latest Lede from stock firmware wireless performance of the AP is very poor which means that maximum speed is approx. 20Mbps both both upload and download. I have also tested older OpenWrt package and development version of Lede, all have the same issue.
I have configured N mode, 40MHz channel but clients are reported to use 20MHz channels only. Maximum speed shown is more than 54 Mbps but I can't reach it...
Does not matter if I'm right under AP or meters away...
Getting 20 Mbps throughput on a 54-Mbps carrier in the real world is actually pretty good.
Do you really have a 54-Mbps connection, or is that just the "theoretical maximum" that 802.11g can accomplish? What does the output of iw dev <your_dev> station dump or LuCI show for the clients?
Assuming your hardware, firmware, and driver permit it, if you're not getting channel bonding for 40-MHz channels, that it likely due to other wireless users or services. The protocol will only use 40-MHz channels when there is little or no signal on the adjacent channel.
Use 802.11n mode (assuming all your clients support it)
Set require_mode to n
Disable legacy_rates
Use psk2+ccmp if your clients support it, as TKIP is "known insecure" and deprecated for many years now
You might see some gains, but getting anywhere near close to the carrier rate pretty much requires the best of clients, as well as "laboratory" conditions.
If you're running multiple SSIDs, and/or you can convince your neighbors to cooperate, "beacon pollution" may be some of the issue. See https://r1ch.net/blog/wifi-beacon-pollution