tuya-cloudcutter / cloudcutter-android

Android app providing tuya-cloudcutter functionality
21 stars 0 forks source link

Hangs at connecting to smart device wifi #3

Open interfect opened 1 year ago

interfect commented 1 year ago

When I try to use the app on my Jasco Enbrighten WFD4105E (with the Tuya CB2s featuring the BK7231N), it hangs at the step of connecting to the device.

I get a log like this:

03-05 22:12:46.457  9460  9460 V WifiUtils: START SCANNING....
03-05 22:12:46.458  1509  2535 I WifiService: startScan uid=10167
03-05 22:12:46.460  1509  2237 I WifiScanRequestProxy: Scan request from io.github.cloudcutter throttled
03-05 22:12:46.461  1509  2535 E WifiService: Failed to start scan
03-05 22:12:46.469  1509  6033 I WifiService: getConfiguredNetworks not allowed for uid=10167
03-05 22:12:46.470  9460  9460 V WifiUtils: ERROR COULDN'T SCAN
03-05 22:12:46.472  9460  9460 D Logger/Exploit: [2023-03-05 22:12:46] [ExploitFragment] Wi-Fi scan results: []
03-05 22:12:46.681  9460  9460 D WorkFragment: Event: WiFiScanResponse
03-05 22:12:46.682  9460  9556 D Extensions: Event: WiFiScanResponse
03-05 22:12:46.684  9460  9556 D Extensions: Awaiting WiFiScanResponse
03-05 22:12:46.688  9460  9460 D WorkFragment: Event: WiFiScanRequest
03-05 22:12:46.691  9460  9460 D Logger/Exploit: [2023-03-05 22:12:46] [ExploitFragment] Wi-Fi scan performed
03-05 22:12:46.693  9460  9460 D WifiExtensions: Scanning networks
03-05 22:12:46.696  9460  9460 V WifiUtils: WIFI ENABLED...
03-05 22:12:46.696  9460  9460 V WifiUtils: START SCANNING....
03-05 22:12:46.697  1509  6033 I WifiService: startScan uid=10167
03-05 22:12:46.699  1509  2237 I WifiScanRequestProxy: Scan request from io.github.cloudcutter throttled
03-05 22:12:46.700  1509  6033 E WifiService: Failed to start scan
03-05 22:12:46.706  1509  6033 I WifiService: getConfiguredNetworks not allowed for uid=10167
03-05 22:12:46.707  9460  9460 V WifiUtils: ERROR COULDN'T SCAN
03-05 22:12:46.709  9460  9460 D Logger/Exploit: [2023-03-05 22:12:46] [ExploitFragment] Wi-Fi scan results: []
03-05 22:12:46.838 28837  6124 W MdnsSocket: Failed to retrieve interface index for socket. [CONTEXT service_id=168 ]
03-05 22:12:46.919  9460  9460 D WorkFragment: Event: WiFiScanResponse
03-05 22:12:46.920  9460  9556 D Extensions: Event: WiFiScanResponse
03-05 22:12:46.921  9460  9556 D Extensions: Awaiting WiFiScanResponse
03-05 22:12:46.925  9460  9460 D WorkFragment: Event: WiFiScanRequest
03-05 22:12:46.928  9460  9460 D Logger/Exploit: [2023-03-05 22:12:46] [ExploitFragment] Wi-Fi scan performed
03-05 22:12:46.930  9460  9460 D WifiExtensions: Scanning networks
03-05 22:12:46.935  9460  9460 V WifiUtils: WIFI ENABLED...
03-05 22:12:46.936  9460  9460 V WifiUtils: START SCANNING....
03-05 22:12:46.937  1509  6033 I WifiService: startScan uid=10167
03-05 22:12:46.939  1509  2237 I WifiScanRequestProxy: Scan request from io.github.cloudcutter throttled
03-05 22:12:46.939  1509  6033 E WifiService: Failed to start scan
03-05 22:12:46.945  1509  6033 I WifiService: getConfiguredNetworks not allowed for uid=10167
03-05 22:12:46.946  9460  9460 V WifiUtils: ERROR COULDN'T SCAN
03-05 22:12:46.948  9460  9460 D Logger/Exploit: [2023-03-05 22:12:46] [ExploitFragment] Wi-Fi scan results: []

It seems to be trying to scan as fast as possible and hitting the wifi scanning rate limit as noted here.

A workaround may be to disable wifi scan throttling in the developer options, but if it is possible to work within the throttle the app should detect if it is being throttled and slow down/back off on the scans.

interfect commented 1 year ago

Turning off the limit in my device's developer options worked around this issue.

I was able to dump the firmware with the "Type 1 / Addr 1" profile.

Here it is for reference: dump_wfd4105e.zip

I will see about getting it to the proper place to make a profile for the flasher tomorrow.

Cossid commented 1 year ago

Added a profile to CloudCutter for this plug.