hardware.py: remove NM dbus#38005
Conversation
Process replay diff reportReplays driving segments through this PR and compares the behavior to master. ✅ 0 changed, 66 passed, 0 errors |
adeebshihadeh
left a comment
There was a problem hiding this comment.
Can we replace the subprocess calls with fs reads?
comma@comma-d3c3ad4b:/data/openpilot$ cat /proc/net/route
Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT
wlan0 00000000 0138A8C0 0003 0 0 600 00000000 00 0
wlan0 0038A8C0 00000000 0001 0 0 600 00F8FFFF 00 0
comma@comma-d3c3ad4b:/data/openpilot$ cat /proc/net/wireless
Inter-| sta-| Quality | Discarded packets | Missed | WE
face | tus | link level noise | nwid crypt frag retry misc | beacon | 22
wlan0: 0000 0 0 0 0 0 0 0 0 0
p2p0: 0000 0 0 0 0 0 0 0 0 0
|
| NM_METERED_GUESS_YES = 3 | ||
| NM_METERED_GUESS_NO = 4 | ||
|
|
||
| NM_CONNECTIONS_DIR = "/run/NetworkManager/system-connections" |
There was a problem hiding this comment.
what about /data/etc/NetworkManager/system-connections?
There was a problem hiding this comment.
updated now to handle both paths:
- AGNOS NM wifis are saved as netplan files which generate nmconnection files (only) in /run
- on Void/vamOS there's no netplan and only the /data path is used
| metered = cp.getint("connection", "metered", fallback=0) | ||
| except (configparser.Error, ValueError): | ||
| continue | ||
| # NM metered: 1=YES, 2=NO, 3=GUESS_YES, 4=GUESS_NO |
There was a problem hiding this comment.
how do we get the guess? don't think it's written out to the file?
There was a problem hiding this comment.
removed the guessing. found an Android phone that its hotspot shows GUESS_YES and it's not written to the nmconnection file, it's only avertised by NM runtime.
so, with this change, Android hotspots will no longer be auto-flagged as metered.
my intention now is auto-detection to be re-added in the No NM-era PRs once openpilot owns the DHCP code path.
if we want to keep auto-flagging in this PR, then we could replace the file read with nmcli.
There was a problem hiding this comment.
added a nmcli fallback for the guess
ec64420 to
a44bb5a
Compare
Part of #37752