HyperPixel 2.1 Round Display Support

Hey all, I’m trying to get this display working with Balena OS, together with the browser block. Disclaimer: I’m still very new to Balena.

Since the device overlays for the hyperpixel2r are not yet available in Balena OS, I compiled them on my Mac OS X to the .dtbo format and then copied it before provisioning the device into /mnt/overlays. You need to do this straight after flashing the image, otherwise it won’t be persisted.

Based on this comment, I then based most of my next steps.

I successfully ran the ./dist/hyperpixel2r-init script from a python container. I also added the I2C interface based on this documentation.

FROM balenalib/%%BALENA_MACHINE_NAME%%-python:3-buster-build

# Defines our working directory in container
WORKDIR /usr/src/app

RUN pip install --no-cache-dir RPi.GPIO

# This will copy all files in our root to the working  directory in the container
COPY . ./

# Enable udevd so that plugged dynamic hardware devices show up in our container.

CMD modprobe i2c-dev && python3 ./dist/hyperpixel2r-init

my docker-compose.yml is…

version: '2'
    build: ./display
    restart: on-failure
    privileged: true # required for UDEV to find plugged in peripherals such as a USB mouse
      - "/dev/i2c-1:/dev/i2c-1"
      - "/dev/mem:/dev/mem"
      - "/dev/ttyACM0:/dev/ttyACM0"
      - SYS_RAWIO
      io.balena.features.kernel-modules: '1'
    restart: always
    image: balenablocks/browser
    privileged: true # required for UDEV to find plugged in peripherals such as a USB mouse
    network_mode: host
      - display

I also added the configs I found in the install.sh as BALENA_HOST_CONFIG_* custom configuration variables as well as the DT params and overlays I think are required, but potentially too many:

Interesting logs:

[    1.826947] bcm2708_fb soc:fb: FB found 1 display(s)
[    1.838791] Console: switching to colour frame buffer device 60x30
[    1.840694] bcm2708_fb soc:fb: Registered framebuffer for display 0, size 480x480

Display seems to be recognised, although I have no clue if the above logs imply that the display is ready to display data.

browser service logs
18.04.22 13:26:08 (+0200)  browser  xauth:  file /home/chromium/.Xauthority does not exist
18.04.22 13:26:08 (+0200)  browser  xauth: (stdin):1:  bad display name "5291aa2:0" in "add" command

The browser cannot add the display, any ideas how to debug this?

[    6.848092] pinctrl-bcm2835 fe200000.gpio: pin gpio2 already requested by fe804000.i2c; cannot claim for rpi_backlight
[    6.848112] pinctrl-bcm2835 fe200000.gpio: pin-2 (rpi_backlight) status -22
[    6.848122] pinctrl-bcm2835 fe200000.gpio: could not request pin 2 (gpio2) from group gpio2  on device pinctrl-bcm2711
[    6.848131] gpio-backlight rpi_backlight: Error applying setting, reverse things back

There’s a conflict with another I2C thingy that wants to use the same pins. Haven’t gotten around that yet, any ideas? I tried to find out what fe804000 is, but had no luck…

Here is my complete dmesg. There’s a lot going on in there; I’m sure someone experienced with this could find some more hints in it :smiley:

root@5291aa2:~# dmesg.txt (26.6 KB)

My goal is to get the display running and eventually displaying some output from the browser block on it.

Thanks a lot and I hope I make sense :slight_smile:

Hello @paolofalco that’s an interesting display and with a bit of trial and error hopefully you can get it working. Just a few questions and notes:

Which device type (from your dmesg file it looks like a Pi 4?) and version of balenaOS are you using? (As a side note, when you build the overlays you need to make sure to target the exact Linux kernel version, which in your case looks like 5.10.83)

For the Pi, as long as you have i2c_arm=on you no longer need to modprobe i2c-dev (Looks like we may need to update the documentation on that) However, the display documentation states that the Hyperpixel uses DPI on the Pi’s GPIO pins, so you may want to experiment with not enabling I2C at all, which may eliminate that conflict error.

Since your display service is privileged, you should not need to map devices or use cap_add

We have a balena project that uses the square Hyperpixel here: GitHub - balena-io-playground/pixel-buddy that may give you some additional ideas.

Hey @alanb128

Nice one, thanks for the reply. Indeed, it magically started to work when I removed all the I2C related stuff :slight_smile:

As regards your question, yes I’m using the RPi 4. Building the .dtbo on Mac OS seemed to work after all :smiley: Touch works too!

Thanks a lot for the help.



BTW, I had to run modprobe edt-ft5x06 to get touch working as indicated here.

1 Like

Thanks for sharing @paolofalco :call_me_hand: