highvolt-dev / tmo-monitor

A lightweight, cross-platform Python 3 script that can monitor the T-Mobile Home Internet Nokia, Arcadyan, and Sagecom 5G Gateways for 4G/5G bands, cellular site (tower), and internet connectivity and reboots as needed or on-demand.
MIT License
89 stars 15 forks source link

Arcadyan gateway doesn't always provide all signal information #64

Open asheingold opened 2 years ago

asheingold commented 2 years ago

When the Arcadyan gateway returns the status of the signal, it doesn't always provide both 4g and 5g bands if not connected. For example, my gateway pulls this currently:

{ "device": { "friendlyName": "5G Gateway", "hardwareVersion": "R01", "isEnabled": true, "isMeshSupported": true, "macId": MACADDRESS, "manufacturer": "Arcadyan", "manufacturerOUI": "001A2A", "model": "KVD21", "name": "5G Gateway", "role": "gateway", "serial": SERIAL, "softwareVersion": "1.00.16", "type": "HSID", "updateState": "latest" }, "signal": { "4g": { "bands": [ "b66" ], "bars": 2.0, "cid": 3, "eNBID": 778528, "rsrp": -116, "rsrq": -13, "rssi": -103, "sinr": 0 }

When this happens, there is a key error for ['signal']['5g']['bands'].

highvolt-dev commented 2 years ago

Thank you for reporting. I don't have an Arcadyan gateway so the support that I added was thanks to a generous person granting me remote access to theirs, and unfortunately the API response in this situation was considered undefined behavior because that person had 5G signal available.

This should be an easy fix - I'll try to get this fixed for you this weekend!

Short of requesting remote access again, I'm going to write this update mocking against the API response you provided above.

Thanks again!