Wifi client won't reconnect after channel switch

code4sex
Posts: 20
Joined: Tue Mar 16, 2021 12:23 pm

Wifi client won't reconnect after channel switch

Postby code4sex » Thu Aug 15, 2024 12:40 pm

INTRO:
I'm working on the custom prototype WiFi device with a reference to "esp32_hardware_design_guidelines_en.pdf" notes.
At the moment, I don't have the pcb antenna connected to the device properly (C15-L4-C14 missing) since the impendance match work is still in progress. However, I tried to go without antenna on a short distance (~20 cm) and still got the device working well.

SETUP:
ESP32 D0WD + (IDF 5.0.1) + wifi_country_t ("JP", ch1 ... ch14, tx_power 80, WIFI_COUNTRY_POLICY_MANUAL or WIFI_COUNTRY_POLICY_AUTO (both options tried)).

STEPS:
- ESP32 operates in SoftAP mode and starts "My_AP" (ch=6)
- client (Win10 laptop) joins "My_AP"
- ESP32 switches to APSTA mode
- ESP32 STA connects to "Neighbour_AP" (ch=12) run on Xiaomi 13T Pro
- naturally, channel switch takes place and ESP32 AP moves from ch=6 to ch=12
- client leaves "My_AP" and I'm always getting three WIFI_EVENT_AP_STADISCONNECTED events one by one:
>> Client left, AID=1, time connected, sec: 37
>> Client left, AID=1, time connected, sec: 37
>> Client left, AID=1, time connected, sec: 38
- ... client never returns

Everything works fine if no channel switch takes place (both channels match).
I can't figure out why my client does not get back...

TO CONSIDER:
The previous prototype run on WROVER kit on IDF 4.4.2 and I don't remember such problems. Yes, client also left after the channel switch but it reconnected back in a while.

POSSIBLE REASON:
Is it a chunked antenna or IDF 5.0.1 issue?

Any ideas to cure this issue highy appreciated!

Also, I'd like to learn how to perform a prior channel switch (before connecting to another AP) without losing a connected client...

aliarifat794
Posts: 172
Joined: Sun Jun 23, 2024 6:18 pm

Re: Wifi client won't reconnect after channel switch

Postby aliarifat794 » Thu Aug 15, 2024 3:49 pm

The missing components in your antenna circuit (C15-L4-C14) are crucial for impedance matching. It affects signal strength and stability. While your device is working at close range, the absence of a properly tuned antenna can lead to unpredictable behaviour.

code4sex
Posts: 20
Joined: Tue Mar 16, 2021 12:23 pm

Re: Wifi client won't reconnect after channel switch

Postby code4sex » Fri Aug 16, 2024 8:06 am

OK, thank you for the reply.
Impendance matching is almost done. Will keep you updated you on the test results.

code4sex
Posts: 20
Joined: Tue Mar 16, 2021 12:23 pm

Re: Wifi client won't reconnect after channel switch

Postby code4sex » Fri Aug 16, 2024 8:24 am

(1) This is the intial setup with a detached antenna and no chips (very poor SWR) - this is the version the firmware was tested with client drop off:

01.jpg
01.jpg (299.2 KiB) Viewed 928 times

(2) Only C15 added (SWR much better) - firmware not tested yet:

02.jpg
02.jpg (298.18 KiB) Viewed 928 times

(3) Some antenna cutting and C15 (the best SWR obtained):

03.jpg
03.jpg (295.84 KiB) Viewed 928 times

In all cases L4 and C16 were removed from pcb.

code4sex
Posts: 20
Joined: Tue Mar 16, 2021 12:23 pm

Re: Wifi client won't reconnect after channel switch

Postby code4sex » Sun Aug 18, 2024 10:15 pm

NEWS:

I ported my firmware to WROOM-32 dev board and run several tests. The table below shows the results:
- "NO" stands for the client leaving and not returning after channel switch
- "YES" stands for transparent channel change without getting WIFI_EVENT_AP_STADISCONNECTED event.

The laptop I used is equipped with Qualcomm QCA9377 802.11ac Wireless Adapter.
tests.jpg
tests.jpg (173.88 KiB) Viewed 662 times
It follows that:

(a) antenna has nothing to do with the channel switching problem
(b) looks like there's smth special about IDF wifi stack internals and hardware

Espressif, please help with this issue.

Who is online

Users browsing this forum: Baidu [Spider] and 295 guests