texy
Forum Moderator
Forum Moderator
Posts: 5003
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

2.8" TFT + Touch Shield Board v2

Wed Jan 01, 2014 5:05 pm

Placeholder for the 2.8" TFT Touch Shield v2 instructions.
UPDATED 29/03/2015
Update - fbtft has now been included in the latest raspbian image and uses Device Tree - see this thread on how to configure the very latest raspbian os
http://www.raspberrypi.org/forums/viewt ... 5&t=105797

UPDATED 23/09/2014

The extremely talented notro has beening working hard to produce a raspbian based image that has the drivers built into the kernel.
This means that the console output goes to the TFT display much sooner into the boot sequence. Also he has created a ready-made image for you to download so that you do not need to go through the configuration procedure below ;)
The image came be downloaded from here :
http://tronnes.org/downloads/2014-06-20 ... -hy28b.zip
Notes and further setup details can be found here :
https://github.com/notro/fbtft-spindle/wiki/FBTFT-image
Slightly updated python test program (remember to run sudo ts_calibrate before running :
sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/event0 ts_calibrate) :

Code: Select all

#!/usr/bin/python
# touchv7
# Texy 5/2/2014

import pygame, sys, os, time
from pygame.locals import *

#from evdev import InputDevice, list_devices
#devices = map(InputDevice, list_devices())
#eventX=""
#for dev in devices:
#    if dev.name == "ADS7846 Touchscreen":
#        eventX = dev.fn
#print eventX

#os.environ["SDL_FBDEV"] = "/dev/fb1"
#os.environ["SDL_MOUSEDRV"] = "TSLIB"
#os.environ["SDL_MOUSEDEV"] = eventX

pygame.init()

# set up the window
screen = pygame.display.set_mode((320, 240), 0, 32)
pygame.display.set_caption('Drawing')

# set up the colors
BLACK = (  0,   0,   0)
WHITE = (255, 255, 255)
RED   = (255,   0,   0)
GREEN = (  0, 255,   0)
BLUE  = (  0,   0, 255)
CYAN  = (  0, 255, 255)
MAGENTA=(255,   0, 255)
YELLOW =(255, 255,   0)
 
# Fill background
background = pygame.Surface(screen.get_size())
background = background.convert()
background.fill(WHITE)
box = pygame.draw.rect(background, YELLOW,(40, 0, 40, 240))
box = pygame.draw.rect(background,  CYAN, (80, 0, 40, 240))
box = pygame.draw.rect(background, GREEN, (120, 0, 40, 240))
box = pygame.draw.rect(background,MAGENTA,(160, 0, 40, 240))
box = pygame.draw.rect(background, RED,   (200, 0, 40, 240))
box = pygame.draw.rect(background, BLUE  ,(240, 0, 40, 240))
box = pygame.draw.rect(background, BLACK ,(280, 0, 40, 240))

# Display some text
font = pygame.font.Font(None, 36)
text = font.render("Touch here to quit", 1, (BLACK))
#text = pygame.transform.rotate(text,270) 
textpos = text.get_rect(centerx=background.get_width()/2,centery=background.get_height()/2)
background.blit(text, textpos)

screen.blit(background, (0, 0))
pygame.display.flip()

running = True
# run the game loop
while running:
    for event in pygame.event.get():
        if event.type == QUIT:
            pygame.quit()
            sys.exit()
            running = False  
        elif event.type == pygame.MOUSEBUTTONDOWN:
            print("Pos: %sx%s\n" % pygame.mouse.get_pos())
            if textpos.collidepoint(pygame.mouse.get_pos()):
                pygame.quit()
                sys.exit()
                running = False
        elif event.type == KEYDOWN and event.key == K_ESCAPE:
            running = False
    pygame.display.update()

Old instructions left here for those that prefer that method.
As always many thanks to Notro for the excellent fbtft drivers, without which these products would not exist.
This new version 2 board was required because the original HY28A display has been discontinued and replaced by the HY28B. Although no major performance improvements exist, it is wired differently, so required a new pcb layout. The display board now uses the ili9325 control chip and also the touch panel is mounted 180 degrees out compared to the HY28A.

Screen and TP use hardware SPI ( SLCK, MOSI, MISO, CE0 & CE1 ) plus 3 additional GPIO lines ( GPIO17, GPIO18 & GPIO25 ), keeping the other GPIO lines free for other uses - the pcb has a 'breakout' GPIO port to connect too.

It is recommended to use the latest raspbian image of 2013-12-20.

# Expand root filesystem

Code: Select all

sudo raspi-config
# Enable SPI

Code: Select all

sudo nano /etc/modprobe.d/raspi-blacklist.conf
and place a # in front of the SPI line:

Code: Select all

#blacklist spi-bcm2708
# Need to install the latest rpi-update like this, or else the REPO_URI variable gets overwritten

Code: Select all

sudo wget https://raw.github.com/Hexxeh/rpi-update/master/rpi-update -O /usr/bin/rpi-update && sudo chmod +x /usr/bin/rpi-update
# Move or delete this directory, or else the new will be copied on top of the old and the kernel will complain about the leftover backlight.ko
# Issue: https://github.com/Hexxeh/rpi-update/issues/106

Code: Select all

sudo mv /lib/modules/$(uname -r) /lib/modules/$(uname -r).bak
# Install and restart the pi

Code: Select all

sudo REPO_URI=https://github.com/notro/rpi-firmware rpi-update
sudo shutdown -r now
Power down the pi, fit the display shield and repower the pi. Once rebooted 'modprobe' the modules to configure the screen :

Code: Select all


sudo modprobe fbtft dma
sudo modprobe fbtft_device name=hy28b rotate=90
At this point, the screen will go from white to black - the display has been successfully initialised.

Then to configure the touch panel

Code: Select all

sudo modprobe ads7846_device pressure_max=255 y_min=190 y_max=3850 gpio_pendown=17 x_max=3850 x_min=230 x_plate_ohms=100 swap_xy=1 verbose=3
Alternatively, to make the modules permanent after reboots, modify the /etc/module file :

Code: Select all

sudo nano /etc/modules
and add :

Code: Select all

fbtft dma
fbtft_device name=hy28b rotate=90
ads7846_device pressure_max=255 y_min=190 y_max=3850 gpio_pendown=17 x_max=3850 x_min=230 x_plate_ohms=100 swap_xy=1 verbose=3
After a reboot the display and touchscreen will be initialised. To check, type dmesg and the following lines should be included :

Code: Select all

[   13.256262] fbtft_device:  SPI devices registered:
[   13.262834] fbtft_device:      spidev spi0.0 500kHz 8 bits mode=0x00
[   13.271064] fbtft_device:      spidev spi0.1 500kHz 8 bits mode=0x00
[   13.279202] fbtft_device:  'fb' Platform devices registered:
[   13.286533] fbtft_device:      bcm2708_fb id=-1 pdata? no
[   13.293632] fbtft_device: Deleting spi0.0
[   13.302483] fbtft_device:  GPIOS used by 'hy28b':
[   13.323198] fbtft_device:    'reset' = GPIO25
[   13.329223] fbtft_device:    'led' = GPIO18
[   13.343131] fbtft_device:  SPI devices registered:
[   13.349540] fbtft_device:      spidev spi0.1 500kHz 8 bits mode=0x00
[   13.373288] fbtft_device:      fb_ili9325 spi0.0 48000kHz 8 bits mode=0x03
[   13.547463]
[   13.547463]
[   13.547463] ads7846_device: ads7846_device_init()
[   13.573097] ads7846_device: SPI devices registered:
[   13.579447] ads7846_device:    spidev spi0.1 500kHz 8 bits mode=0x00
[   13.603051] ads7846_device:    fb_ili9325 spi0.0 48000kHz 8 bits mode=0x03
[   13.611323] ads7846_device:
[   13.633024] ads7846_device: Settings:
[   13.638027] ads7846_device:   model = 7846
[   13.653035] ads7846_device:   gpio_pendown = 17
[   13.658833] ads7846_device:   swap_xy = 1
[   13.673041] ads7846_device:   x_min = 230
[   13.678301] ads7846_device:   x_max = 3850
[   13.693042] ads7846_device:   y_min = 190
[   13.698259] ads7846_device:   y_max = 3850
[   13.713035] ads7846_device:   x_plate_ohms = 100
[   13.718840] ads7846_device:   pressure_min = 0
[   13.733041] ads7846_device:   pressure_max = 255
[   13.738817] ads7846_device:   keep_vref_on = 1
[   13.763023] ads7846_device:   vref_delay_usecs = 0
[   13.768933] ads7846_device:   vref_mv = 0
[   13.782789] ads7846_device:   settle_delay_usecs = 0
[   13.791975] ads7846_device:   penirq_recheck_delay_usecs = 0
[   13.810204] ads7846_device:   y_plate_ohms = 0
[   13.823074] ads7846_device:   debounce_max = 0
[   13.828615] ads7846_device:   debounce_tol = 0
[   13.853057] ads7846_device:   debounce_rep = 0
[   13.858615] ads7846_device: Deleting spi0.1
[   13.873570] ads7846_device: SPI devices registered:
[   13.879570] ads7846_device:    fb_ili9325 spi0.0 48000kHz 8 bits mode=0x03
[   13.903090] ads7846_device:    ads7846 spi0.1 2000kHz 8 bits mode=0x00
[   13.910789] ads7846_device:
[   14.567335] graphics fb1: fb_ili9325 frame buffer, 320x240, 150 KiB video mem                                                                                        ory, 4 KiB DMA buffer memory, fps=50, spi0.0 at 48 MHz
[   14.604318] ads7846 spi0.1: touchscreen, irq 187
[   14.648385] input: ADS7846 Touchscreen as /devices/platform/bcm2708_spi.0/spi                                                                                        _master/spi0/spi0.1/input/input0
In order to use the touch panel with python, X, and to calibrate it, a few packages need loading :

Code: Select all

sudo apt-get update
sudo apt-get install libts-bin evtest xinput python-dev python-pip -y
Then use pip to install evdev :

Code: Select all

sudo pip install evdev
To calibrate the touch panel :

Code: Select all

sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/event0 ts_calibrate
Use a stylus (or a pencil!) to select each point in turn. This will be the first time you see anything on the screen too ;)
Note that if you have other input devices, ie keyboard and/or mouse, /dev/input/event0 may be, for example /dev/input/event1 or /dev/input/event2 or /dev/input/event3, etc.

Here is a test python program than uses pygame :

Code: Select all

#!/usr/bin/python
# touchv6
# Texy 5/12/13

import pygame, sys, os, time
from pygame.locals import *

from evdev import InputDevice, list_devices
devices = map(InputDevice, list_devices())
eventX=""
for dev in devices:
    if dev.name == "ADS7846 Touchscreen":
        eventX = dev.fn
print eventX

os.environ["SDL_FBDEV"] = "/dev/fb1"
os.environ["SDL_MOUSEDRV"] = "TSLIB"
os.environ["SDL_MOUSEDEV"] = eventX

pygame.init()

# set up the window
screen = pygame.display.set_mode((320, 240), 0, 32)
pygame.display.set_caption('Drawing')

# set up the colors
BLACK = (  0,   0,   0)
WHITE = (255, 255, 255)
RED   = (255,   0,   0)
GREEN = (  0, 255,   0)
BLUE  = (  0,   0, 255)
CYAN  = (  0, 255, 255)
MAGENTA=(255,   0, 255)
YELLOW =(255, 255,   0)

# Fill background
background = pygame.Surface(screen.get_size())
background = background.convert()
background.fill(WHITE)
box = pygame.draw.rect(background, YELLOW,(40, 0, 40, 240))
box = pygame.draw.rect(background,  CYAN, (80, 0, 40, 240))
box = pygame.draw.rect(background, GREEN, (120, 0, 40, 240))
box = pygame.draw.rect(background,MAGENTA,(160, 0, 40, 240))
box = pygame.draw.rect(background, RED,   (200, 0, 40, 240))
box = pygame.draw.rect(background, BLUE  ,(240, 0, 40, 240))
box = pygame.draw.rect(background, BLACK ,(280, 0, 40, 240))

# Display some text
font = pygame.font.Font(None, 36)
text = font.render("Touch here to quit", 1, (BLACK))
#text = pygame.transform.rotate(text,270)
textpos = text.get_rect(centerx=background.get_width()/2,centery=background.get_height()/2)
background.blit(text, textpos)

screen.blit(background, (0, 0))
pygame.display.flip()

running = True
# run the game loop
while running:
    for event in pygame.event.get():
        if event.type == QUIT:
            pygame.quit()
            sys.exit()
            running = False
        elif event.type == pygame.MOUSEBUTTONDOWN:
            print("Pos: %sx%s\n" % pygame.mouse.get_pos())
            if textpos.collidepoint(pygame.mouse.get_pos()):
                pygame.quit()
                sys.exit()
                running = False
        elif event.type == KEYDOWN and event.key == K_ESCAPE:
            running = False
    pygame.display.update()
Copy and paste using nano, eg :

Code: Select all

sudo nano touchv6.py
Then to run the program use

Code: Select all

sudo python touchv6.py
Image
Image
With this configuration, the screen has been rotated for landscape use. In order to use the touch panel with X, the touch panel input also needs rotating.
Do this by

Code: Select all

sudo nano /etc/X11/xinit/xinitrc
and add this line before ". /etc/X11/Xsession" :

Code: Select all

DISPLAY=:0 xinput --set-prop 'ADS7846 Touchscreen' 'Evdev Axis Inversion' 0 0
Note that with Raspbian images from 2013-12-20, fbturbo has been enabled by default, which means that an additional configuration change is required.

Code: Select all

sudo nano /usr/share/X11/xorg.conf.d/99-fbturbo.conf
and put a # at the start of line

Code: Select all

Option          "fbdev" "/dev/fb0"
.
This allows X11 to be used with, or without the TFT display.

Then to run X use

Code: Select all

FRAMEBUFFER=/dev/fb1 startx -- -dpi 60
Finally, to allow the console to be shown on the display from boot-up modify /boot/cmdline.txt :

Code: Select all

sudo nano /boot/cmdline.txt
and add the following TO THE END OF THE LINE :

Code: Select all

 fbcon=map:10 fbcon=font:VGA8x8
so all of the options are one 1 single line.

Note all of the instructions in this post assume you wish to use the display/touch panel in landscape mode, with the hdmi connector at the top as you look at the pi/shield.
Of course, there are 3 other orientations possible, so notro's github page for further information - https://github.com/notro/fbtft/wiki

Much more information and discussion can be found in this thread : http://www.raspberrypi.org/phpBB3/viewt ... 64&t=34007
Many thanks again to Notro for the drivers, and also Andybiker for the inspiration ;)



NOTE THAT APT-GET UPGRADE WILL BREAK THE DRIVERS - SO USE THE FOLLOWING PROCEDURE TO UPDATE THE SYSTEM :

Code: Select all

sudo apt-mark hold raspberrypi-bootloader
sudo apt-get update
sudo apt-get upgrade
And rpi-update also overwrites the custom kernel, so use :

Code: Select all

sudo REPO_URI=https://github.com/notro/rpi-firmware rpi-update
[/b][/color]


Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

uvex
Posts: 2
Joined: Mon Jan 13, 2014 6:02 pm

Re: 2.8" TFT + Touch Shield Board v2

Mon Jan 13, 2014 6:07 pm

texy can you PM me. i getmy tft today from you and have some questions

DanAndDusty
Posts: 1
Joined: Thu Jan 16, 2014 8:48 pm

Re: 2.8" TFT + Touch Shield Board v2

Thu Jan 16, 2014 8:58 pm

Thanks for the screen Texy. Had it about a week. (2 Lil kiddies manage to reduce my RPI time by more than should be allowed).

I had some issues setting it up (home is mounted on NFS which I had with the user option in /etc/fstab, which it turns out implies noexec hence the permission denied errors I was getting.. DOH.. still learned something I didn't know before)..

No problems at all with the screen itself. I mostly run headless and being able to see the console and plug in a keyboard when ssh says no way is just awesome.

Im a middling coder in Python and C and would love to be able to write my own stuff straight to the screen so do you know any good examples/tutorial on writing to the frame buffer? (Linux general would do but Raspberry Pi specific would be awesome).

Anyway, Thanks again for such an awesome piece of kit. I think between the 2 of us we have made some more RPI converts :)

Dan (ElectronicsDad)

texy
Forum Moderator
Forum Moderator
Posts: 5003
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: 2.8" TFT + Touch Shield Board v2

Sun Jan 26, 2014 5:31 pm

A couple of extra tips :
The raspbian os will normally blank out the console screen as a screensaver after 15 minutes. If you wish to change it you need to edit the /etc/kbd/config file :

Code: Select all

sudo nano /etc/kbd/config
scroll down to
BLANK_TIME=15
and change it whatever you need, note that 0 sets the screensaver to disabled.

To temporarily disable the screen, you can switch off the backlight :

Code: Select all

echo 1 | sudo tee /sys/class/backlight/fb_ili9325/bl_power
to switch it back on :

Code: Select all

echo 0 | sudo tee /sys/class/backlight/fb_ili9325/bl_power
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

macgeek
Posts: 1
Joined: Tue Jan 28, 2014 6:22 pm

Re: 2.8" TFT + Touch Shield Board v2

Wed Jan 29, 2014 9:49 am

Dear Texy and other interested peoples. Here's what I did with my TFT display. My water cooler had a mechanical thermostat which never kept the water temp that stable, or cold. It would fluctuate between approx 4deg and 9deg C.

The solution was of course a Raspberry Pi coupled with a DS18B20 temp sensor and some code that controlled turning a relay on and off to run the water cooler's compressor.

Adding the TFT to the project allowed for live display of the current temp as well as viewing graphs that are generated from historic
temp data which is already logged onto the SD card (eg last hour, last day, last week)

I captured a short video of the device in action, but unfortunately this board doesn't allow posting of files with .mp4 extension. I tried uploading it as a bzip2 attachment instead but was told 64Kbyte was the maximum size (yes, even now in 2014! what file is any use under 64KB?!). I then tried a couple of photos. Nope, too large. *sigh*. Almost ready to give up I managed to get the two low-res images attached, but they really don't do it justice!

Anyway, the code is a collection of different types. We have some python to monitor the temp and controller the compressor relay (more complex than it sounds when there are rules about how long it can remain on, how long it must remain off minmum and how to ensure it doesn't freeze etc). That was coupled with some bash scripts to generate graphs from the logged data using gnuplot on a regular basis and also to monitor the button attached to the GPIO pin to sense when a user wants to change screens.

Any questions just ask and I'll do what I can to help answer.

Thanks for giving me the possibility for all the fun I had with this project Texy! :)

Pete from New Zealand
cooler1.jpg
cooler1.jpg (11.46 KiB) Viewed 63297 times
cooler2.jpg
cooler2.jpg (19.5 KiB) Viewed 63297 times

wimble
Posts: 34
Joined: Tue Feb 05, 2013 9:52 am

Re: 2.8" TFT + Touch Shield Board v2

Wed Jan 29, 2014 4:04 pm

Hi. Do you know whether this works with XBMC?

I do know that XBMC can run on a 320 x 240 display: at least, on my Windows machine, I can bring the window down to that display size, and it doesn't complain. The video's almost unwatchable, but I'm after a control interface, not video output (If I want to watch videos, I'll do it on the OpenElec plugged into my TV ;-)

So it *should* just be a question of whether XBMC can recognise this as a valid output device. I suspect that it may just be a question of configuring the output to write to the appropriate framebuffer, but I don't know enough about XBMC's screen rendering to be certain. (eh, I'll probably buy one anyway, and experiment. In which case I can supply my own answer if it works!)

texy
Forum Moderator
Forum Moderator
Posts: 5003
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: 2.8" TFT + Touch Shield Board v2

Wed Jan 29, 2014 4:28 pm

Hi,
It "should" work, but I haven't tried it for some time and I know that xbmc is constantly changing. Search the v1b/c thread for details on how it was configured then. You dont need to be concerned about screen resolution because I used a method of copying the main output to the TFT using fbcp, which takes care of all of that.
Certainly the touch panel wasn't working at that point.
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

wimble
Posts: 34
Joined: Tue Feb 05, 2013 9:52 am

Re: 2.8" TFT + Touch Shield Board v2

Wed Jan 29, 2014 4:43 pm

Ok, that's great. I've already given ebay the money. I'll see what I can do to get the touchscreen to do its thing, but it's not the end of the world if it defeats me. (And it's worth passing around at work, just for experimentation, so it's a worthwhile investment.)

Fauveboy
Posts: 35
Joined: Sun Jan 26, 2014 8:09 pm

Re: 2.8" TFT + Touch Shield Board v2

Fri Jan 31, 2014 10:35 am

Hi
I've been sat in front of a screen for the best part of a week just trying to get a functional screen viewed here viewtopic.php?f=45&t=64993 Ive gone through the instructions on the link and it didnt work for me I also tried it through ssd which had no result . I've extracted an img file Texy sent me on a mackintosh and tried to write it to SD each time it has corrupted the Pi on boot up saying Kernel Panic: VFS : Unable to mount root fs on unknown-block (179,6) or the screens been glitchy when theres an image. I was using these instructions http://elinux.org/RPi_Easy_SD_Card_Setu ... ng_Mac_OSX to understand how to write to SD.. I wasnt introduced to lunix and programming that long ago but right I REALLY need anyone who knows what I need to do or explain why it keeps going wrong so I can clearly understand, its been a totally hopeless few days

Thank you very much for reading, PLEASE get back to me if you could help!

edit:just another thought should I try opening the img on my mackintosh while the sd is plugged in and just copy over the files of the img and have them replace the ones in the boot partition or would that not do it any good? also I just realised that i needed to unmount the original boot partition and replace it with the new one of the img file but still its say that the partition is "busy" which has confused me further because im sure thats where I was going wrong....or is it the type of lunix os im running?

Thanks again !

texy
Forum Moderator
Forum Moderator
Posts: 5003
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: 2.8" TFT + Touch Shield Board v2

Fri Jan 31, 2014 10:51 am

Fauveboy wrote:Hi
I've been sat in front of a screen for the best part of a week just trying to get a functional screen viewed here viewtopic.php?f=45&t=64993 Ive gone through the instructions on the link and it didnt work for me I also tried it through ssd which had no result . I've extracted an img file Texy sent me on a mackintosh and tried to write it to SD each time it has corrupted the Pi on boot up saying Kernel Panic: VFS : Unable to mount root fs on unknown-block (179,6) or the screens been glitchy when theres an image. I was using these instructions http://elinux.org/RPi_Easy_SD_Card_Setu ... ng_Mac_OSX to understand how to write to SD.. I wasnt introduced to lunix and programming that long ago but right I REALLY need anyone who knows what I need to do or explain why it keeps going wrong so I can clearly understand, its been a totally hopeless few days

Thank you very much for reading, PLEASE get back to me if you could help!

edit:just another thought should I try opening the img on my mackintosh while the sd is plugged in and just copy over the files of the img and have them replace the ones in the boot partition or would that not do it any good? also I just realised that i needed to unmount the original boot partition and replace it with the new one of the img file but still its say that the partition is "busy" which has confused me further because im sure thats where I was going wrong....or is it the type of lunix os im running?

Thanks again !

Please don't advertise my dropbox link image, as I have limited bandwidth on that account and I only give to those who are really struggling. I have edited you post.
I am sure we will get this sorted,
thanks,
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

BBUK
Posts: 126
Joined: Tue Dec 18, 2012 10:34 am

Re: 2.8" TFT + Touch Shield Board v2

Fri Jan 31, 2014 7:39 pm

Hi Texy.

Is there any chance you could do two of these without the headers soldered in? I am using the display with model As and I would like the overall height to be lower by sticking on a standard pin header.

Of course, if anyone else would like the same, I am sure Texy won't mind if you chip in and he can then do a batch this way.

Note to anyone interested, it is possible to cut the existing headers off and put alternative ones on (I have done it a couple of times) but the soldering iron clearance for the inner row of the pin header is really tight - I had to use a smd head on my iron. Fiddly job tho, hence my request to texy.

EDIT: be aware that in an attempt to get maximally reduced height, I cut off the composite connector on the Pi. YMMV. Check what you need to cut off before modding the LCD!

BBUK
Last edited by BBUK on Fri Jan 31, 2014 10:37 pm, edited 1 time in total.

texy
Forum Moderator
Forum Moderator
Posts: 5003
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: 2.8" TFT + Touch Shield Board v2

Fri Jan 31, 2014 10:07 pm

BBUK wrote:Hi Texy.

Is there any chance you could do two of these without the headers soldered in? I am using the display with model As and I would like the overall height to be lower by sticking on a standard pin header.

Of course, if anyone else would like the same, I am sure Texy won't mind if you chip in and he can then do a batch this way.

Note to anyone interested, it is possible to cut the existing headers off and put alternative ones on (I have done it a couple of times) but the soldering iron clearance for the inner row of the pin header is really tight - I had to use a smd head on my iron. Fiddly job tho, hence my request to texy.

BBUK
Yeah this is possible. I just dug out my model A to check, and no problems found. I can build a couple over the weekend, but I'd like payment first.
Send me a pm when you are ready,
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

Fauveboy
Posts: 35
Joined: Sun Jan 26, 2014 8:09 pm

Re: 2.8" TFT + Touch Shield Board v2

Sat Feb 01, 2014 12:31 am

texy wrote:
Fauveboy wrote:Hi
I've been sat in front of a screen for the best part of a week just trying to get a functional screen viewed here viewtopic.php?f=45&t=64993 Ive gone through the instructions on the link and it didnt work for me I also tried it through ssd which had no result . I've extracted an img file Texy sent me on a mackintosh and tried to write it to SD each time it has corrupted the Pi on boot up saying Kernel Panic: VFS : Unable to mount root fs on unknown-block (179,6) or the screens been glitchy when theres an image. I was using these instructions http://elinux.org/RPi_Easy_SD_Card_Setu ... ng_Mac_OSX to understand how to write to SD.. I wasnt introduced to lunix and programming that long ago but right I REALLY need anyone who knows what I need to do or explain why it keeps going wrong so I can clearly understand, its been a totally hopeless few days

Thank you very much for reading, PLEASE get back to me if you could help!

edit:just another thought should I try opening the img on my mackintosh while the sd is plugged in and just copy over the files of the img and have them replace the ones in the boot partition or would that not do it any good? also I just realised that i needed to unmount the original boot partition and replace it with the new one of the img file but still its say that the partition is "busy" which has confused me further because im sure thats where I was going wrong....or is it the type of lunix os im running?

Thanks again !

Please don't advertise my dropbox link image, as I have limited bandwidth on that account and I only give to those who are really struggling. I have edited you post.
I am sure we will get this sorted,
thanks,
Texy
sure thing
sorry! I didn't realise how that worked

Hardy
Posts: 2
Joined: Sun Feb 02, 2014 11:24 am
Location: Berlin, Germany

Re: 2.8" TFT + Touch Shield Board v2

Sun Feb 02, 2014 12:54 pm

Hi Texy,
the module is up and running, but the calibration process fails. There is a dialog shown to push the crosshairs, but I do not see any crosshairs. Whats going wrong?
Regards
Hardy

texy
Forum Moderator
Forum Moderator
Posts: 5003
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: 2.8" TFT + Touch Shield Board v2

Sun Feb 02, 2014 2:07 pm

Hardy wrote:Hi Texy,
the module is up and running, but the calibration process fails. There is a dialog shown to push the crosshairs, but I do not see any crosshairs. Whats going wrong?
Regards
Hardy
Do you have a hdmi screen/TV connected to the pi? If so remove it - I recommend you have no mouse or keyboard or hdmi device connected to the pi , and you SSH into it via laptop/pc/mac during configuration.
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

Hardy
Posts: 2
Joined: Sun Feb 02, 2014 11:24 am
Location: Berlin, Germany

Re: 2.8" TFT + Touch Shield Board v2

Sun Feb 02, 2014 8:39 pm

Just removed keyboard, mouse and hdmi - repeating calibration process with success :-)
Thanks, Hardy
texy wrote:
Hardy wrote:Hi Texy,
the module is up and running, but the calibration process fails. There is a dialog shown to push the crosshairs, but I do not see any crosshairs. Whats going wrong?
Regards
Hardy
Do you have a hdmi screen/TV connected to the pi? If so remove it - I recommend you have no mouse or keyboard or hdmi device connected to the pi , and you SSH into it via laptop/pc/mac during configuration.
Texy

User avatar
angusmedia
Posts: 15
Joined: Sat Feb 01, 2014 10:47 am

Re: 2.8" TFT + Touch Shield Board v2

Mon Feb 03, 2014 1:07 pm

I do not know what I'm doing wrong. I cannot manage the display working. The only thing that worked for display was raspbmc mirrored with the instruction for the v1 shield. But I could calibrate the touch for raspbian, but never got anything but a white screen. I want to use this in my car, but also as a camdisplay (not at the same time). berryIO showed GPIO working. Anyone can help? I just want to see something when using raspian - that would help.

texy
Forum Moderator
Forum Moderator
Posts: 5003
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: 2.8" TFT + Touch Shield Board v2

Mon Feb 03, 2014 3:14 pm

Hi,
But I could calibrate the touch for raspbian, but never got anything but a white screen.
I,m confused by this statement - please clarify. Did you get the crosshairs when running

Code: Select all

sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/event0 ts_calibrate
??
If so what happened when you run the test python program?

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

User avatar
angusmedia
Posts: 15
Joined: Sat Feb 01, 2014 10:47 am

Re: 2.8" TFT + Touch Shield Board v2

Mon Feb 03, 2014 6:06 pm

"At this point, the screen will go from white to black - the display has been successfully initialised."
It turns black but just for a second. and then keeps on being white. There are no crosshairs, but ich can use the display as touchscreen - arrow moves - but display remains white.

sudo python touchv6.py
File "touchv6.py", line 5
import pygame, sys, os, time
^
IndentationError: unexpected indent
Thats all.

Fauveboy
Posts: 35
Joined: Sun Jan 26, 2014 8:09 pm

Re: 2.8" TFT + Touch Shield Board v2

Mon Feb 03, 2014 6:08 pm

Hi
Made some progress since my last comment. Ive managed to calibrate the screen through ssh the cross hatches did respond. As I carried on I manage to get the python "touch here to exit" to appear and eventually onwards to the desktop. But the screen keeps glitching? A bit like when theres a virus on a computer or its really slow and you drag a window and it does that thing where it repeats the image behind really quickly when you drag it, if im making any sense, anyway. What a appears on the tft seems to be version of that, it keeps repeating an area of its self above the previous one and Im not sure what that could be down to?...also after I type the command FRAMEBUFFER=/dev/fb1 startx -- -dpi 60 the desktop appears and I've done the sudo nano /boot/cmdline.txt and when I go to reboot through SSH nothing appears again on the tft ?

Thank you very much for reading

texy
Forum Moderator
Forum Moderator
Posts: 5003
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: 2.8" TFT + Touch Shield Board v2

Mon Feb 03, 2014 7:35 pm

angusmedia wrote:"At this point, the screen will go from white to black - the display has been successfully initialised."
It turns black but just for a second. and then keeps on being white.
That is expected - you haven't redirected the console to the TFT at that point, so nothing will display on it unless you use a program that can redirect to fb1.
angusmedia wrote: There are no crosshairs, but ich can use the display as touchscreen - arrow moves - but display remains white.
Souns similar to the problem above - do you have hdmi screen attached?
angusmedia wrote: sudo python touchv6.py
File "touchv6.py", line 5
import pygame, sys, os, time
^
IndentationError: unexpected indent
Thats all.
You haven't correctly copied the python program listing from the first post.

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

texy
Forum Moderator
Forum Moderator
Posts: 5003
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: 2.8" TFT + Touch Shield Board v2

Mon Feb 03, 2014 7:38 pm

Fauveboy wrote:Hi
Made some progress since my last comment. Ive managed to calibrate the screen through ssh the cross hatches did respond. As I carried on I manage to get the python "touch here to exit" to appear and eventually onwards to the desktop. But the screen keeps glitching? A bit like when theres a virus on a computer or its really slow and you drag a window and it does that thing where it repeats the image behind really quickly when you drag it, if im making any sense, anyway. What a appears on the tft seems to be version of that, it keeps repeating an area of its self above the previous one and Im not sure what that could be down to?...also after I type the command FRAMEBUFFER=/dev/fb1 startx -- -dpi 60 the desktop appears and I've done the sudo nano /boot/cmdline.txt and when I go to reboot through SSH nothing appears again on the tft ?

Thank you very much for reading
Not sure about the glitching - are you able to post a picture or video?
Regarding losing the console after reboot - are you sure that the cmdline.txt is all on one line and copied correctly?

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

User avatar
angusmedia
Posts: 15
Joined: Sat Feb 01, 2014 10:47 am

Re: 2.8" TFT + Touch Shield Board v2

Mon Feb 03, 2014 10:19 pm

Haven't had the time to start again. But you are doing good work - you really care about your customer. Thanks a really LOT...even if there will be some more questions... I'm sooo sorry, but I tried several Images to start - from NOOBS to actual Raspian and 2013-12-20-wheezy-raspbian-2014-01-03-fbtft.img and I never can see anything on TFT screen - even if there is nothing connected exept WLAN or just a LAN cable - nothing happens. I could get a cheaper pocketlighter doing the same. I never had problems like this on any computer.

texy
Forum Moderator
Forum Moderator
Posts: 5003
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: 2.8" TFT + Touch Shield Board v2

Tue Feb 04, 2014 7:48 am

Fauveboy wrote:Hi
Made some progress since my last comment. Ive managed to calibrate the screen through ssh the cross hatches did respond. As I carried on I manage to get the python "touch here to exit" to appear and eventually onwards to the desktop. But the screen keeps glitching? A bit like when theres a virus on a computer or its really slow and you drag a window and it does that thing where it repeats the image behind really quickly when you drag it, if im making any sense, anyway. What a appears on the tft seems to be version of that, it keeps repeating an area of its self above the previous one and Im not sure what that could be down to?...also after I type the command FRAMEBUFFER=/dev/fb1 startx -- -dpi 60 the desktop appears and I've done the sudo nano /boot/cmdline.txt and when I go to reboot through SSH nothing appears again on the tft ?

Thank you very much for reading

Perhaps you should update your cry for help thread here :
http://www.raspberrypi.org/forum/viewto ... 45&t=68090
as you must have the image finally flashed to SD card ;)

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

wimble
Posts: 34
Joined: Tue Feb 05, 2013 9:52 am

Re: 2.8" TFT + Touch Shield Board v2

Wed Feb 05, 2014 11:35 am

My screen arrived on Monday (days ahead of my expectation), and I picked it up from the post office yesterday.
After some faffing around with cases (removing the pibow case, and putting that on an A), everything worked perfectly: I installed the kernel patches (I'm running raspbian, with Michael Gorven's XBMC on this machine), and configured the board as per your post at the top of this thread. I haven't tried the X configuration, but reconfigured the console to output directly to the TFT:
2014-02-04 21.35.25.jpg
Console to TFT
2014-02-04 21.35.25.jpg (49.47 KiB) Viewed 62408 times
I did spend some time trying to figure out how to get XBMC working, before I gave up and trawled through the original thread, then discovered tasanakorn's fbcp frame buffer copier (is it worth linking that in your explanatory post). Oddly, this worked perfectly at copying the console onto the TFT (having removed the commandline.txt changes) *once*, but wouldn't keep the image updated, and wouldn't copy any video at all. Eventually I cottoned on, and rebooted without the HDMI cable connected. And bingo! It all works:
2014-02-04 23.30.30.jpg
XMBC via fbcp
2014-02-04 23.30.30.jpg (38.3 KiB) Viewed 62408 times
I've still got to clean things up (such as starting fbcp at boot, or at least with XBMC), and I've got some permissions issues, but those are all of my own making. Now to go back and play with the touch screen side of things. :D

Return to “Add-ons”

Who is online

Users browsing this forum: No registered users and 5 guests