Navigation

    Recalbox Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • recalbox.com
    • Gitlab repository
    • Documentation
    • Discord

    SOLVED Turning off the TFT screen on the OGST or Cloudshell cases

    Your discoveries
    turning tft ogst cloudshell cases
    3
    5
    213
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Zaphod
      Zaphod last edited by Zaphod

      The TFT screen on the OGST is very bright (especially at night) so I wanted to be able to turn it off since my gameing box is in the bedroom.

      Here are the commands to do just that:

      #Turn the backlight ON
      echo 0 > /sys/class/backlight/fb_ili9340/bl_power
      
      #Turn the backlight OFF
      echo 1 > /sys/class/backlight/fb_ili9340/bl_power
      

      I have written a script that does this for you.

      #!/bin/bash
      
      filename='/sys/class/backlight/fb_ili9340/bl_power'
      read -r state<$filename
      
      if [ "$state" = "0" ]; then
              echo 1 > /sys/class/backlight/fb_ili9340/bl_power
      else
              echo 0 > /sys/class/backlight/fb_ili9340/bl_power
      fi
      
      

      to use the script do the following.

      Log in to your recalbox via SSH
      then use these commands

      cd
      nano backlight
      #copy paste the script into this new document
      ctrl+x then y #this will exit and save the document
      chmod +x backlight #make the script executable
      
      

      To use the script simply type ./backlight to toggle the TFT backlight on and off

      I am hoping backlight control can be built in to the next version.

      FOR DEVELOPERS

      This is the command to turn off all backlights if you want to include a universal backlight control in the next version

      # Turn off backlight
      echo 1 | tee /sys/class/backlight/*/bl_power
      
      # Turn on backlight
      echo 0 | tee /sys/class/backlight/*/bl_power
      
      1 Reply Last reply Reply Quote 1
      • Zaphod
        Zaphod last edited by

        A slightly better version of the script that accepts 'on' and 'off' arguments. If no argument is given it toggles the backlight state

        #!/bin/bash
        
        filename='/sys/class/backlight/fb_ili9340/bl_power'
        read -r state<$filename
        
        if [ "$1" = "off" ]; then
                echo 1 > /sys/class/backlight/fb_ili9340/bl_power
        elif [ "$1" = "on" ]; then
                echo 0 > /sys/class/backlight/fb_ili9340/bl_power
        else
                echo "This command accepts the following arguments"
                echo "on - turns the backlight on"
                echo "off - turns the backlight off"
                echo "If no argument is given the backlight will toggle"
                echo "No state selcted, toggling."
                if [ "$state" = "0" ]; then
                        echo 1 > /sys/class/backlight/fb_ili9340/bl_power
                else
                        echo 0 > /sys/class/backlight/fb_ili9340/bl_power
                fi
        fi
        
        paradadf 1 Reply Last reply Reply Quote 0
        • paradadf
          paradadf Staff
          Developer
          Team
          Global moderator
          Translator
          @Zaphod
          last edited by

          @Zaphod hi and thank you for your script! I‘d suggest you to please open an issue on gitlab and add your script there with the explanation. Gitlab is the platform for development and just having it here, although useful for the community, has the risk of getting forgotten.

          If your question was answered, please mark it as solved: Topic Tools -> Ask a question + Topic Tools -> Mark as Solved

          1 Reply Last reply Reply Quote 1
          • ian57
            ian57 Staff
            Developer
            Global moderator
            Creator
            Team
            last edited by

            @Zaphod @paradadf this feature is already included in the next release of RB. See https://gitlab.com/recalbox/recalbox/-/blob/master/board/recalbox/fsoverlay/recalbox/scripts/miniTFTSupport.sh line 163 🙂

            "UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity." Dennis Ritchie

            Zaphod 1 Reply Last reply Reply Quote 1
            • Zaphod
              Zaphod @ian57 last edited by Zaphod

              @ian57 I guess great minds think alike. I do have a suggestion for that script but I will make it in gitlab

              1 Reply Last reply Reply Quote 1
              • First post
                Last post

              Want to support us ?

              95
              Online

              88.3k
              Users

              26.2k
              Topics

              179.9k
              Posts

              Copyright © 2021 recalbox.com