-
Notifications
You must be signed in to change notification settings - Fork 309
Companion Power Optimizations and UI Support for XIAO NRF52 #1122
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
Companion Power Optimizations and UI Support for XIAO NRF52 #1122
Conversation
|
I can confirm the power drain even when I long-press the power button to turn the t1000-e off. I have observed this over the last weeks and when the device is fully charged and turned off the battery lasts only a day or so. I have flashed this firmware on my device right now and will give it a try; I'll report back ina couple of days. If this works then it will massivle increase the usefulness of the t1000-e devices! Amazing find! |
|
24 hours later and turned on the t1000e and the battery is still at 100%. Great job |
59b581a to
3e445e4
Compare
66a73c8 to
4ab5aa1
Compare
|
The T114 also works for me, after 8 hours of hibernation no voltage drop measured (through the telemetry). |
89f1840 to
3c054ae
Compare
3c054ae to
d0c953d
Compare
This should significantly reduce power consumption in hibernation. Fixes: meshcore-dev#1014 Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com> Signed-off-by: Frieder Schrempf <frieder@fris.de> # generalize for all radios and UIs
According to the documentation and experiments on other boards using NRF52 + SX1262 this reduces the power consumption significantly. This assumes that the hardware actually has the inductor for the internal DC/DC regulator populated which is very likely. Even if not, it won't hurt. Signed-off-by: Frieder Schrempf <frieder@fris.de>
Use the blue LED as status LED. This prevents the blue LED from being always-on and draining the battery. Instead use it as status LED with blink patterns as other companion devices do. Signed-off-by: Frieder Schrempf <frieder@fris.de>
This reduces the power consumption by approximately 25%. Signed-off-by: Frieder Schrempf <frieder@fris.de>
The Xiao nRF52840 combined with the Wio-SX1262 is often used for cheap and compact DIY companion nodes. The Wio actually has an onboard pushbutton that can be used as user button. Enable support for the button. Signed-off-by: Frieder Schrempf <frieder@fris.de>
Add the necessary code to properly power-off the Xiao + Wio companions. This way we can achieve around 15 microamps of power consumption in the off state. Signed-off-by: Frieder Schrempf <frieder@fris.de>
The current logic only works for active high LEDs. Some boards need an active low level control and therefore they set LED_STATE_ON to 0. Take this into account and use the correct LED pattern for both cases. Signed-off-by: Frieder Schrempf <frieder@fris.de>
Fix the active state of the LEDs (active low) and enable the status LED. Signed-off-by: Frieder Schrempf <frieder@fris.de>
This should reduce power consumption in hibernation. Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
According to the documentation and experiments on other boards using NRF52 + SX1262 this reduces the power consumption significantly. Signed-off-by: Frieder Schrempf <frieder@fris.de>
d0c953d to
7723a4c
Compare
|
Here is a successful CI build pipeline, just for reference: https://github.com/fschrempf/MeshCore/actions/runs/19596436013/job/56121657585. |
|
I am running this patched firmware for several hours. The power consumption seems much better. The only thing I noticed: I didn't receive any LoRa packet for several hours after waking up the T114 from the hibernation via reset. It maybe that everybody here were just silent or there is something missing in the init code (by checking the code, I didn't find anything suspicious, it seems the SX1262 radio is reset in the |
|
@yarda Thanks for testing. I just did the following test on my RAK WisMesh Tag:
Result: I can see that there are packets incoming without me sending anything before. |
|
I will give it another cca. 24 hours and I will report back. Here the mesh network is quite sparse, but it's improving :) |
It seems to work OK, just low traffic here :) |
fdlamotte
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good (at least not harmfull), but no time to test, sorry :/
actually I've never bothered to poweroff a node ;)
I am running the patched code for several days and I didn't observe any problem on T114 (for T114 it would be also good to have #1123, which I also have applied on my test node). This is not only about poweroff (where there is no need for the board to consume cca. 10 mA), but also lowers the board power consumption significantly at the runtime to cca. 50 %. Btw similarly to the SX1262 according to the datasheet it seems the nRF can be also switched to the DC-DC mode with cca. 50 % power consumption, it would be worth checking whether the current code does it. |
|
Great, I'll just test on my t1000 and e-ink tracker then ;) |
I mistakenly interchanged SX1262 and nRF52 in this comment, but it seems all is OK:
Regarding the SX1262, there is the following declaration in the And the I.e. the I.e. all seems OK. |
|
On my T1000 the power measurement seems not to work properly. The power goes from around 50 to 40% down to zero with in short period about 1-2 Hours. Yesterday evening, the battary was at 70%, this morning around 8:00 at was at 55%, around 10:00 system is off due to empty battery. After connecting the power cord, Systems starts up and is working properly and Loading. |
|
There is no device-specific conversion from battery voltage to percentage in the app, and interpolation is linear I think t1000 shuts down as soon as the power goes below a certain level. I personally only follow bat voltage and try not to let it go below 3.6V (but at this level it drops very fast) |
Okay, but with the unpatched Firmware I had a nearly linear drain down to under 10% with device still working. And 3.6V seems to be very high to recharge, the nominal voltage is 3.7V, so you are around 90%? |
On my RAK WisMesh Tag this has been the default behavior with or without the changes in this PR. The voltage to SOC (state of charge) relation is highly non-linear and as @fdlamotte mentioned, the software doesn't take this into account.
I don't see any relation to the PR here. Could it be that you are confused by the previous high power-off-state consumption? Before, you probably were seeing the battery getting drained fast during power-off. With the changes from this PR the battery will barely be discharged at all when powered-off. |
This is a collection of small changes that improve the power consumption for companion devices and adds UI (LED & user button) support for the XIAO NRF52 + Wio-SX1262.
The main change is calling RadioLibs
PhysicalLayer::sleep()for all modules in case the system is powered off in the companion UI. This will ensure that the proper commands are sent to the module to put it into the lowest possible sleep mode. This results in very low power-off consumption and extended battery lifetime when powered-off, especially for NRF52-based companions.Changes
Seeed SenseCAP T1000-E
RAK WisMesh Tag
Seeed XIAO NRF52 + Wio-SX1262
LED_STATE_ON=0and enable status LEDHeltec T114
Currently untested