PiTFT 2.8" capacitive with FBCP on Raspberry Pi B+

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/
Locked
User avatar
ProfessorMeowington
 
Posts: 11
Joined: Tue May 23, 2023 9:29 am

PiTFT 2.8" capacitive with FBCP on Raspberry Pi B+

Post by ProfessorMeowington »

Hello, I tried to get frame buffer copy to work on my Raspberry Pi B+, with the official Raspberry OS installer and Buster. I updated everything, installed git and downloaded the repo, according to the Adafruit guide. Then I ran the command "sudo python3 adafruit-pitft.py --display=28r --rotation=90 --install-type=fbcp" which executed successfully. But after rebooting the PiTFT screen remains black. The HDMI output works, and the resolution is changed to a low resolution. Any idea why it's not outputting anything on the display? The display itself worked, when I tried one of the older pre-installed images from Adafruit. Thanks!

Also, why do the PiTFT backlights remain on after shutting down the raspberry?

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: PiTFT 2.8" capacitive with FBCP on Raspberry Pi B+

Post by mikeysklar »

You have the capacitive touch display, but you passed it the resistive touch argument to -display of 28r versus 28c.

Run the adafruit-pitft script again with capacitive touch arguments. Also if it continues to not work please paste in the relevant lines of /boot/config.txt. It should look something like this:

Code: Select all

dtoverlay=pitft28-capacitive,rotate=90,speed=64000000,fps=30
dtoverlay=pitft28-capacitive,touch-swapxy=true,touch-invx=true

User avatar
ProfessorMeowington
 
Posts: 11
Joined: Tue May 23, 2023 9:29 am

Re: PiTFT 2.8" capacitive with FBCP on Raspberry Pi B+

Post by ProfessorMeowington »

mikeysklar wrote: Fri Jun 02, 2023 6:33 pm You have the capacitive touch display, but you passed it the resistive touch argument to -display of 28r versus 28c.

Run the adafruit-pitft script again with capacitive touch arguments. Also if it continues to not work please paste in the relevant lines of /boot/config.txt. It should look something like this:

Code: Select all

dtoverlay=pitft28-capacitive,rotate=90,speed=64000000,fps=30
dtoverlay=pitft28-capacitive,touch-swapxy=true,touch-invx=true
Hello, thank you for the reply. Actually I'm not 100% sure whether the display I have is capacitive or resistive, because it doesn't say anywhere as far as I can tell.

Nevertheless, I have now tried the script with both the 28r and 28c arguments, and checked the /boot/config.txt/ file, the 28c argument already added those lines (only difference was that rotate=90 was on the 2nd line instead of the first). The 28r installer argument only added the first line (but with "pitft28-resistive"), adding the second one manually didn't solve the issue. Anything else that could be missing?

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: PiTFT 2.8" capacitive with FBCP on Raspberry Pi B+

Post by mikeysklar »

It is possible that a buster update occurred that is causing an issue. Normally it is pretty stable since it is a release back from the current Bullseye. I checked the adafruit-pitft.py script history / issue and did not see any matching problems with the 2.8”.

It would be really helpful if you can check for which model you have using the e-mail receipt that Adafruit sends upon purchase, pink bag the product is enclosed in or invoice that is included with packaging.

What is the output of:

Code: Select all

dmesg | grep fb
Do do the framebuffer devices get created?

Code: Select all

ls /dev/fb*
Are you running the 32-bit Desktop version of Bullseye or something else?

User avatar
ProfessorMeowington
 
Posts: 11
Joined: Tue May 23, 2023 9:29 am

Re: PiTFT 2.8" capacitive with FBCP on Raspberry Pi B+

Post by ProfessorMeowington »

Unfortunately I don't have any receipt or anything like that because I got the screen as a gift from my colleagues ages ago, but as a test I tried both PiTFT Jessie images from the Adafruit website, the one for resistive screens was working, the one for capacitive screens was just displaying an image, but the touch wasn't working, so I think it's safe to assume I have the resistive screen.

I am running the Raspbian Debian Buster legacy release (that you can select in their Raspberry Pi Imager):
Operating System: Raspbian GNU/Linux 10 (buster)
Kernel: Linux 5.10.103+
Architecture: arm
screenshot-raspbian-imager.png
screenshot-raspbian-imager.png (17.6 KiB) Viewed 280 times
I ran both of the commands, here are the results:

Code: Select all

[    0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
[    0.000000] Kernel command line: coherent_pool=1M snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=640 bcm2708_fb.fbheight=480 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000  console=ttyAMA0,115200 console=tty1 root=PARTUUID=7ae95662-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
[    2.300466] bcm2708_fb soc:fb: FB found 1 display(s)
[    2.314195] bcm2708_fb soc:fb: Registered framebuffer for display 0, size 640x480
[   56.406934] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[   56.584441] fb_ili9340: module is from the staging directory, the quality is unknown, you have been warned.
[   56.586004] fb_ili9340 spi0.0: fbtft_property_value: buswidth = 8
[   56.586054] fb_ili9340 spi0.0: fbtft_property_value: debug = 0
[   56.586081] fb_ili9340 spi0.0: fbtft_property_value: rotate = 90
[   56.586111] fb_ili9340 spi0.0: fbtft_property_value: fps = 25
[   59.644654] graphics fb1: fb_ili9340 frame buffer, 320x240, 150 KiB video memory, 4 KiB buffer memory, fps=25, spi0.0 at 32 MHz
And the other command shows the following:

Code: Select all

dev/fb0  /dev/fb1
I believe the last command I ran was the one for intalling FBCP for a resistive display...

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: PiTFT 2.8" capacitive with FBCP on Raspberry Pi B+

Post by mikeysklar »

Thank you for the output and confirming this is a resistive display that works with Jessie.

Based on the dmesg line it looks like this display is showing up as /dev/fb1.

# dmesg output you provided…snippit.

Code: Select all

graphics fb1: fb_ili9340 frame buffer, 320x240, 
So you can modify the /boot/config.txt to get output to the correct framebuffer (1 instead of 0) and switch X-windows to start on this PiTFT if you prefer.
First up, we'll update the boot configuration file to use the TFT framebuffer /dev/fb1 instead of the HDMI/TV framebuffer /dev/fb0

sudo nano /boot/cmdline.txt
you can also edit it by putting the SD card into a computer and opening the same file.

At the end of the line, find the text that says rootwait and right after that, enter in:
fbcon=map:10 fbcon=font:VGA8x8 then save the file.
See Console Configuration section of guide.

Code: Select all

 sudo mv /usr/share/X11/xorg.conf.d/99-fbturbo.conf ~
export FRAMEBUFFER=/dev/fb1
startx

User avatar
ProfessorMeowington
 
Posts: 11
Joined: Tue May 23, 2023 9:29 am

Re: PiTFT 2.8" capacitive with FBCP on Raspberry Pi B+

Post by ProfessorMeowington »

Hello, after I was messing around with the two other images, to check if it's resistive or capacitive, I flashed the legacy OS again to my SD card. This time however, I didn't tick the box "This display shows a black border around the screen" (or similar) during the first launch. I ran the script like last time, for the resistive image.
I'm not sure if that checkbox is what made the difference, but now it's actually working! The touch is working, I get a picture on both the display and my HDMI monitor. Just the resolution seems to be higher than what the screen can handle, I'll need to change to 320x240. Thank you for the help.

P.S. is there a way to turn off the display backlight after turning off the OS?

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: PiTFT 2.8" capacitive with FBCP on Raspberry Pi B+

Post by mikeysklar »

Interesting that the black border checkbox might be making a difference.

There are a lot of options for adjusting the backlight.

User avatar
ProfessorMeowington
 
Posts: 11
Joined: Tue May 23, 2023 9:29 am

Re: PiTFT 2.8" capacitive with FBCP on Raspberry Pi B+

Post by ProfessorMeowington »

Hello again,

after some more testing it turns out that it actually didn't have to do with the borders, it was just a coincidence. The culprit is booting the Raspberry with the HDMI cable plugged in. If I do that, only the HDMI output will work, and the touch, but the display won't show anything. If I boot without a cable connected, everything will work as expected (if I plug in the cable only once the display is showing something). Any idea what could be causing this?

Here are

Code: Select all

dmesg | grep fb
and

Code: Select all

ls /dev/fb*
once more, from the case where it isn't working. I did the same test for both cases, and the only difference I can see is that it takes 20 seconds longer with a cable connected, i.e. [ 58.746649] would be 38 something without the HDMI cable.

Code: Select all

[    0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
[    0.000000] Kernel command line: coherent_pool=1M snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=640 bcm2708_fb.fbheight=480 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000  console=ttyAMA0,115200 console=tty1 root=PARTUUID=c63c1b7c-02 rootfstype=ext4 fsck.repair=yes rootwait fbcon=map:10 fbon=font:VGA8x8 quiet splash plymouth.ignore-serial-consoles
[    2.300652] bcm2708_fb soc:fb: FB found 1 display(s)
[    2.314415] bcm2708_fb soc:fb: Registered framebuffer for display 0, size 640x480
[    3.594853]     fbon=font:VGA8x8
[   58.746649] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[   59.082057] fb_ili9340: module is from the staging directory, the quality is unknown, you have been warned.
[   59.083470] fb_ili9340 spi0.0: fbtft_property_value: buswidth = 8
[   59.083521] fb_ili9340 spi0.0: fbtft_property_value: debug = 0
[   59.083550] fb_ili9340 spi0.0: fbtft_property_value: rotate = 90
[   59.083579] fb_ili9340 spi0.0: fbtft_property_value: fps = 30
[   63.323609] graphics fb1: fb_ili9340 frame buffer, 320x240, 150 KiB video memory, 4 KiB buffer memory, fps=33, spi0.0 at 64 MHz
and

Code: Select all

/dev/fb0  /dev/fb1

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: PiTFT 2.8" capacitive with FBCP on Raspberry Pi B+

Post by mikeysklar »

Can you post the full config.txt you are using?

Are you booting directly into X-Windows (config.txt - start_x=1)?

Which KMS driver is being used (fake or real)?

User avatar
ProfessorMeowington
 
Posts: 11
Joined: Tue May 23, 2023 9:29 am

Re: PiTFT 2.8" capacitive with FBCP on Raspberry Pi B+

Post by ProfessorMeowington »

Hello,

here is the file I am using:

Code: Select all

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group=2
hdmi_mode=87

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
#dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d


# --- added by adafruit-pitft-helper Sun Jun 18 22:53:45 2023 ---
[all]
hdmi_force_hotplug=1
dtparam=spi=on
dtparam=i2c1=on
dtparam=i2c_arm=on
dtoverlay=pitft28-resistive,rotate=90,speed=64000000,fps=30
# --- end adafruit-pitft-helper Sun Jun 18 22:53:45 2023 ---

hdmi_cvt=640 480 60 1 0 0 0
It's pretty much a clean Buster installation. I haven't edited anything manually in the config.txt file, everything is default except the stuff that was added by the Adafruit installer script.

It doesn't seem I am using start_x=1 in my config file, but it does boot automatically into the graphical interface, if that's what you are asking about. That's the image I chose when I used the Raspberry OS imager tool.

I'm not sure what the KMS driver is, but it's pretty safe to assume I have the one which is default, because I haven't manually changed anything.

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: PiTFT 2.8" capacitive with FBCP on Raspberry Pi B+

Post by mikeysklar »

Earlier in this thread the dmesg output show that you had a display that can do 320x240. If you change the last line of the /boot/config.txt from this:

Code: Select all

hdmi_cvt=640 480 60 1 0 0 0
to this:

Code: Select all

hdmi_cvt=320 240 60 1 0 0 0
Does that change the behavior in that the TFT and HDMI screen are both on simultaneously?

This is the commented out FAKE kms driver in your /boot/config.txt. You can try uncommenting, but do it in its own separate experiment (with reboot) than the resolution change I suggested above.

Code: Select all

#dtoverlay=vc4-fkms-v3d

User avatar
ProfessorMeowington
 
Posts: 11
Joined: Tue May 23, 2023 9:29 am

Re: PiTFT 2.8" capacitive with FBCP on Raspberry Pi B+

Post by ProfessorMeowington »

Hello, changing the resolution to hdmi_cvt=320 240 60 1 0 0 0 made the display not work at all, and the HDMI output didn't work either, no matter what I tried. I had to revert in the end. The FAKE kms driver didn't change anything, but I'm wondering if I have to remove the other dtoverlay line, isn't it overwriting the driver?

I'm thinking I'll just have to live with how it is, I've already invested way more time into this issue than I wanted, it's really frustrating...

Locked
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/

Return to “Adafruit Raspberry Pi® accessories”