Closed groove-max closed 1 year ago
Maybe something is trying to use it in STA mode at the same time you're trying to switch it to AP?
I did solve my problem! When AP mode is started for the first time, uninitialized variables are used, as a result of which the timer is not set correctly. I think it's a bug in the driver code. Here is the solution:
diff -urpN a/esp_mac80211.c b/esp_mac80211.c
--- a/esp_mac80211.c 2022-12-09 19:03:25.162009469 -0500
+++ b/esp_mac80211.c 2022-12-09 19:04:44.126865097 -0500
@@ -488,6 +488,8 @@ static void init_beacon_timer(struct iee
ESP_IEEE80211_DBG(ESP_DBG_OP, " %s enter: beacon interval %x\n", __func__, evif->beacon_interval);
beacon_tim_init();
+ cycle_beacon_count = 1;
+ init_jiffies = jiffies;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28))
evif->beacon_timer.expires = init_jiffies + msecs_to_jiffies(cycle_beacon_count * vif->bss_conf.beacon_int*1024/1000);
#else
@@ -495,8 +497,6 @@ static void init_beacon_timer(struct iee
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
init_timer(&evif->beacon_timer); //TBD, not init here...
- cycle_beacon_count = 1;
- init_jiffies = jiffies;
evif->beacon_timer.data = (unsigned long) vif;
evif->beacon_timer.function = drv_handle_beacon;
#else
Ooh. Good catch! I'll test it out and merge it in the next few days.
Thank you!
After a couple of months of distractions. applied your patch and am cutting a release now. Thanks for your contribution!
Hi! Using 5.17.15 mainline kernel with Allwinner V3s custom board. Last month I used esp8089 as AP client connected to my home router without any problem. But yesterday I had to switch to AP node and got strange issue: AP needs to start about 300 secs after reboot. I tried to switch between wpa_supplicant and hostapd and the problem is still persist in any case. There are no any messages or warnings in log. The only thing i noticed that I got beacon length:%d,fc:0x%x messages appear after ~300 secs. After this, if I run "ifdown wlan0" and then "ifup wlan0" AP starts immediately. Does anybody have any ideas?