I've been experimenting with a pijuice hat on my 4b. I had been getting pijuice status on the MoodleBox dashboard. I then updated the MoodleBox plugin to the latest 2.16, and I no longer got status. I tried to downgrade to older versions of the plugin, down to 2.14.1, but that didn't work.
Anyway, I found the problem, and it might just be on my distribution. The permission of pijuicestatus.py was not executable. Once I made it executable, it worked just fine. Again, its possible this was just some artifact on my instance.
// Check if PiJuice package is installed.
$pijuicepackage = exec('dpkg-query -W -f=\'${Status}\' pijuice-base 2>/dev/null | grep -c "ok installed"');
// Get PiJuice Status.
if ($pijuicepackage) {
$pijuicestatusjson = exec('bin/pijuicestatus.py');
$pijuicestatus = json_decode($pijuicestatusjson, true);
}
Software versions
Raspberry Pi OS version Debian GNU/Linux 11 (bullseye)
Kernel version Linux 6.1.21-v8+ aarch64
MoodleBox version 4.5.1 (2022-12-30)
MoodleBox plugin version 2.16.0 (2023073000)
Moodle version 4.1+ (Build: 20221229)
file permissions -
root@moodlebox:/var/www/moodle/admin/tool/moodlebox# pwd
/var/www/moodle/admin/tool/moodlebox
root@moodlebox:/var/www/moodle/admin/tool/moodlebox# ls -l bin
total 28
-rw-rw-r-- 1 www-data moodlebox 2123 Aug 22 12:20 changepassword.sh
-rw-rw-r-- 1 www-data moodlebox 10630 Aug 22 12:20 changewifisettings.py
-rw-rw-r-- 1 www-data moodlebox 1086 Aug 22 12:20 changewifisettings.sh
-rwxr-xr-x 1 www-data moodlebox 819 Aug 22 12:20 pijuicestatus.py
-rw-rw-r-- 1 www-data moodlebox 1022 Aug 22 12:20 resizepartition.sh
root@moodlebox:/var/www/moodle/admin/tool/moodlebox#