Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[APP-7257] Support older NM (>1.30.0) and hardware that cannot scan in hotspot mode #55

Merged
merged 4 commits into from
Dec 18, 2024

Conversation

Otterverse
Copy link
Member

@Otterverse Otterverse commented Dec 17, 2024

EDIT: rc2 replaces rc1. Fix a timeout issue that caused erratic behavior on "normal" (read, previously fully working) systems.
EDIT: rc1 replaces rc0. Minor fix for unrelated reboot timeout code.

Two main changes...

  1. If NM older than 1.38, avoid using RadioFlags to disable when wifi hardware is absent, and rely on later device scan.

  2. Modify wifi scanning to detect repeated failures when in hotspot mode, and (after 3) disable such scans after warning the user. This means the network list in the web portal or provided to the mobile app may be several minutes out of date, as scan data had to come from before the hotspot was started. May want to advise users to reduce the fallback timeout to a lower interval if this causes them problems. Otherwise we hang out in hotspot for 10 minutes, even if a wifi network we know comes in range, we can't see it until hotspot exits to allow a scan.

Test build:

 ` "pin_url": "http://packages.viam.com/temp/viam-agent-v0.12.0-rc2-aarch64",`

@Otterverse Otterverse changed the title Support older NM (>1.30.0) and hardware that cannot scan in hotspot mode [APP-7257] Support older NM (>1.30.0) and hardware that cannot scan in hotspot mode Dec 17, 2024
Copy link
Member

@ale7714 ale7714 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing the bug. I haven't tested it but code looks good.

conf.DeviceRebootAfterOfflineMinutes < conf.OfflineTimeout ||
conf.DeviceRebootAfterOfflineMinutes < conf.UserTimeout {
return &conf, errw.Errorf("device_reboot_after_offline_minutes cannot be less than offline_timeout or user_timeout")
(conf.DeviceRebootAfterOfflineMinutes < conf.OfflineTimeout || conf.DeviceRebootAfterOfflineMinutes < conf.UserTimeout) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took me WAY too long to figure out this was the issue. One pair of missing parenthesis! So easy to miss!

@Otterverse Otterverse merged commit 4b78b6a into main Dec 18, 2024
2 checks passed
@Otterverse Otterverse deleted the oldnm-support branch December 18, 2024 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants