Troubleshooting dumb AP on Mochabin

Hello,
I am running OpenWrt on Mochabin with the QCA6391 wifi card as dumb AP. As a router/switch combo I am using Mikrotik CCR2004-16G-2S+.
The wireless setup works mostly fine, but has some strange behaviors for a couple of devices (out of 20-25 STAs). For example my phone Pixel 7a has several connection issues during the day - receives IP address, but then the connection timeouts, has long ping times (about 2-5 times more than other devices).
The only "obvious" thing I found in the syslog was the frequent disconnection/connection of the device:

Wed Dec 18 08:32:56 2024 daemon.notice hostapd: phy0-ap0: AP-STA-DISCONNECTED MAC_ADD
Wed Dec 18 08:32:57 2024 daemon.info hostapd: phy0-ap0: STA 32:85:f0:89:6e:e0 IEEE 802.11: authenticated
Wed Dec 18 08:32:57 2024 daemon.info hostapd: phy0-ap0: STA 32:85:f0:89:6e:e0 IEEE 802.11: associated (aid 8)
Wed Dec 18 08:32:57 2024 daemon.notice hostapd: phy0-ap0: AP-STA-CONNECTED MAC_ADD auth_alg=open
Wed Dec 18 08:32:57 2024 daemon.info hostapd: phy0-ap0: STA MAC_ADD RADIUS: starting accounting session 55B82FD3F2500EFF
Wed Dec 18 08:32:57 2024 daemon.info hostapd: phy0-ap0: STA MAC_ADD WPA: pairwise key handshake completed (RSN)
Wed Dec 18 08:32:57 2024 daemon.notice hostapd: phy0-ap0: EAPOL-4WAY-HS-COMPLETED MAC_ADD
Wed Dec 18 08:34:09 2024 daemon.notice hostapd: phy0-ap0: AP-STA-DISCONNECTED MAC_ADD
Wed Dec 18 08:34:15 2024 daemon.info hostapd: phy0-ap0: STA MAC_ADD IEEE 802.11: authenticated
Wed Dec 18 08:34:15 2024 daemon.info hostapd: phy0-ap0: STA MAC_ADD IEEE 802.11: associated (aid 8)
Wed Dec 18 08:34:15 2024 daemon.notice hostapd: phy0-ap0: AP-STA-CONNECTED MAC_ADD auth_alg=open
Wed Dec 18 08:34:15 2024 daemon.info hostapd: phy0-ap0: STA MAC_ADD RADIUS: starting accounting session B74474C819D0D820
Wed Dec 18 08:34:15 2024 daemon.info hostapd: phy0-ap0: STA MAC_ADD WPA: pairwise key handshake completed (RSN)
Wed Dec 18 08:34:15 2024 daemon.notice hostapd: phy0-ap0: EAPOL-4WAY-HS-COMPLETED MAC_ADD

Any ideas what to look for? What tool to use to start investigating? Does it look like an issue of the AP or Mikrotik configuration (wired connection is fine, so is most of the wireless...)?
Thanks for any ideas or suggestions.

Best bet is to look at the config.

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board
cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall

Thank you for your suggestions. Here are the outputs:

root@Mochabin:~# ubus call system board
{
	"kernel": "6.6.60",
	"hostname": "Mochabin",
	"system": "ARMv8 Processor rev 1",
	"model": "Globalscale MOCHAbin",
	"board_name": "globalscale,mochabin",
	"rootfs_type": "ext4",
	"release": {
		"distribution": "OpenWrt",
		"version": "SNAPSHOT",
		"revision": "r28085-6720c4ccba",
		"target": "mvebu/cortexa72",
		"description": "OpenWrt SNAPSHOT r28085-6720c4ccba",
		"builddate": "1731585818"
	}
}

Yes, its a snaphot build - I tried to update to newer linux firmware to hopefully solve the issues. But the same issues happened even on stable branch.

root@Mochabin:~# cat /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 'fdb5:40a7:db87::/48'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0'
	list ports 'eth2'
	list ports 'lan0'
	list ports 'lan1'
	list ports 'lan2'
	list ports 'lan3'
	option vlan_filtering '1'

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ipaddr '10.0.0.3'
	option gateway '10.0.0.1'
	list dns '1.0.0.1'
	list dns '1.1.1.1'

config device
	option name 'phy0-ap0'
	option ipv6 '0'
root@Mochabin:~# cat /etc/config/wireless

config wifi-device 'radio0'
	option type 'mac80211'
	option path 'cp0/f2640000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0'
	option cell_density '0'
	option band '2g'
	option htmode 'HE20'
	option channel 'auto'
	option country 'CZ'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option encryption 'psk2'
	option key 'PASS'
	option ssid 'SSID'
	option disassoc_low_ack '0'
	option skip_inactivity_poll '1'
root@Mochabin:~# cat /etc/config/dhcp

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'
	option dhcpv4 'server'
	option ignore '1'

config odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '4'

config dnsmasq 'DNS'
root@Mochabin:~# cat /etc/config/firewall

config defaults
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'REJECT'
	option synflood_protect '1'

Try installing 23.05.5 stable and reset to defaults during the upgrade process.

Then, set your ip address info, disable dhcp, and enable WiFi (set country code, set ssid l, encryption type, passphrase, and enable). Don’t make any other changes.

Test that and see if you have any issues. And if so, please post that new config (which should be closer to defaults)

My device started to work flawlessly at first, but once more devices connected, the issues came back again.

root@OpenWrt:~# ubus call system board
{
	"kernel": "5.15.167",
	"hostname": "OpenWrt",
	"system": "ARMv8 Processor rev 1",
	"model": "Globalscale MOCHAbin",
	"board_name": "globalscale,mochabin",
	"rootfs_type": "ext4",
	"release": {
		"distribution": "OpenWrt",
		"version": "23.05.5",
		"revision": "r24106-10cc5fcd00",
		"target": "mvebu/cortexa72",
		"description": "OpenWrt 23.05.5 r24106-10cc5fcd00"
	}
}
root@OpenWrt:~# cat /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 'fd62:9510:3476::/48'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'lan0'
	list ports 'lan1'
	list ports 'lan2'
	list ports 'lan3'

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option ipaddr '10.0.0.3'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option dns '10.0.0.1'
	option gateway '10.0.0.1'

config device
	option name 'br-wan'
	option type 'bridge'
	list ports 'eth0'
	list ports 'eth2'

config interface 'wan'
	option device 'br-wan'
	option proto 'dhcp'

config interface 'wan6'
	option device 'br-wan'
	option proto 'dhcpv6'
root@OpenWrt:~# cat /etc/config/wireless

config wifi-device 'radio0'
	option type 'mac80211'
	option path 'cp0/f2640000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0'
	option channel 'auto'
	option band '2g'
	option htmode 'HE80'
	option cell_density '0'
	option country 'CZ'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option ssid 'SSID'
	option encryption 'psk2'
	option key 'PASS'

root@OpenWrt:~# cat /etc/config/dhcp

config dnsmasq
	option domainneeded '1'
	option boguspriv '1'
	option filterwin2k '0'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'lan'
	option expandhosts '1'
	option nonegcache '0'
	option cachesize '1000'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
	option nonwildcard '1'
	option localservice '1'
	option ednspacket_max '1232'
	option filter_aaaa '0'
	option filter_a '0'

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'
	option dhcpv4 'server'
	option dhcpv6 'server'
	option ra 'server'
	list ra_flags 'managed-config'
	list ra_flags 'other-config'
	option ignore '1'

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'

config odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '4'
root@OpenWrt:~# cat /etc/config/firewall
config defaults
	option syn_flood	1
	option input		REJECT
	option output		ACCEPT
	option forward		REJECT
# Uncomment this line to disable ipv6 rules
#	option disable_ipv6	1

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		1
	option mtu_fix		1

config forwarding
	option src		lan
	option dest		wan

# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
	option name		Allow-DHCP-Renew
	option src		wan
	option proto		udp
	option dest_port	68
	option target		ACCEPT
	option family		ipv4

# Allow IPv4 ping
config rule
	option name		Allow-Ping
	option src		wan
	option proto		icmp
	option icmp_type	echo-request
	option family		ipv4
	option target		ACCEPT

config rule
	option name		Allow-IGMP
	option src		wan
	option proto		igmp
	option family		ipv4
	option target		ACCEPT

# Allow DHCPv6 replies
# see https://github.com/openwrt/openwrt/issues/5066
config rule
	option name		Allow-DHCPv6
	option src		wan
	option proto		udp
	option dest_port	546
	option family		ipv6
	option target		ACCEPT

config rule
	option name		Allow-MLD
	option src		wan
	option proto		icmp
	option src_ip		fe80::/10
	list icmp_type		'130/0'
	list icmp_type		'131/0'
	list icmp_type		'132/0'
	list icmp_type		'143/0'
	option family		ipv6
	option target		ACCEPT

# Allow essential incoming IPv6 ICMP traffic
config rule
	option name		Allow-ICMPv6-Input
	option src		wan
	option proto	icmp
	list icmp_type		echo-request
	list icmp_type		echo-reply
	list icmp_type		destination-unreachable
	list icmp_type		packet-too-big
	list icmp_type		time-exceeded
	list icmp_type		bad-header
	list icmp_type		unknown-header-type
	list icmp_type		router-solicitation
	list icmp_type		neighbour-solicitation
	list icmp_type		router-advertisement
	list icmp_type		neighbour-advertisement
	option limit		1000/sec
	option family		ipv6
	option target		ACCEPT

# Allow essential forwarded IPv6 ICMP traffic
config rule
	option name		Allow-ICMPv6-Forward
	option src		wan
	option dest		*
	option proto		icmp
	list icmp_type		echo-request
	list icmp_type		echo-reply
	list icmp_type		destination-unreachable
	list icmp_type		packet-too-big
	list icmp_type		time-exceeded
	list icmp_type		bad-header
	list icmp_type		unknown-header-type
	option limit		1000/sec
	option family		ipv6
	option target		ACCEPT

config rule
	option name		Allow-IPSec-ESP
	option src		wan
	option dest		lan
	option proto		esp
	option target		ACCEPT

config rule
	option name		Allow-ISAKMP
	option src		wan
	option dest		lan
	option dest_port	500
	option proto		udp
	option target		ACCEPT


### EXAMPLE CONFIG SECTIONS
# do not allow a specific ip to access wan
#config rule
#	option src		lan
#	option src_ip	192.168.45.2
#	option dest		wan
#	option proto	tcp
#	option target	REJECT

# block a specific mac on wan
#config rule
#	option dest		wan
#	option src_mac	00:11:22:33:44:66
#	option target	REJECT

# block incoming ICMP traffic on a zone
#config rule
#	option src		lan
#	option proto	ICMP
#	option target	DROP

# port redirect port coming in on wan to lan
#config redirect
#	option src			wan
#	option src_dport	80
#	option dest			lan
#	option dest_ip		192.168.16.235
#	option dest_port	80
#	option proto		tcp

# port redirect of remapped ssh port (22001) on wan
#config redirect
#	option src		wan
#	option src_dport	22001
#	option dest		lan
#	option dest_port	22
#	option proto		tcp

### FULL CONFIG SECTIONS
#config rule
#	option src		lan
#	option src_ip	192.168.45.2
#	option src_mac	00:11:22:33:44:55
#	option src_port	80
#	option dest		wan
#	option dest_ip	194.25.2.129
#	option dest_port	120
#	option proto	tcp
#	option target	REJECT

#config redirect
#	option src		lan
#	option src_ip	192.168.45.2
#	option src_mac	00:11:22:33:44:55
#	option src_port		1024
#	option src_dport	80
#	option dest_ip	194.25.2.129
#	option dest_port	120
#	option proto	tcp

Did some testing with the default configuration as you suggested. When switching mode to 802.11N, the connectivity issues are gone, but so as higher bitrate... :frowning:

Use 40MHz channel width for the 2G radio.