Bypassing Low Voltage Warning in OctoPrint

Say what now?!

Octoprint has a built-in module “Pi Support” that gives warnings if something’s up with your ‘Pis power supply or if it’s been “throttled” any time since system boot-up.

Very clever … but what happens if your sweet old Raspberry Pi 3+ Model B has a faulty MxL7704 power management chip, say one that reports low 5V_SYS even though it’s fine? Let’s just imagine you’ve already hooked a laboratory voltmeter and scope up to your R’Pi to verify this sad state of affairs.

Here’s a script that will bypass the warning. It should go without saying that using this is NOT a good idea but who am I to judge?

#!/bin/sh
VCGENCMD="/opt/vc/bin/vcgencmd"
ANYTHING_BUT_THROTTLED=`$VCGENCMD $* | sed 's/\(throttled=\).*/\10x0/'`
echo $ANYTHING_BUT_THROTTLED
exit $?

Use your favorite editor to create the script somewhere tidy like ~/scripts/vcgencmd-bypass and make it executable using chmod a+x vcgencmd-bypass.

Now all you have to do is point Settings => Pi Support => Advanced options to this script rather than the default /usr/bin/vcgencmd executable; Like so …


Why you naughty hacker you!

The script allows all vcgencmd commands through, changing only the likes of any throttled=0x50000 output to throttled=0x0.

Now of course, that same faulty chip is going to tell Raspbian to throttle even when it shouldn’t … or is it? Turns out that in my case, the glitch only seems to occur once during boot-up. I am guessing around the time the first I2C initialization event occurs. I have benchmarked the Pi to death trying to get it to produce throttled=0x4 (Currently throttled) with no or should I say only joy.

In case you’re wondering what made me suspect a faulty chip … well that would be connecting a 4 Amp power supply the wrong way around, directly to the PCB, bypassing the fuse etc. That seemed to outright kill the Pi but a few hours later when I plugged it in one last time before trashing it … YIPPEE! It worked again. I guess the cip cooled down? 😛

… or I’ve fallen down some garden path in a comedy of life’s wonderful little errors. shrug. Either way, you’re welcome!

Have fun!

Author: gruvin

Born anatomically male, of a largely uninteresting bipedal, carbon based species, during the ninth moon orbit of the one thousand, nine hundred and seventy first meaningfully recorded solar orbital cycle (according to Gregory) of a small blue planet, situated near the outer edge of a seemingly long forgotten galaxy, located at the precise centre of its universe. In short; — I am. Therefore, I am.

Leave a Reply

Your email address will not be published.