zacharee / ArcadyanKVD21Control

A cross-platform app using JetBrains Compose to view and control the Arcadyan KVD21, Sagemcom Fast 5688W, and Nokia 5G21 T-Mobile Home Internet gateways.
MIT License
134 stars 6 forks source link

Feature Request - Browser Based & Data Export #54

Closed SLAPSTICKdev closed 1 week ago

SLAPSTICKdev commented 2 weeks ago

Hey, many thanks and keep up the great work! The iOS app has been wonderfully helpful.

Feature request(s):

  1. It would be nice to have a chrome extension or be able to open up a web browser to view metrics/ change settings vs downloading / compiling and installing a whole application. Similar to how configuration of a standard router would be; login page at "xxx.xxx.xxx.xxx", then dashboard/tabs/other layout.

  2. Thank you for the simple metrics graph, this is very helpful in-app. It would be great to export this data for further analysis. I would like to view this data in a spreadsheet environment to track metrics over a much greater period of time compared with other speed and usage vs outage metrics.

Austin-Waveform commented 2 weeks ago

I second this feature request. Both of the features described by @SLAPSTICKdev would be incredibly convenient.

zacharee commented 2 weeks ago
  1. The last time I checked, neither the Nokia nor the Unified API gateways have a CORS policy that lets web apps make requests to them from a different domain. I can dig out an Arcadyan gateway and check again, but I doubt it's changed. That pretty much makes it impossible to make a hosted web app.
  2. You should be able to export the snapshot data as JSON from the Settings page where you enable the graph.
SLAPSTICKdev commented 2 weeks ago

Thanks for the quick response.

Shame about the browser. I honestly thought it would be relatively simple. Silly me. I can't understand how applications could be allowed to communicate with the device, but the browser running on the same device creates friction.

Unless I'm missing something, the iOS app doesn't have an export option on the settings page. There is an enable toggle and a clear button.

zacharee commented 2 weeks ago

CORS is a browser-level policy that prevents websites from making local requests to other domains without those domains explicitly allowing it. In this case "domain" includes IP addresses. It's possible to make a web app that would be hosted at something like hintcontrol.app that makes a request on the browser side to 192.168.12.1, but since the gateway doesn't allow requests from anywhere besides 192.168.12.1, the browser will block them. Full applications don't have this limitation since CORS is part of the browser and not network requests themselves.

On iOS, there isn't an export button for the snapshots. Instead, open the Files app, go to the Browse tab, back out of iCloud Drive, go to On My iPhone, and then go into the HINT Control folder.

SLAPSTICKdev commented 2 weeks ago

So a local server on a desktop with a simple html UI isn't allowed to work on the browser, but an application can contact the same ip as the host machine and it works? Doesn't the application make the same type of requests to the ip? This clearly goes beyond my scope of understanding. I appreciate your knowledge and patience.

Json has been found. He will be loved, but unfortunately put to work.

Thanks again!

zacharee commented 2 weeks ago

A local server wouldn't be limited by CORS, but Compose isn't really set up to run as a server, just as a normal web app if that compilation target is enabled.

Theoretically I could add some extra logic to a web target to ask the user to set up a CORS proxy on the local network and provide the IP, but Compose for web still has a long way to go, and it ends up being easier to just use one of the native application targets.

Austin-Waveform commented 2 weeks ago

Within the json file there seems to be multiple redundant entries, e.g. All of the "/mainData/signal/" values are duplicates of a subset of the "/cellData/cell/" values. Is there a reason for both of these entries to be displayed?

zacharee commented 2 weeks ago

The snapshots just are just compiling the data returned from the various endpoints in the Unified API. /cellData/cell/[4g|5g]/sector is identical to /mainData/signal/[4g|5g] at least in structure. I haven't done enough testing to see if they're always the same data.