roleoroleo / yi-hack-Allwinner

Custom firmware for Yi 1080p camera based on Allwinner platform
MIT License
437 stars 66 forks source link

Wi-Fi issues (multiple SSID?) #375

Closed andriej closed 1 month ago

andriej commented 1 year ago

I have latest firmware on my cams and strange situation.

In garage and base floor when they were placed - cameras are not connecting to WiFi anymore. They are working as I can hear IR switching on/off depending on light.

When I took them away for debugging - they are connecting with no issues.

Both of cameras are near 2 new APs which are WiFi6/AX (but with WPA2, no WPA3 enabled). They are connecting to 3rd new AP which is also WiFi6/AX (same WPA2 pass). All AP have same SSID and 802.11r turned on.

Has anyone else got same issues? How to avoid it? I did not change SSID or password when migrating from WiFi 5, all other IoTs connect with no issues (no single device have issues except cameras lost).

roleoroleo commented 1 year ago

Are you sure thaht 2.4 GHz is enabled?

andriej commented 1 year ago

100%, most of my esphome devices run on that network (and only mostly phones and laptop on 5GHz)

roleoroleo commented 1 year ago

Never seen anything like this.

andriej commented 1 year ago

Do you have any ideas how could I debug this or at least get some more info on what's happening? Except for the AP logs which I will try to gather later

So far on AP I see only this in log on openwrt AP:

Wed Oct 19 10:37:17 2022 daemon.info hostapd: phy1-ap0: STA 38:00:25:xx:xx:xx IEEE 802.11: authenticated
Wed Oct 19 10:37:17 2022 daemon.info hostapd: phy1-ap0: STA 38:00:25:xx:xx:xx IEEE 802.11: associated (aid 4)
Wed Oct 19 10:37:17 2022 daemon.notice hostapd: phy1-ap0: STA-OPMODE-SMPS-MODE-CHANGED 38:00:25:xx:xx:xx off
Wed Oct 19 10:37:26 2022 daemon.info hostapd: phy1-ap0: STA 38:00:25:xx:xx:xx IEEE 802.11: deauthenticated due to local deauth request
roleoroleo commented 1 year ago

You should try to increase debug log using "-dd" option. In wifi.sh and wificonnect.sh.

andriej commented 1 year ago

Is there any place that BSSID of AP is saved within? I can see from logs that camera tries to connect to the AP that far-far-away instead of the one that is 1 meter away...

roleoroleo commented 1 year ago

Is there any place that BSSID of AP is saved within?

Yi saves these configs in a raw flash partition.

CURRENT_SSID=$(dd bs=1 skip=28 count=64 if=/dev/mtdblock6 2>/dev/null)
CURRENT_KEY=$(dd bs=1 skip=92 count=64 if=/dev/mtdblock6 2>/dev/null)
andriej commented 1 year ago

Those are SSID and KEY, proper ones. Can't still figure out why it's trying to connect to 'old' BSSID (MAC of AP) instead of the one Yi has next to it

roleoroleo commented 1 year ago

AFAIK the cam doesn't save the mac address of the AP. Only SSID and key.

Maybe a wrong channel... Are you using a channel not licensed for your country?

andriej commented 1 year ago

Yeah, I couldn't find any place with BSSID encoded too. Definietly not channels issue, as I use 1, 6 and 11 which all are allowed in EU

Really strange one here. :)

andriej commented 1 year ago

As I had to repair SD card (not able to upgrade), I've taken some steps after the upgrade to investigate more. Camera was in same room as AP although having only 37% WiFi signal strength. I went to the panel and I can see two networks detected with same SSID.

I've selected the first from the top, saved the password and rebooted camera - it has reconnected to the 'closer' AP.

What I would recommend then is to add BSSID/MAC address of AP near to the SSID name or at least it's signal strength. It would allow to fix that and choose proper network if few with same SSID are detected.

-- Few reboots after: I can see it came back to the weaker signal and 2 reboots later it's back to stronger one. So it didn't change anything... ;)

roleoroleo commented 1 year ago

Unfortunately this process is not under my control: Yi manages the wifi connection. And the firmware saves only SSID and password.

github-actions[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.