From 275e1683b83117b5497019e43c6bf377f4b35d13 Mon Sep 17 00:00:00 2001 From: ScreenTinker Date: Wed, 29 Jul 2026 21:57:59 -0500 Subject: [PATCH] Report the screen's own IP, and make the Wi-Fi name an honest optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A customer read the device page's IP as their screen's address and reported it as wrong. It was not wrong, it was a different thing: devices.ip_address is the PUBLIC address the server sees the connection arrive from. Both are useful — you want the public one to recognise a site, and the local one to actually reach the panel — so the page now shows each, labelled. The player already computed its own address for the connectivity report; it just never reported it. Read straight off the interfaces, so Ethernet panels get it too, and it needs no permission. Stored on device_telemetry beside wifi_ssid/wifi_rssi, where the per-heartbeat network facts already live, rather than as another devices column. The same customer saw "Unknown" for the Wi-Fi name and assumed it needed device-owner access. It needs LOCATION: Android 8.1+ returns the literal "" to an app without it. So "Unknown" was us reporting a permission gap as if the network had no name. The player now distinguishes not-allowed-to-know from genuinely-no-Wi-Fi, and the page says "Needs location permission" instead of a blank. The permission is declared but NEVER requested at startup and nothing else uses it — a signage player demanding location to display a network name is a bad trade. It is an opt-in row on the setup screen, using the same Enable/Manage pattern, and refusing it changes that one field and nothing else. Also caught by the test suite, and worth recording: the first version of this dropped the comma in the device SELECT list ("t.uptime_seconds t.local_ip"), which 500'd the endpoint and failed seven tests that never mention telemetry. Verified end to end afterwards — public and local addresses both returned, distinct, from a real request. --- android/app/src/main/AndroidManifest.xml | 8 +++ .../com/remotedisplay/player/SetupActivity.kt | 24 ++++++++ .../player/telemetry/DeviceInfo.kt | 46 ++++++++++++-- .../src/main/res/layout/activity_setup.xml | 60 +++++++++++++++++++ frontend/js/i18n/de.js | 2 + frontend/js/i18n/en.js | 2 + frontend/js/i18n/es.js | 2 + frontend/js/i18n/fr.js | 2 + frontend/js/i18n/it.js | 2 + frontend/js/i18n/pt.js | 2 + frontend/js/views/device-detail.js | 22 ++++++- server/db/database.js | 4 ++ server/routes/devices.js | 2 +- server/ws/deviceSocket.js | 9 ++- 14 files changed, 177 insertions(+), 10 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 6039a30..3487f11 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -9,6 +9,14 @@ + + + + diff --git a/android/app/src/main/java/com/remotedisplay/player/SetupActivity.kt b/android/app/src/main/java/com/remotedisplay/player/SetupActivity.kt index 9b77cb6..6641883 100644 --- a/android/app/src/main/java/com/remotedisplay/player/SetupActivity.kt +++ b/android/app/src/main/java/com/remotedisplay/player/SetupActivity.kt @@ -160,6 +160,18 @@ class SetupActivity : AppCompatActivity() { // Default launcher / HOME: a kiosk MUST be the default launcher, else Android returns to the // stock launcher and tears down + recreates the player on a loop (it never renders). Request // the HOME role (clean system dialog on API 29+); fall back to the Home-app picker in Settings. + // OPTIONAL: location, solely so the device page can show the Wi-Fi network name. Requested + // only when someone taps this row — never at startup, and nothing else in the player depends + // on it. Once granted (or permanently denied) requestPermissions() stops prompting, so an + // already-answered row sends you to app settings where it can be changed either way. + findViewById