Hyperpixel 4.0 + PiJuice HAT

I’ve had some success with using the HyperPixel 4.0 with the PiJuice HAT (and the PiJuice Zero pHAT).

To use the HP4 with the PJ, the missing electronic piece is to add +5V/GND header to the underside of the Pi’s (3b+) GPIO pins 4 & 6, which is not easy to do.

Once this is done, the I2C pins on the HyperPixel (+3.3V, SDA, SCL, GND) can be connected to the PiJuice GPIO pins 1, 3, 5 and 9 respectively, and the Pi’s GPIO 4&6 to the PiJuice GPIO 4&6 (don’t get them the wrong way around!).

One more step, set the PiJuice BUS from 1 (default) to 3 (via the HyperPixel), leave the bus address to 0x14. Depending on how you’re using the PiJuice, you may need to modify this in the python code.

/usr/bin/pijuice_sys.py  # the important one
/usr/bin/pijuice_tray.py # desktop
/usr/bin/pijuice_gui.py  # desktop GUI

Setting the battery profile was annoying, since the CLI doesn’t work with the non-default I2C (even with a symlink in place) and the Python GUI apply button falls below the display area on the HP4, so can’t be pressed.

The workaround was to set it manually from python:

import pijuice
pj_i2cBUS = 3
pj = pijuice.PiJuice(pj_i2cBUS , 0x14)
print(f"Setting battery profile to {pj.config.batteryProfiles[2]}")
pj.config.SetBatteryProfile(pj.config.batteryProfiles[2]) 

I haven’t been able to get the RTC (ds1339) working however, since the dtoverlays don’t expect it on i2c-3. Ths symbolic link that is suggested doesn’t seem to work for this, and I’ve had no luck with dtoverlays (i2c-gpio-rtc, or even making my own with target=<&i2c3>; dtbo). Any help appreciated!

NOTE - I’ve added my RTC issue as it’s own topic