yun can not connect to my wifi access point

My yun has been connected to my access point and all of a sudden disappeared from the network.
Investigation leads to the log file of my wifi access point which shows numerous times a section like this

May 15 21:31:30 ENS202EXT daemon.info hostapd: ath0: STA 90:a2:da:f2:10:c1 IEEE 802.11: disassociated
May 15 21:31:30 ENS202EXT daemon.info hostapd: ath0: STA 90:a2:da:f2:10:c1 IEEE 802.11: deauthenticated due to local deauth request
May 15 21:31:29 ENS202EXT daemon.info hostapd: ath0: STA 90:a2:da:f2:10:c1 WPA: received EAPOL-Key 2/4 Pairwise with unexpected replay counter
May 15 21:31:29 ENS202EXT daemon.info hostapd: ath0: STA 90:a2:da:f2:10:c1 WPA: received EAPOL-Key 2/4 Pairwise with unexpected replay counter
May 15 21:31:28 ENS202EXT daemon.info hostapd: ath0: STA 90:a2:da:f2:10:c1 IEEE 802.11: associated
May 15 21:31:27 ENS202EXT daemon.info hostapd: ath0: STA 90:a2:da:f2:10:c1 IEEE 802.11: associated
May 15 21:31:26 ENS202EXT daemon.info hostapd: ath0: STA 90:a2:da:f2:10:c1 IEEE 802.11: disassociated]

Rebooting the wifi accesspoint did not help.
The wifi accesspoint runs a openwrt flovour like the yun.
From what I understood it looks like the yun sends the command 2 times.
I'm not sure why it got disassociated in the first place.

Anyone has a clue on how to fix this issue?

Best regards
Jantje

PS: I have removed the wifi-live-or-reset so the request keep comming from a non rebooted yun

Is your Yun currently connected to your AP?
Is it connected now?
If so, what is the IP?

Jesse

Jess thanks for the feedback.
Rebooting yun fixes the issue. But then after a couple of hours running the problem happens again.
The ip adress is assigned by a dhcp server on the network (not the wifi AP) so I would assume it is not relevant.
The yun is currently connected and has ip 192.168.1.191. I expect it to start failing in about 4 hours.

Some more wifi config info.
I had mac address security on (access list) and turned it off to no avail.
I had "Group Key Update Interval" set but disabled it yesterday evening.
I have WPA AES encryption enabled
Wireless mode 802.11 B/G/N mixed
Channel HT mode 20/40 MH
Channel frequency is on auto

Best regards
Jantje

Every 4 hour, might be DHCP lease time?

Change wifi dhcp client get ip from router ip pool to static ip:

http://forum.arduino.cc/index.php?topic=319496.msg2235823#msg2235823

@Jantje,

SonnyYu's suggestion is the mostly likely issue - given the repeatable nature of the issue.
In the meantime, I am working on several wifi utilities for the Yun.

Jesse

It is not every 4 hours.
The yun has been running for 28062295 millis (nearly 8 hours) now without the problem.
Lets hope it stays that way.
Jantje

My robot has been down some days for some other reasons.
In the mean time I changed following settings on my AP
-> removed mac address filtering
-> disabled "group key update"
I'm running WPA2-PSK AES
Yesterday the problem happened again.
I tried rebooting my WIFI access point. That did not fix the problem and the same loggings started to appear.
Restarting yun does fix the issue.

my router is set to autochannel. I'll change this to a fixed channel now for testing.

I just went through the settings again and I wondered tat maybe this is a dhcp related issue.
So I also disabled

This is the only DHCP in the local network

and set

Maximum allowed number of active DHCP leases

to 0

Anyone has a good way to make sure yun does not work as a dhcp server?

http://forum.arduino.cc/index.php?topic=319496.msg2235823#msg2235823

Change wifi dhcp client get ip from router ip pool to static ip

@sonnyyu
Thanks for the input.
I do not want to have my yun on a static ip address. I only want to disable the dhcp server on the yun as it will conflict with my standard dhcp server.
I'm not sure it is related to the issue at hand but I noticed this while investigating and it is obviously wrong in my network configuration.
FYI Testing with a static IP address is on the agenda.

/etc/init.d/dnsmasq disable
/etc/init.d/dnsmasq stop

or

uci set dhcp.lan.ignore=1
uci commit dhcp
/etc/init.d/dnsmasq restart

@sonnyyu
txs.
I have been reading up a bit on dnsmasq. I do not quite understand why you would want this by default in an arduino context.
Am I missing something?
Best regards
Jantje

@Jantje,
since your are disableing DHCP you don't need that part, and since you are not using the Yun to access any Internet resources, there is no harm in disabling dnsmasq.
Jesse