final powermon / power analysis reporting changes#636
Conversation
meshtastic-py3.12kevinh@kdesktop:~/development/meshtastic/meshtastic-python$ cd /home/kevinh/development/meshtastic/meshtastic-python ; /usr/bin/env /home/kevinh/.cache/pypoetry/virtualenvs/meshtastic-l6tP90xw-py3.12/bin/python /home/kevinh/.vscode/extensions/ms-python.debugpy-2024.6.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher 52521 -- -m meshtastic --slog --power-ppk2-meter --power-stress --power-voltage 3.3 INFO file:ppk2.py __init__ line:52 Connected to Power Profiler Kit II (PPK2) INFO file:__main__.py create_power_meter line:1022 Setting power supply to 3.3 volts Connected to radio INFO file:slog.py __init__ line:183 Writing slogs to /home/kevinh/.local/share/meshtastic/slogs/20240706-123803 INFO file:stress.py syncPowerStress line:68 Sending power stress command PRINT_INFO INFO file:stress.py run line:105 Running power stress test 48 for 5.0 seconds INFO file:stress.py syncPowerStress line:68 Sending power stress command LED_ON INFO file:stress.py run line:105 Running power stress test 80 for 5.0 seconds INFO file:stress.py syncPowerStress line:68 Sending power stress command BT_OFF INFO file:stress.py run line:105 Running power stress test 81 for 5.0 seconds INFO file:stress.py syncPowerStress line:68 Sending power stress command BT_ON INFO file:stress.py run line:105 Running power stress test 34 for 5.0 seconds INFO file:stress.py syncPowerStress line:68 Sending power stress command CPU_FULLON INFO file:stress.py run line:105 Running power stress test 32 for 5.0 seconds INFO file:stress.py syncPowerStress line:68 Sending power stress command CPU_IDLE INFO file:stress.py run line:105 Running power stress test 33 for 5.0 seconds INFO file:stress.py syncPowerStress line:68 Sending power stress command CPU_DEEPSLEEP INFO file:stress.py run line:108 Power stress test complete. INFO file:slog.py close line:201 Closing slogs in /home/kevinh/.local/share/meshtastic/slogs/20240706-123803 WARNING file:arrow.py close line:67 Discarding empty file: /home/kevinh/.local/share/meshtastic/slogs/20240706-123803/slog.arrow INFO file:arrow.py close line:70 Compressing log data into /home/kevinh/.local/share/meshtastic/slogs/20240706-123803/power.feather meshtastic-py3.12kevinh@kdesktop:~/development/meshtastic/meshtastic-python$
+ # Devices should _not_ be including a newline at the end of each log-line str (especially when
+ # encapsulated as a LogRecord). But to cope with old device loads, we check for that and fix it here:
+ if line.endswith("\n"):
+ line = line[:-1]
Also: auto reformatting per our trunk formatting rules.
# Conflicts: # meshtastic/mesh_interface.py
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #636 +/- ##
==========================================
+ Coverage 58.99% 61.69% +2.70%
==========================================
Files 23 24 +1
Lines 3419 3587 +168
==========================================
+ Hits 2017 2213 +196
+ Misses 1402 1374 -28
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
new readings. This allows for better plotting/analysis but still keeping runtime polling low.
# Conflicts: # meshtastic/mesh_interface.py
main.py's only real change is
log_set: Optional[LogSet] = None # type: ignore[annotation-unchecked]
Everything else is the automated reformatting to match our trunk formatting
rules.
df6d8ea to
dfa3d46
Compare
0a729fc to
0271429
Compare
0271429 to
8096d10
Compare
ianmcorvidae
left a comment
There was a problem hiding this comment.
I still don't fully understand the power management stuff, but I think this looks good to merge in. I think we may want to split out some more of the powermon related dependencies to be optional -- we're pulling in a lot by way of some of those since merging the last PR. That can happen later though, too.
Let me know when this is ready to merge as far as you're concerned! I see you've pushed a couple things since marking me to review, so I just want to be sure you're good on that.
|
@ianmcorvidae thanks! yep - I think ready to merge! I've tried to conditionalize the analysis stuff so most of it only gets pulled in if the optional extra poetry "analysis" is used. |
PowerMeasurement/reporting/analytics stuff is now 'done' (though I'll probably send in occasional small PRs to tweak PowerStress and the code in analytics). I'll be sending in a PR to the docs project soon with a description on how to setup the hardware and run the tests/generate reports.
Do these changes look okay to you? Mostly this is new stuff in the previously unused analytics subproject.