Hello,
I have setup my BrainCraft HAT by following the instruction and the TFT 1.54" display works well.
Now I want to know how can I turn off the TFT diaplay and re-use the HDMI display? And is there a way that the TFT display can be disabled automatically when I connect to a HDMI display? Thanks.
Regards,
Leo
How disable the TFT 1.54" display on the BrainCraft HAT
Moderators: adafruit_support_bill, adafruit
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
- leolee8774
- Posts: 1
- Joined: Wed Apr 14, 2021 9:26 pm
- mikeysklar
- Posts: 13936
- Joined: Mon Aug 01, 2016 8:10 pm
Re: How disable the TFT 1.54" display on the BrainCraft HAT
Leo,
Good question. I've not seen a way to detect the HDMI monitor presence so that you can automate this process. However, here are some things you can try.
This python script shoudl disable the display backlight on the BrainCraft TFT.
Does anything show up from dmesg or or other system log files as you insert the HDMi cable into your Pi? If so, you could setup a script that monitors the log file and calls the above python code. Hacky, I know,
Good question. I've not seen a way to detect the HDMI monitor presence so that you can automate this process. However, here are some things you can try.
This python script shoudl disable the display backlight on the BrainCraft TFT.
Code: Select all
# Turn on the Backlight
backlight = DigitalInOut(board.D26)
backlight.switch_to_output()
backlight.value = True
- marc_woohoo
- Posts: 1
- Joined: Wed Apr 28, 2021 12:37 pm
Re: How disable the TFT 1.54" display on the BrainCraft HAT
mikeysklar
I'm also trying to figure out how to use my external monitor instead of the tiny TFT 1.54 display. I've tried running your python script, but nothing happened. Is there any other workaround I could try?
I'm also trying to figure out how to use my external monitor instead of the tiny TFT 1.54 display. I've tried running your python script, but nothing happened. Is there any other workaround I could try?
- mikeysklar
- Posts: 13936
- Joined: Mon Aug 01, 2016 8:10 pm
Re: How disable the TFT 1.54" display on the BrainCraft HAT
The BrainCraft HAT has pretty much the same LCD setup as the 1.3" TFT Bonnet for a Pi. You should be able to follow those instructions to set the BrainCraft HAT to boot to console and as long as your HDMI cable is plugged in at boot your monitor should be your main display.
https://learn.adafruit.com/adafruit-1-3 ... le-install
Code: Select all
cd ~
sudo pip3 install --upgrade adafruit-python-shell click==7.0
sudo apt-get install -y git
git clone https://github.com/adafruit/Raspberry-Pi-Installer-Scripts.git
cd Raspberry-Pi-Installer-Scripts
sudo python3 adafruit-pitft.py --display=st7789_240x240 --rotation=0 --install-type=console
- geekguy
- Posts: 304
- Joined: Tue Sep 10, 2013 2:43 pm
Re: How disable the TFT 1.54" display on the BrainCraft HAT
Hi,
Your script does not get the desired results. Nothing goes to HDMI. Did you test this script?
8-Dale
Your script does not get the desired results. Nothing goes to HDMI. Did you test this script?
8-Dale
- mikeysklar
- Posts: 13936
- Joined: Mon Aug 01, 2016 8:10 pm
Re: How disable the TFT 1.54" display on the BrainCraft HAT
8-dale,
I've never run this with the Braincraft, but we use this script on all our PiTFTs.
Go ahead and post your /boot/config.txt and we will take a look at override options.
I've never run this with the Braincraft, but we use this script on all our PiTFTs.
Go ahead and post your /boot/config.txt and we will take a look at override options.
- geekguy
- Posts: 304
- Joined: Tue Sep 10, 2013 2:43 pm
Re: How disable the TFT 1.54" display on the BrainCraft HAT
OK, here it is.mikeysklar wrote:Go ahead and post your /boot/config.txt and we will take a look at override options.
8-Dale
- Attachments
-
- brainy.config.txt
- This is config.txt from the rPi 4 I have the Braincraft HAT on.
- (2.11 KiB) Downloaded 5 times
- mikeysklar
- Posts: 13936
- Joined: Mon Aug 01, 2016 8:10 pm
Re: How disable the TFT 1.54" display on the BrainCraft HAT
8-Dale,
Can you comment out the Adafruit section that our script adds-in at the end of /boot/config.txt?
Then boot from HDMI to confirm that all works correctly. I think in this scenario you are going to have to use two seperate /boot/config.txt files one without the piTFT code and another with it that you switch between to use the display or HDMI.
Can you comment out the Adafruit section that our script adds-in at the end of /boot/config.txt?
Code: Select all
# --- added by adafruit-pitft-helper Sun May 16 23:18:59 2021 ---
hdmi_force_hotplug=1
dtparam=spi=on
dtparam=i2c1=on
dtparam=i2c_arm=on
dtoverlay=drm-minipitft13,rotate=0,fps=60
# --- end adafruit-pitft-helper Sun Ma
- geekguy
- Posts: 304
- Joined: Tue Sep 10, 2013 2:43 pm
Re: How disable the TFT 1.54" display on the BrainCraft HAT
I did that and I do not get a display on HDMI or the TFT. So, I uncommented that section, rebooted, and am back to the TFT being my only display. I have to SSh in to brainy in order to do anything on it.mikeysklar wrote:Can you comment out the Adafruit section that our script adds-in at the end of /boot/config.txt?
8-Dale
- mikeysklar
- Posts: 13936
- Joined: Mon Aug 01, 2016 8:10 pm
Re: How disable the TFT 1.54" display on the BrainCraft HAT
Okay, we should be able to get HDMI going by keeping the Adafruit TFT lines at the bottom commented out. Then proceed to uncomment these lines forcing a safe strong HDMI signal.
Code: Select all
hdmi_safe=1
hdmi_drive=2
config_hdmi_boost=4
- geekguy
- Posts: 304
- Joined: Tue Sep 10, 2013 2:43 pm
Re: How disable the TFT 1.54" display on the BrainCraft HAT
OK, this is working, but not completely. I do have everything going to HDMI now. That is good, however, I am not getting the entire screen and the first few characters are cut off. I do not have use of the whole HDMI screen - just part right in the middle that has a grey background.mikeysklar wrote:Okay, we should be able to get HDMI going by keeping the Adafruit TFT lines at the bottom commented out. Then proceed to uncomment these lines forcing a safe strong HDMI signal.
Code: Select all
hdmi_safe=1 hdmi_drive=2 config_hdmi_boost=4
Progress!
8-Dale
- mikeysklar
- Posts: 13936
- Joined: Mon Aug 01, 2016 8:10 pm
Re: How disable the TFT 1.54" display on the BrainCraft HAT
Glad to hear it.
You might be able to move the safe line. I suspect that is reducing resolution and causing the cutoff.
You can run adjust the resolution from a terminal:
I think the above might save a resolution to your /boot/config.txt (not positive), but the idea here is too have an config-hdmi.txt and config-braincraft.txt that you can switch between with a manual reboot. Hardly ideal, but a start.
You might be able to move the safe line. I suspect that is reducing resolution and causing the cutoff.
Code: Select all
hdmi_safe=1
Code: Select all
sudo raspi-config
Display Options
Resolution
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/