Hypnic Power Manager for Raspberry Pi (and other SBCs)

All wired and ready to install.

A couple of hiccups...
Code:
https://raw.githubusercontent.com/gilphilbert/hypnic/main/sbc/install.sh: not found
So downloaded the zip and unpacked but...
Code:
cd hypnic/sbc

Should be..
Code:
cd hypnic-main/sbc

Then....had to install bash to Picoreplayer.
and sudo bash install.sh fails..
Could not find your systemd installation. Hypnic is currently only supported on systems running systemd

Aha...Picoreplayer based on Tinycore linux and no systemd. :-(
I had thought to make an appliance using Picoreplayer/LMS/Jivelite and the Official Pi touch-screen as this has such good navigation and display.
I will have to rethink...
 
Last edited:
Ah, yes. TinyCore is awesome - lightweight and super fast but scripts from pretty much any other distro won't work at all. That said, building custom extensions is trivial. Give me a few days, I should be able to create an installer for PiCorePlayer that downloads the correct scripts, prompts for the pins you want to use then installs a custom extension. I need to re-read the documentation on shutdown scripts as it's been a few years since I've used TinyCore.
 
Thanks Greg and Phil...!!
I thought to use PcP as a player only so no shutdown corruption but that would mean another instance of PcP as the LMS server.

I would rather have PcP and LMS on the same Pi and Phil's wonderful Power Board as the controller but will wait to see what Phil comes up with. :)

Otherwise, no worries, as I could possibly breakout the player and server to separate Pi ??...

Currently the NAS is protected by a UPS and it would be fantastic to have the players similarly covered. :)
 
Thanks Greg, I wasn't aware of the pcp commands. I wanted to avoid the dependency on Python (since it won't be installed 99% of the time) and now I have a dedicated version for pCP.

  • I've rewritten the configuration and daemon as sh scripts instead of python, removing the python requirement for pCP
  • Instead of sudo poweroff, I'm using pcp bs
  • I've also swapped to pcp-gpio (which is awesome, by the way)
  • It's wrapped in a custom extension

My install script will deal with the installation of the extension for you, since this is not in the repo:

Code:
wget -qO - [url]https://raw.githubusercontent.com/gilphilbert/hypnic/main/sbc/install.sh[/url] | sudo sh

The default pins are:
GPIO 17 (HALT)
GPIO 27 (SAFE)

Any questions, just ask!
 
Last edited:
Hi Phil,


I just tried to install your Hypinic device on my MOODE Audio based system: I thought that it was based on a Raspbian distribution, but when I started the installation, I got the error message "system not recognized".


Could you help me ? I am not a programmer, but I know how to follow a procedure...


Thank you in advance,
 
This is what worked for my PCP install...if I get time tonight I will try on Moode but for now this should work...bob.

ssh to your Pi running Moode then..

Code:
wget [url]https://github.com/gilphilbert/hypnic/archive/refs/heads/main.zip[/url]

Once downloaded unzip with..
Code:
unzip main.zip

and move to this directory with..
Code:
cd hypnic-main/sbc

then install with
Code:
bash install.sh

(may need sudo bash install.sh for the last command)
 
Hi Drone7,

This is what I did, but I got the same error message. I edited the install.sh and I manually did the different operations. It seems that the paths were not correct. Anyway I do not the feeling the the hypnic device is working well: I did not see that the switch off operation was lasting 20s... I have idea how to check everything is working properly.

Thank you anyway for your help.
 
Hi pkdick,

I found an error in the install script which I've fixed, running it again now should get it working. Apologies for that.

As for power, remember that the supercapacitors need to charge! When the Hypnic has been off for some time, the supercapacitors will be "empty" and will need to charge - like a battery. This means that the current draw during initial charge will be higher than just running your Pi (and your Pi likely uses the most power while powering on). That said, the 3A output of the Shanti PS should be fine for a Pi 3, as long as you don't have too many USB devices attached to it. I'm using a cheap 2A power supply with my Pi, and that powers the Pi, USB wifi adapter and an 8.8" TFT panel through the Hypnic.

Now, for the 20s timeout. The way the Hypnic works is as follows:
  • When there is a power supply loss, the Hypnic will wait for 2 seconds before it does anything.
  • If the power is restored within those two seconds, this is considered a brownout (rather than a power loss) and the Pi will not be powered off.
  • If the power is not restored within 2 seconds, then the Hypnic will issue a shutdown command to the Pi and the Hypnic will start flashing the connected LED. The Pi will then power down (assuming the software is installed and running). Once the Pi is powered down, it will send a "safe" signal to the Hypnic which will cut the power.
The brownout timer is 2 seconds, and let's assume your Pi takes 12 seconds to power down... 2 + 12 = 14 seconds total time the Hypnic will power the Pi for during power loss.

If you're seeing the power LED go off before 20s then that's good news, it means the Hypnic is working as expected and the Pi is powering off gracefully before the power runs out.

The 20 seconds timer is a safety number. In the event that the Pi doesn't send the "safe" signal (it's dead, the kernel has panicked, the shutdown process is locked, etc.) then the Hypnic will automatically cut the power after 20s. This prevents "bouncing", where the Pi is power cycled every few seconds when the supercapacitor voltages get very low.

I hope that all makes sense, if you have any questions please just ask or PM me.

Phill
 
Switch noise problem

Hi Phill,

Hypnic is working as ti should in my system and operates correctly, only one problem, it's very susceptible to switch noise, any power switches turned on or off in the system (CD, Dac ect) cause the Hypnic to cut power to the pi instantly, no normal shutdown! This is a bit of a problem.
Is there any way to make it less sensitive to switching noise?

Cheers Steve
 
This is what I thought of youth.. I expected watches to be extinct soon as anyone seems to have a smart phone that indicates time perfectly... and what do I see? They buy analog watches.

I tested it out of curiousity. A few were persuaded to try out a headless streamer and an old Sony HAP-S1 that has knobs, IR and an app. They really liked the knobs :D

Considering NAD M10, Cocktail Audio and HiFi Rose devices going the display, knobs/touchscreen way I guess there are enough customers that prefer that. It also seems all in one devices are the future.
I too have similar thoughts - physical touch - knobs / switch’s is nature. Can’t be headless all the time

can’t use a phone or tab every time you ant to change some thing.

ease of use like it was second nature is a need.