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

Re: 2.8" TFT + Touch Shield Board v2

Wed Feb 05, 2014 11:08 pm

Dear wimple,

could you send me a list of all deeds and commands you did (exept for the xbmc) to make it run? It always seem I miss something when doing it like written on top. I also made am copied the fbmc to usr/local/bin and still wondering.......

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

Re: 2.8" TFT + Touch Shield Board v2

Thu Feb 06, 2014 12:21 am

I will write down a complete list of all I have done.

Using clean imagefile 2013-12-20-wheezy-raspbian.img
Plugin LAN - put on Display and then finally power on - no HDMI - nothing on USB
Display is completely enlighted. So I start:

logging in per SSH from other Computer with pi raspberry
#Expand file system

Code: Select all

sudo raspi-config
sudo apt-mark hold raspberrypi-bootloader
I did not change anything but filesystem. (I woe not touching anything else this time - I will do this is everything works)

# 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
get drivers

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
sudo mv /lib/modules/$(uname -r) /lib/modules/$(uname -r).bak
sudo REPO_URI=https://github.com/notro/rpi-firmware rpi-update
sudo reboot
after that installing fbcp driver
download from
https://github.com/tasanakorn/rpi-fbcp and placing file in /boot/

Code: Select all

sudo apt-get install cmake
git clone https://github.com/tasanakorn/rpi-fbcp.git
cd rpi-fbcp
mkdir build
git pull
cd build
cmake ..
make
copy it - I prefer mc to copy - but I have already done this without it.

Code: Select all

sudo apt-get install mc -y
sudo mc
copy it with mc or use

Code: Select all

sudo cp /boot/fbcp /usr/local/bin/

Code: Select all

sudo chmod 755 /usr/local/bin/fbcp
sudo reboot
and now

Code: Select all

sudo modprobe fbtft dma
sudo modprobe fbtft_device name=hy28b rotate=90
Result:
Display is getting black JUST FOR A SECOND and enlightens again. But it should remain black???

I go on

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
Output says touchscreen seems to work - so i continue

Code: Select all

sudo nano /etc/modules
and insert

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
saving all and

Code: Select all

sudo poweroff


release currency cable - insert a display at HDMI and repower Raspberry - display and touchscreen initialized - fine. Minidisplay still remains white after restart.

Code: Select all

sudo apt-get update
sudo apt-get install libts-bin evtest xinput python-dev python-pip -y
sudo pip install evdev
sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/event0 ts_calibrate
No white crosshair can be seen on white ground.

So I try to create the testprogramm

Code: Select all

sudo nano touchv6.py
inserting

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()
save it and try to play it

Code: Select all

sudo python touchv6.py
RESULT:

Code: Select all

  File "touchv6.py", line 5
    import pygame, sys, os, time
    ^
IndentationError: unexpected indent
What is wrong??? What did I miss?

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

Re: 2.8" TFT + Touch Shield Board v2

Thu Feb 06, 2014 1:25 am

At the bottom of your post, you've got an immediate problem.
angusmedia wrote:

Code: Select all

  File "touchv6.py", line 5
    import pygame, sys, os, time
    ^
IndentationError: unexpected indent
What is wrong??? What did I miss?
You've used the select all link in Texy's original post. For some reason, this puts four spaces in front of every line.
So your python script has ended up as:

Code: Select all

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

    import pygame, sys, os, time
    from pygame.locals import *
(etc...) where it needs to be:

Code: Select all

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

import pygame, sys, os, time
from pygame.locals import *
. ie. the import needs to be hard up against the left margin, and all the other lines need to have correspondingly less indentation (ie. *some* indentation, you can't just move everything to the left margin). I suspect this wasn't forseen as a problem when python's indentation syntax was invented ;-)

My solution to this (as I got exactly the same error) was to manually select all the text in that particular box (the extra leading spaces don't matter with the other commands) by selecting it with the mouse, and then pressing ctrl+C to copy it. The forum javascript that's putting the text into the buffer obviously has a minor bug in it.

Other than that, I can't see anything obviously wrong with what you're doing. The display does go white under normal circumstances, until it's specifically told to do something. You can darken it with:

Code: Select all

echo 1 > /sys/class/backlight/fb_ili9325/bl_power
(but there are permissions issues with this file: it's owned by root, and if you use sudo, it only applies to the echo, and *not* to the redirection, which is where you need the root permission.

I haven't fully understood the GPU behaviour when an HDMI cable is attached. I started without a display, just using SSH to log straight into the Pi, and went through the apt-get update and modprobing without any other display, as that can all be done remotely. I ran then configuration, and python sample without any display attached. It's only when I started trying to get XBMC to work that I made the mistake of plugging in an HDMI display (having not read the thread, I was hoping that XBMC would offer me a "Display Screen" option, as does the Windows version. To access this, I'd need to be able to see what I was doing. It turns out that it doesn't, hence the use of fbcp). It appears that, if you've got an HDMI output, then of course this is where the GPU sends the display output. But that's not where fbcp copies it from, so the result is that fbcp simply doesn't do anything if HDMI output is enabled. Rebooting without the HDMI cable sends the output to the Composite Video instead, and then fbcp works like a charm.

If you can work entirely without the HDMI cable attached, I suspect the entire process is cleaner, just with the fact that you're very restricted to your display devices while you're going through the setup process (essentially, you're kind of stuck with SSH).

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

Re: 2.8" TFT + Touch Shield Board v2

Thu Feb 06, 2014 11:09 am

texy wrote:
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
Hi
I double checked the cmdline.txt, when I boot the Pi the screen goes from white to black like when you first initialise the screen but no further. when I type FRAMEBUFFER=/dev/fb1 startx -- -dpi 60 into the pi terminal through ssh it is the only occassion I find an image of the desktop ive up loaded an image of what this looks like, please find the files attached as jpeg. Im not sure if the reason for this can be Identified but it must be down to something ay? :?
Thank you
Attachments
1017442_10152164642688194_1248629049_n.jpg
1017442_10152164642688194_1248629049_n.jpg (21.51 KiB) Viewed 8199 times
1016759_10152164642413194_1191997535_n.jpg
1016759_10152164642413194_1191997535_n.jpg (18.64 KiB) Viewed 8199 times

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

Re: 2.8" TFT + Touch Shield Board v2

Thu Feb 06, 2014 1:07 pm

I think I need to see that unit. I am sending you a pm :!:

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

DerMisterDuck
Posts: 1
Joined: Thu Feb 06, 2014 7:26 pm

Re: 2.8" TFT + Touch Shield Board v2

Thu Feb 06, 2014 7:30 pm

Where can i buy these add on boards+ touchscreen I can't find anything on your eBay?

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

Re: 2.8" TFT + Touch Shield Board v2

Thu Feb 06, 2014 8:40 pm

DerMisterDuck wrote:Where can i buy these add on boards+ touchscreen I can't find anything on your eBay?
Hi you can buy direct from me - there are none on eBay at this present time.
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

bomanski
Posts: 1
Joined: Fri Feb 14, 2014 7:54 am

Re: 2.8" TFT + Touch Shield Board v2

Fri Feb 14, 2014 8:48 am

Hi Texy.
I have a couple of questions for you that u might be able to help me with.

First of all I got my rpi from my gf at christmas. Kudos to her! And since im a new pi user my knowledge is very low bout this machine.

So for the questions.
I'm planning to use the RPi as an portable HTPC, pluging it in to a TV on the run etc but then it occured to me what happends if there is no tv. Or no HDMI connection etc.
Then it would be perfect to have a small onboard screen that I can use.

So "IF" I manage to get you board to work with XBMC would it be possible to "clone" the image to a TV or do I have
to remove the onboard when I plug in a HDMI?
What's the price for the display and shipping to Sweden?

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

Re: 2.8" TFT + Touch Shield Board v2

Fri Feb 14, 2014 12:27 pm

Hi,
the current method of using the display with xbmc is to clone the hdmi output to the TFT screen, rather than the way you described.
The price for the display and shipping to Sweden will be £30 in total - pm me for paypal details, etc
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

bobje
Posts: 1
Joined: Wed Feb 19, 2014 5:39 pm

Re: 2.8" TFT + Touch Shield Board v2

Wed Feb 19, 2014 8:17 pm

Texi,

To put the .img on the Sd-card, I needed to use Terminal on my Mac, once I knew that:

The display works like a charm!

I am new to Raspberry, to Mac and to Linux, or was that obvious? :-)

Kind Regards,

bob

BTW: I received the display in no-time, thx again!

eddiespaghetti
Posts: 2
Joined: Wed Feb 19, 2014 11:47 pm

Re: 2.8" TFT + Touch Shield Board v2

Thu Feb 20, 2014 12:12 am

Hi,
I hope you don't mind me asking this question - I've trawled this thread and couldn't find anything...
How did you all install the tft install image file, which is inside a zip file?? I'm a noob and whilst I'm trying to do everything and follow instructions, I've been working in the terminal commands up 'til now. This has got me stumped....

Ed

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

Re: 2.8" TFT + Touch Shield Board v2

Thu Feb 20, 2014 7:19 am

Hi,
you will find instructions on how to setup your SD card here :
http://elinux.org/RPi_Easy_SD_Card_Setup

Regards,
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

eddiespaghetti
Posts: 2
Joined: Wed Feb 19, 2014 11:47 pm

Re: 2.8" TFT + Touch Shield Board v2

Thu Feb 20, 2014 10:44 am

Ignore my previous message - I didn't realize I had to re-image the entire SD card again! :oops:
All sorted now...

waleedqk
Posts: 5
Joined: Wed Oct 02, 2013 7:04 pm

Re: 2.8" TFT + Touch Shield Board v2

Fri Feb 21, 2014 11:12 pm

hi texy
I am trying to connect the display to the pi and am experiencing some difficulties in the process.
i run the following command to calibrate :
sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/event0 ts_calibrate
and i get:
ts_open: No such file or directory
I am using Xming and putty to enter these commands. The only thing connected to the pi is the power source and the ethernet cable.

Any help would be greatly appreciated.
Thanks

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

Re: 2.8" TFT + Touch Shield Board v2

Sat Feb 22, 2014 10:37 am

Hi,
Which image are you using?
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

waleedqk
Posts: 5
Joined: Wed Oct 02, 2013 7:04 pm

Re: 2.8" TFT + Touch Shield Board v2

Sun Feb 23, 2014 9:18 pm

texy wrote:Hi,
Which image are you using?
Texy
I downloaded the latest NOOB file from the site, and installed the Raspbian image. And then followed all the steps

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

Re: 2.8" TFT + Touch Shield Board v2

Sun Feb 23, 2014 9:30 pm

I'd suggest just downloading notro image initially. I haven't tried noobs for a while and in not 100% sure it's compatable.
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

Sun Feb 23, 2014 10:58 pm

texy wrote:I'd suggest just downloading notro image initially. I haven't tried noobs for a while and in not 100% sure it's compatable.
My (successful) installation was against Noobs Lite 1.3.2 (I was using Lite due to a 4 Gig SD card, and the full Noobs 1.3.3 takes up so much space before you install operating systems that there isn't enough room left to install Raspbian!). Noobs Lite 1.3.2 installs the same images as Noobs 1.3.3, despite the version difference. So it worked 3 weeks ago, starting from the "Enable SPI" instruction.

waleedqk
Posts: 5
Joined: Wed Oct 02, 2013 7:04 pm

Re: 2.8" TFT + Touch Shield Board v2

Tue Feb 25, 2014 3:56 am

texy wrote:I'd suggest just downloading notro image initially. I haven't tried noobs for a while and in not 100% sure it's compatable.
Texy
So i downloaded the notro image, but the zip file gives an error on extraction each time. Tried downloading it multiple times, same result. Is the file corrupt, or is there a step i am missing here.
I then loaded the NOOBS lite package on the pi.
Now when i calibrate: "sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/event0 ts_calibrate"
i can see using ssh that the program is waiting for an input, but i dont see the dots on the screen. If i click a point on screen, the program takes samples and directs me to the next point in queue. I rebooted the pi, but the screen is just blank, i dont see any characters appear on it at all

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

Re: 2.8" TFT + Touch Shield Board v2

Tue Feb 25, 2014 11:54 am

waleedqk wrote:
texy wrote:I'd suggest just downloading notro image initially. I haven't tried noobs for a while and in not 100% sure it's compatable.
Texy
So i downloaded the notro image, but the zip file gives an error on extraction each time. Tried downloading it multiple times, same result. Is the file corrupt, or is there a step i am missing here.
I have just downloaded the image and extracted it with no problems. You need to try it again :shock:
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
DougieLawson
Posts: 35789
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: 2.8" TFT + Touch Shield Board v2

Tue Feb 25, 2014 12:59 pm

texy wrote:
I have just downloaded the image and extracted it with no problems. You need to try it again :shock:
Texy
Perhaps you should publish a sha1sum of the zip file so that folks can confirm they got a good copy.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

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

Re: 2.8" TFT + Touch Shield Board v2

Tue Feb 25, 2014 1:14 pm

DougieLawson wrote:
texy wrote:
I have just downloaded the image and extracted it with no problems. You need to try it again :shock:
Texy
Perhaps you should publish a sha1sum of the zip file so that folks can confirm they got a good copy.
Perhaps the person who maintains the github should you mean?
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
DougieLawson
Posts: 35789
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: 2.8" TFT + Touch Shield Board v2

Tue Feb 25, 2014 1:17 pm

No I meant you. You've got a good copy. Saves me the effort of doing it once to help the guy with the download problems.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

jimi43
Posts: 3
Joined: Wed Jan 22, 2014 4:03 am

Re: 2.8" TFT + Touch Shield Board v2

Tue Mar 04, 2014 2:29 am

Texy....I have your 2.8" TFT + Touch Shield Board V2a and have downloaded the newly created image by Nostro to my laptop and used Win32 Image to send it to a newly formatted 16GB SD card.

I then switched on the Pi with nothing but ethernet connected and I get a white screen.

It goes through the boot sequence and reboot as predicted but the screen remains white with occasional black flashes.

SSH into it works fine and I ran raspi-config to set everything up but the screen remains white.

The ts_config works fine but I can't see the targets...pressing the white screen a few times randomly gets results on the terminal screen with the random XY coordinates so the touch screen seems to work.

ts-test works too giving a result each time the screen is touched.

No matter what I do I can't get the screen to display an image.

Please can anyone help me?

Thanks

Jimi

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

Re: 2.8" TFT + Touch Shield Board v2

Tue Mar 04, 2014 8:37 am

Hi Jimi,
how are you connecting the display to the Pi. How you tried with a cable and/or directly on top of the Pi ?
Can you post your dmesg output please.
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

Return to “HATs and other add-ons”