balena-io-modules / device-diagnostics

on-device diagnostics tool
9 stars 8 forks source link

Checking cellular modem behaviour/functionality #153

Open Bucknalla opened 4 years ago

Bucknalla commented 4 years ago

@xginn8 I'm interesting in contributing some tests to support validating cellular modem behaviour. Is that something considered in the realms of what device-diagnostics should support?

If so, how would that behaviour be handled; would we want to enable cellular modem health checks via a flag or should it be something that the diagnostic script could extract from network/modem manager and ignore if it cannot find a cellular modem?

xginn8 commented 4 years ago

@Bucknalla that would be wonderful! What sort of validation do you have in mind? The way this repo is structured there are both "checks" and "diagnostics". The former is used for expressing something to the user directly (some degraded state), while the latter is used to collect extra data for later investigation or for an expert to review.

It's a good question regardless. I just merged this week a check that is ignored if no hardware is available (https://github.com/balena-io/device-diagnostics/blob/master/scripts/checks.sh#L59-L75), so perhaps that's a jumping off point?

Let me know how I can help you!

Bucknalla commented 4 years ago

@xginn8 it would be great to report things like network strength, protocol (i.e. LTE/3G/etc.) maybe report the APN settings? I've often had devices that say they have network access but in reality what NetworkManager appears to show is just that the device has just registered on a network rather than actually able to TX/RX; a simple check for this would be great too.

My concern about ignoring the cellular modem is, how does this differentiate between there not being physical hardware for a cellular modem and if the cellular modem has completely failed?

jellyfish-bot commented 4 years ago

[alidaodendaal] This issue has attached support thread https://jel.ly.fish/#/31e90b68-811c-4e1d-9665-ac3b01e6f689

xginn8 commented 4 years ago

@Bucknalla I finally got around to playing with a modem locally. What I'd like to propose would be a check that does a few things:

If a modem is attached, we'll run a (dedicated) check that:

  1. Confirms the modem is on
  2. Returns the protocols available + configured APN
  3. Asserts that the signal quality is above some threshold

If the OS detects no modem, that check will be turned off (which is gross, but a signal in and of itself).

We will also pull the descriptive output of mmcli -m 0 and mmcli -L into our diagnostics logs for further debugging.

Is there anything else you think is missing? The clunkiest bits for me is that this probably belongs as a test in the larger check_networking, but since that masks successful tests, we'll want it to live outside of that check. Also the negation logic is weird, but I can't think of a better way.

Bucknalla commented 4 years ago

@xginn8 I agree, it feels like it should live in check_networking but I think this way does make sense. I'm wondering if there's a clean way for us to ping a server over the modem and to confirm that we have network access? Additionally I'm not sure what the logic is like for detecting the presence of SIM cards, in mmcli, but that may also be interesting for the health check?

jellyfish-bot commented 2 years ago

[ab77] This issue has attached support thread https://jel.ly.fish/3d651196-426a-4850-80b9-464ade24b5f4