No announcement yet.

4dpi-32-II brightness setting

  • Filter
  • Time
  • Show
Clear All
new posts

  • 4dpi-32-II brightness setting

    I'm trying to change the brightness setting on a 4dpi-32-II display attached to a Raspberry PI Zero W

    I'm following this datasheet:

    1. I changed /boot/cmdline.txt to include 4dpi.pwm=1
    2. I reset the raspberry Zero, the display goes blank and doesn't light up at all.
    3. I ssh into the raspberry and try to follow this instruction: echo 80 > /sys/class/backlight/32-hatpwm/brightness
    But /sys/class/backlight/32-hatpwm doesn't exist.

    Instead, I can see /sys/class/brightness/4d-hats/ containing brightness, actual_brightness and max_brightness, among other files.

    max_brightness contains the value 31 and can't be changed.
    I can only change brightness between 0 and 31, but the display doesn't light up at all

    I tried writing to GPIO 18 using the gpio command, but no reaction from the display.

    Is my display broken or am I doing something wrong?

    Am I using the right software package?
    I downloaded this:
    Link is here:

    edit: added links to the software package. And this message. And a typo.
    Last edited by lunardog; 15 July 2018, 02:02 PM.

  • #2

    Welcome to the forum!

    You can use this command to change the brightness of your 4DPi-32-II display:

    sudo sh -c 'echo 31 > /sys/class/backlight/32-hat-pwm/brightness'
    This sets the backlight to 31%. You can vary its value by replacing the number in "echo 31" with a number from 0 to 100.

    Also, the datasheet you are using is already outdated. You can find the latest datasheet on its product page:

    Best Regards,
    Last edited by Kimberly; 17 July 2018, 11:16 AM.


    • #3
      Hello Kimberly,

      Thank you for your help.

      I tried the command you suggested and this is the result I see:
      [email protected]:~ $ sudo sh -c 'echo 31 > /sys/class/backlight/32-hat-pwm/brightness' sh: 1: cannot create /sys/class/backlight/32-hat-pwm/brightness: Directory nonexistent There is no 32-hat-pwm in /sys/class/backlight.

      Is there a newer software package I should use?


      • #4
        Hi again!

        You might be using an outdated kernel package. You have to download the updated one. As stated in the updated datasheet, here's the link:

        I hope this helps!

        Best Regards,
        Last edited by Kimberly; 17 July 2018, 11:12 AM.


        • #5
          Thank you, Kimberly!

          I'll try the software package you suggest ASAP.

          By the way, the datasheet link in the product is updated, but the software package link is still:
 (which relocates the user to 1.0.tar.gz)

          It might benefit everyone to update the product page with the new software package link to avoid confusion of versions...


          • #6
            Hi! No worries!
            We already updated the software package link on the product page.
            If you have further questions, feel free to ask us.

            Best Regards,


            • #7
              Thank you Kimberly! It all works now. I can control display brightness! Very happy.