|
This is a general problem but every distro may have slightly different behaviour, depending on how filesystem is handled, which processes are running etc. I see two possible approaches, but I am a noob in electronics, so I may be missing something:
The software approach is more appealing to me as it's simpler and cheaper, and it can ensure even a total power off, that is even the power supply could be cut off with no stand-by power consumption. Unfortunately it puts some limitation on how the software works. A question to @b0bbywan : does Odio uses log2ram? Do you think a sudden power cut can be problematic? Which processes may lead to file corruption? Would it be conceivable to have a read-only mount in case the user is willing to give up persistence of settings? |
Replies: 5 comments
|
Hey So i've already disabled swap on the image install, that was the most critical in my opinion. Don't take what I'm about to say for granted, it's just based on observation, I'll have to dig more into it: looks like with Trixie raspi os stopped writing logs. Journactl is basically useless. I can't think of anything writing on the SD, so it could be safe already. Would I do it on a regular basis ? No. Actually that's kind of why there's an API endpoint for powering off, I thought home automations would be enough for this matter 😅 To be honest, "as a maker" having to remount a filesystem to try things really annoys me, so I don't have plans to follow that path. But your use case is really interesting, it also resonates with my comment here #35 (comment) so I'm really keen on trying to find a solution for it! Which makes me think, it'd help if you shared you setup ^^ don't need to be as exhaustive as I was, just what would be useful for debug 😉 |
|
Thanks for the answer and the link to the other issue. There are also some options, that I did not try yet, to turn the Pi OFF and also to restart it with a single momentary button, but according to what I found, the difference in power consumption when the PI is "OFF" is minimal, as it is not really off, it's only that the CPU is halted (the other components are still powered). Long discussion here https://forums.raspberrypi.com/viewtopic.php?t=217442&start=25 Authoritative source seems to be here: https://www.stderr.nl/Blog/Hardware/RaspberryPi/PowerButton.html Starting from RPI 4, I think there is an option to reduce the power in this "halt" state and still to restart it with a button: |
|
Yep Class D amps are super efficient, most power is used for volume, just muting reduces power consumption close to 0. Looks to me that not powering off is the most appropriate way for you too. But in case you wanna dig more into this, maybe the idea I had in my mind, based on home automations, before testing and giving up, will give you some ideas. My idea was to use a zigbee smart plug (with power consumption) and the power api endpoint via odio Home Assistant integration. After powering off the Pi, I wanted to monitor the current sent to the Pi, and turn off the swtich when it reaches 0, or close. Powering up the pi would have meant turning the smart plug back on from Home Assistant (via automations, or manually) I gave up because the Pi B+ didn't consume enough current to be detected by my sonoff smart plug, the boot time was way too long too, plus my interrogations about degrading the SD faster. But, with a more recent model (3B+ would be my guess, 4 or 5 almost without doubt), this could make more sense. I should add this to the docs somewhere. Or course an electronical relay could also do the job, but electronics was really my weak point in engineering school more than 15 years ago, I still suck at it 😅 Maybe I'll go to a fablab some day to ask about this. |
|
I also have few ZigBee smart plugs (and a Zwave one too) , but I wonder if the energy saved would compensate the energy used by the plug itself !!! Maybe not... |
|
Mentionned here https://docs.odio.love/guides/power/ |
Hey
So i've already disabled swap on the image install, that was the most critical in my opinion.
Don't take what I'm about to say for granted, it's just based on observation, I'll have to dig more into it: looks like with Trixie raspi os stopped writing logs. Journactl is basically useless. I can't think of anything writing on the SD, so it could be safe already.
Would I do it on a regular basis ? No. Actually that's kind of why there's an API endpoint for powering off, I thought home automations would be enough for this matter 😅
To be honest, "as a maker" having to remount a filesystem to try things really annoys me, so I don't have plans to follow that path.
But your use case is really…