EliasKotlyar / Xiaomi-Dafang-Hacks

4.16k stars 1k forks source link

Wifi Connection Dropping every set period. (Watchdog timeout issue) #1796

Open timpur opened 2 years ago

timpur commented 2 years ago

Description

If your issue was resolved, please consider contributing back to the project by creating a pull request to improve the code or documentation in order to avoid that this issue arises again for other people.

Was trying to apply the hack following the instructions to the letter, but never could fix an wifi issue where it would drop out every 60s. Since it was so consistent i thought it must be a timer or something. Started to play with settings and read some wifi.sh code and found the watchdog with a timeout setting. Then when i changed the wifi time out setting to 120 seconds my wifi was stable for 120s. I remember thinking omg, 2 days of trying everything and it was just this.

So i set the time out to 3600 sec and said ill fix the code later. Here is the proof

Details:

Camera: Dafang DF3 Commit: 0cde105a1ba438d2dbd045db5acece119019dc40

Proof:

16686 root 0:00 {wifi.sh} /bin/sh /system/sdcard/scripts/wifi.sh wpa_action watchdog
16708 root 0:00 sleep 3600

image

With this change i now dont see any issue with my wifi connection (for an hr). I will try to fix with with a pr, but creating this to trak the issue and to help inform anyone else having this issue.

timpur commented 2 years ago

So digging around it seem that the watch dog is running but not getting stopped https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/blob/beta/firmware_mod/scripts/wifi.sh#L145

Which should happen when connection is called https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/blob/beta/firmware_mod/scripts/wifi.sh#L134

Which is called by this file https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/blob/beta/firmware_mod/scripts/wpa_action.sh#L7

So just need to work out why the connect isnt being called

joshuahaertel commented 2 years ago

In case you haven't tried it yet and are still trying to debug this, I believe you can set the timeout value to inf as a more long term "hack", assuming you are fine with the AP mode never coming on.

stale[bot] commented 1 year 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.