Powersaving on companion when serial is off (ble/wifi)#1347
Open
weebl2000 wants to merge 2 commits intomeshcore-dev:devfrom
Open
Powersaving on companion when serial is off (ble/wifi)#1347weebl2000 wants to merge 2 commits intomeshcore-dev:devfrom
weebl2000 wants to merge 2 commits intomeshcore-dev:devfrom
Conversation
fschrempf
reviewed
Jan 8, 2026
35fad46 to
69f1ad3
Compare
Contributor
Author
|
Moved button handling logic to ESP32Board - this has the added benefit that repeaters will also wake up when you press the button (they do not currently). |
Contributor
Author
|
@fschrempf Actually basically all devices are low when pressed. Updated the code accordingly. On my Heltec v4 the screen turns off when I disable bluetooth. |
f090774 to
28773f8
Compare
28773f8 to
6e44a89
Compare
This was referenced Feb 7, 2026
Use millisHasNowPassed() (2's complement safe) instead of direct comparison, consistent with the repeater's sleep timing logic. Co-Authored-By: Wessel <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds power saving to the companion radio when BLE/WiFi is disabled by the user. When the serial interface is off (and GPS is not enabled), the device enters ESP32-S3 light sleep for 30-minute intervals, significantly reducing power consumption for battery-powered companion nodes that are left running as pure relays.
Changes
Light sleep in companion radio (
examples/companion_radio/main.cpp)serial_interface.isEnabled()is false and GPS is offWiFi radio actually turns off (
src/helpers/esp32/SerialWifiInterface.cpp/h)disable()now callsWiFi.disconnect(true)andWiFi.mode(WIFI_OFF)to power down the radioenable()reconnects using stored SSID/password credentialsdisable()only set a flag — the WiFi radio stayed powered onButton wakeup with correct polarity (
src/helpers/ESP32Board.h)enterLightSleep()accepts optionalpin_wake_btnparameter (backward-compatible)GPIO_INTR_LOW_LEVEL) for button — correct for active-LOW buttonsANY_HIGH) for LoRa DIO1 only — these can't share a mask since they need opposite trigger levelsPending work detection (
examples/companion_radio/MyMesh.cpp/h)hasPendingWork()checks outbound packet queue to avoid sleeping while packets are queuedNotes
CONFIG_IDF_TARGET_ESP32S3)PIN_USER_BTNgracefully skip button wakeupsleep()still callsenterLightSleep(secs)without buttonBuild firmware: Build from this branch