VREMSoftwareDevelopment / WiFiAnalyzer

Android application to analyze WiFi signals.
https://vremsoftwaredevelopment.github.io/WiFiAnalyzer/
GNU General Public License v3.0
2.96k stars 578 forks source link

The WiFi network time shown in the app is incorrect #391

Closed olekstomek closed 1 year ago

olekstomek commented 1 year ago

A feature https://github.com/VREMSoftwareDevelopment/WiFiAnalyzer/issues/365 has been added to the app. This shows how long the WiFi network has been operating for. However, the time is not correct. Here are the screenshots from the application: 1665701596658 1665701596663 1665701596671 1665701596678

In the screenshots you can see the networks: HUAWEI P10 lite (this network has only been working for a minute, why is the value 0:11:00:980?) _GigaLan_siecdomowa_14EXT (not my network) and the OpenWrt networks have almost the same value: 0:07:19.XXX (this is impossible - my OpenWrt network has a different uptime and it will be below) LEDE MiFi - has a value of 0:07:24.437, this network was launched for testing, it was launched a short time ago.

Uptime for OpenWrt network: 1665701596654 You can see that the network is operational 6 days 22 hours 55 minutes. Where does the 0:07:19:998 value in the app come from?

I am enclosing what times can be seen from the router (which broadcasts LEDE MiFi network) panel (GUI MiFi based on OpenWRT) which also has the option of displaying the operating time of a given WiFi network. The times are correct: 1665701596684 You can see difference. Correct uptime for my networks HUAWEI P10 lite is one minute, OpenWrt is 6 days 22 hours and some minutes.

Smartphone: Xiaomi Mi 9, Android 11 App version: 3.0.10 - 62G (11-30)

VREMSoftwareDevelopment commented 1 year ago

Timestamp is provided by Android API

Documentation Reference: https://developer.android.com/reference/android/net/wifi/ScanResult#timestamp

Application does not change the value, it only formats it

Code reference: https://github.com/VREMSoftwareDevelopment/WiFiAnalyzer/blob/b662b1d16b878b96fec5319960a1d1e980fb2685/app/src/main/kotlin/com/vrem/wifianalyzer/wifi/accesspoint/AccessPointDetail.kt#L165

olekstomek commented 1 year ago

Okay, the network uptime is set differently for the solution in the router with OpenWrt (Beacon frame) and differently in the WiFiAnalyzer application (API from Android).

I think this might be a related problem: https://issuetracker.google.com/issues/37123392