Hostapd: wlan0: AP-STA-DISCONNECTED when there has been activity

I am seeing regular disconnections from one particular ESP8266 device (WEMOS D1 Mini) running ESPHome. Fixed IP. The ESPHome is setup to use the Home Assistant API, but it also posts to a separate MQTT topic. I can see the data published at a 60s interval and there is no loss of data. The time between disconnection is irregular but always measured in minutes.

Firmware: OpenWrt 18.06.5 r7897-9d401013fc / LuCI openwrt-18.06 branch (git-19.309.48729-bc17ef6)

I have the "Disassociate On Low Acknowledgement" setting un-ticked.

Is there anything else I could do to prevent this?

I am not ruling out an issue with ESPHome, but I thought I'd start here.

Fri Jan 24 07:32:48 2020 daemon.info hostapd: wlan0: STA xx:xx:xx:4a:0a:a3 IEEE 802.11: authenticated
Fri Jan 24 07:32:48 2020 daemon.info hostapd: wlan0: STA xx:xx:xx:4a:0a:a3 IEEE 802.11: associated (aid 15)
Fri Jan 24 07:32:48 2020 daemon.notice hostapd: wlan0: AP-STA-CONNECTED xx:xx:xx:4a:0a:a3
Fri Jan 24 07:32:48 2020 daemon.info hostapd: wlan0: STA xx:xx:xx:4a:0a:a3 WPA: pairwise key handshake completed (RSN)
Fri Jan 24 07:40:58 2020 daemon.notice hostapd: wlan0: AP-STA-DISCONNECTED xx:xx:xx:4a:0a:a3
Fri Jan 24 07:40:58 2020 daemon.info hostapd: wlan0: STA xx:xx:xx:4a:0a:a3 IEEE 802.11: disassociated
Fri Jan 24 07:40:58 2020 daemon.info hostapd: wlan0: STA xx:xx:xx:4a:0a:a3 IEEE 802.11: disassociated
Fri Jan 24 07:40:58 2020 daemon.info hostapd: wlan0: STA xx:xx:xx:4a:0a:a3 IEEE 802.11: disassociated
Fri Jan 24 07:40:58 2020 daemon.info hostapd: wlan0: STA xx:xx:xx:4a:0a:a3 IEEE 802.11: disassociated
Fri Jan 24 07:40:58 2020 daemon.info hostapd: wlan0: STA xx:xx:xx:4a:0a:a3 IEEE 802.11: disassociated
Fri Jan 24 07:40:58 2020 daemon.info hostapd: wlan0: STA xx:xx:xx:4a:0a:a3 IEEE 802.11: disassociated
Fri Jan 24 07:40:58 2020 daemon.info hostapd: wlan0: STA xx:xx:xx:4a:0a:a3 IEEE 802.11: disassociated
Fri Jan 24 07:40:59 2020 daemon.info hostapd: wlan0: STA xx:xx:xx:4a:0a:a3 IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)
Fri Jan 24 07:41:05 2020 daemon.info hostapd: wlan0: STA xx:xx:xx:4a:0a:a3 IEEE 802.11: authenticated
Fri Jan 24 07:41:05 2020 daemon.info hostapd: wlan0: STA xx:xx:xx:4a:0a:a3 IEEE 802.11: associated (aid 15)

My two cents:

  • What router do you own? Some are notorious for having issues with ESP devices.

  • Could the device be disconnecting on purpose, to save electricity?

Model GL-MT300N-V2
Architecture MediaTek MT7628AN ver:1 eco:2

one of these, but flashed with 'virgin' OpenWrt.

I doubt it, and it is not set up to do so.