lluvaa
Posts: 7
Joined: Wed Mar 04, 2015 8:28 pm

Rpi 2 gpio lcd touch screen

Wed Mar 04, 2015 8:33 pm

I see a lot of 2.8 to 3.5" touch screens on ebay, nearly none of them fits Rpi 2 why?
Is it software or hardware related or both?

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

Re: Rpi 2 gpio lcd touch screen

Wed Mar 04, 2015 8:55 pm

Hi and welcome to the forum.
I think you will find that most of them DO fit the Pi2 B - why do you think they do not?
A lot of the designs tend to use the 26-way GPIO port connect in order for them to be backwardly compatible, but that
doesn't mean they will not fit or work with the Pi 2B, or even the A/B + models.
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

lluvaa
Posts: 7
Joined: Wed Mar 04, 2015 8:28 pm

Re: Rpi 2 gpio lcd touch screen

Wed Mar 04, 2015 9:17 pm

On ebay it only says support for b and b +, I have sendt messages to at least 5 different sellers asking if their lcd's supports Rpi 2.
The answere from all of them is, no sorry no support fro Rpi2.

I also think this is weird because the similarity of b+ and RPI 2.

But if anyone can confirm an compability I would be happy

This one
http://www.ebay.com/itm/3-2-TFT-LCD-Mod ... 418dacfa4a

Or this one
http://www.ebay.com/itm/3-5inch-Raspber ... 2ede65f1fe

User avatar
DougieLawson
Posts: 42306
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: Rpi 2 gpio lcd touch screen

Wed Mar 04, 2015 9:26 pm

The reason they won't (yet) support a 2B is that their SDCard image won't have a 2B ready kernel / "firmware" on it.
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

lluvaa
Posts: 7
Joined: Wed Mar 04, 2015 8:28 pm

Re: Rpi 2 gpio lcd touch screen

Wed Mar 04, 2015 9:28 pm

Can the firmware be downloaded from other places?

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

Re: Rpi 2 gpio lcd touch screen

Wed Mar 04, 2015 9:31 pm

DougieLawson wrote:The reason they won't (yet) support a 2B is that their SDCard image won't have a 2B ready kernel / "firmware" on it.

Well that could be "a" reason, not 'the' reason. Things have recently got a whole lot easier for fbtft driven displays using Device Tree.....
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: 5173
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Rpi 2 gpio lcd touch screen

Wed Mar 04, 2015 9:34 pm

lluvaa wrote:Can the firmware be downloaded from other places?
How can we answer that? The firmware needs to be updated by the supplier, it's up to them how/when/where that happens, and as you said, "there are a lot".
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

lluvaa
Posts: 7
Joined: Wed Mar 04, 2015 8:28 pm

Re: Rpi 2 gpio lcd touch screen

Wed Mar 04, 2015 10:03 pm

Well thanks for quick reply and answers.
Im new on Rpi have bought an Rpi 2 an would like an miniscreen on top for easy to work with on the sofa :D .

Any suggestion on other mini hdmi touchscreens?

An other question, will hdmi work along with a screen fitted to the gpio?

mm67
Posts: 2
Joined: Fri Feb 20, 2015 11:56 pm

Re: Rpi 2 gpio lcd touch screen

Wed Mar 04, 2015 11:22 pm

lluvaa wrote:On ebay it only says support for b and b +, I have sendt messages to at least 5 different sellers asking if their lcd's supports Rpi 2.
The answere from all of them is, no sorry no support fro Rpi2.

I also think this is weird because the similarity of b+ and RPI 2.

But if anyone can confirm an compability I would be happy

This one
http://www.ebay.com/itm/3-2-TFT-LCD-Mod ... 418dacfa4a

Or this one
http://www.ebay.com/itm/3-5inch-Raspber ... 2ede65f1fe
I have a newer version (V4) of that 3.2" TFT running on RPi2, I'm using it with 2015-02-16 version of Raspbian

User avatar
ragnarjensen
Posts: 332
Joined: Wed May 15, 2013 6:13 pm
Location: Stockholm, Sweden

Re: Rpi 2 gpio lcd touch screen

Thu Mar 05, 2015 1:58 pm

DougieLawson wrote:The reason they won't (yet) support a 2B is that their SDCard image won't have a 2B ready kernel / "firmware" on it.
This.

I have the 3.5" screen you linked to working on a 2B. But I built the driver myself.
--
Ragnar

User avatar
DougieLawson
Posts: 42306
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: Rpi 2 gpio lcd touch screen

Thu Mar 05, 2015 2:03 pm

ragnarjensen wrote:
DougieLawson wrote:The reason they won't (yet) support a 2B is that their SDCard image won't have a 2B ready kernel / "firmware" on it.
This.

I have the 3.5" screen you linked to working on a 2B. But I built the driver myself.
--
Ragnar
Perhaps you should publish a copy of your SDCard or detailed instructions for other users.
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

User avatar
ragnarjensen
Posts: 332
Joined: Wed May 15, 2013 6:13 pm
Location: Stockholm, Sweden

Re: Rpi 2 gpio lcd touch screen

Thu Mar 05, 2015 3:41 pm

The screen in question (WaveShare SpotPear 3.5") uses notro's flexfb driver. I gather it will soon be integrated into the standard kernel.

Instructions that helped me:
https://github.com/notro/fbtft/issues/2 ... t-69921933
https://github.com/notro/fbtft/issues/2 ... t-74646569

A copy of my SD card won't help at all, it only holds the boot files, the rest is on HDD.
But I should be able to make a deb package of my kernel. Let me fiddle a bit with it...
--
Ragnar

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

Re: Rpi 2 gpio lcd touch screen

Thu Mar 05, 2015 4:05 pm

ragnarjensen wrote: I gather it will soon be integrated into the standard kernel.
It is there with rpi-update. You may need to hunt down the overlay file if there is one.
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
ragnarjensen
Posts: 332
Joined: Wed May 15, 2013 6:13 pm
Location: Stockholm, Sweden

Re: Rpi 2 gpio lcd touch screen

Fri Mar 06, 2015 8:10 pm

I have uploaded a deb package of my kernel with drivers for the WaveShare SpotPear 3.5" screen.
Download the package linux-image-3.18.7-v7upf_3.18.7-v7upf-13_armhf.deb from here: https://drive.google.com/file/d/0BzIaxM ... sp=sharing
It is built on a RPi2 for the RPi2. Not tested on anything else than a standalone Raspbian (i.e. not NOOBS) on a RPi2.
For the touchscreen, you also need an extra module - ads7846_device.ko - that is not a part of the kernel proper.
Download it from here: https://drive.google.com/file/d/0BzIaxM ... sp=sharing

Install the kernel package:

Code: Select all

sudo dpkg -i linux-image-3.18.7-v7upf_3.18.7-v7upf-13_armhf.deb
Add this to the end of /boot/cmdline.txt, all of it on one line (the forum might fold the line in two):

Code: Select all

 fbtft_device.custom fbtft_device.name=flexfb fbtft_device.gpios=dc:24,reset:25 fbtft_device.bgr=1 fbtft_device.speed=16000000
If you want the console on the small screen, add this too to /boot/cmdline.txt:

Code: Select all

 fbcon=map:1 fbcon=font:VGA8x8
Remember that /boot/cmdline.txt should have everything on one long line.

Add this to /etc/modules:

Code: Select all

# WaveShare SpotPear 3.5" LCD
fbtft_device debug=3 rotate=90 name=flexfb speed=16000000 gpios=reset:25,dc:24
flexfb  width=320 height=480 regwidth=16 init=-1,0xb0,0x0,-1,0x11,-2,250,-1,0x3A,0x55,-1,0xC2,0x44,-1,0xC5,0x00,0x00,0x00,0x00,-1,0xE0,0x0F,0x1F,0x1C,0x0C,0x0F,0x08,0x48,0x98,0x37,0x0A,0x13,0x04,0x11,0x0D,0x00,-1,0xE1,0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00,-1,0xE2,0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00,-1,0x36,0xF8,-1,0x11,-1,0x29,-3

# Touchscreen
ads7846_device model=7846 cs=1 gpio_pendown=17 keep_vref_on=1 swap_xy=0 pressure_max=255 x_plate_ohms=60 x_min=200 x_max=3900 y_min=200 y_max=3900
Again, the forum might fold the lines. The line starting with "flexfb" should end with "-3". The last line should begin with "ads7846_device" and end with "3900".

In /boot/config.txt, add these lines to enable SPI and load this custom kernel.

Code: Select all

dtparam=spi=on
kernel=vmlinuz-3.18.7-v7upf
Reboot.

Install the extra module for the touchscreen. Go to the directory where you saved the file and

Code: Select all

sudo mkdir -p /lib/modules/$(uname -r)/extra
sudo install ads7846_device.ko /lib/modules/$(uname -r)/extra/
sudo depmod -a
Reboot.

My /etc/X11/xorg.conf looks like this:

Code: Select all

Section "Device" 
# WaveShare SpotPear 3.5", framebuffer 1
  Identifier "uga" 
  driver "fbdev" 
  Option "fbdev" "/dev/fb1" 
  Option "ShadowFB" "off"
EndSection 

Section "Monitor" 
# Primary  monitor. WaveShare SpotPear 480x320
  Identifier "WSSP" 
EndSection 

Section "Screen" 
  Identifier "primary" 
  Device "uga" 
  Monitor "WSSP" 
EndSection 

Section "ServerLayout" 
  Identifier "default" 
  Screen 0 "primary" 0 0 
EndSection
I had a file /usr/share/X11/xorg.conf.d/99-fbturbo.conf that conflicted with the above, so I deleted it.
--
Ragnar

sharp23
Posts: 12
Joined: Wed Mar 25, 2015 6:53 pm
Location: Sydney

Re: Rpi 2 gpio lcd touch screen

Wed Mar 25, 2015 6:59 pm

to ragnarjensen

Help me!!! i can't follow your structure. I'm new about Raspberry pi. Now i got Raspberry pi 2 and waveshare 3.5" i tried to follow many website how to solve the c but i can't. Please!!! help me!!
Thank you
Sharp

jsaily
Posts: 4
Joined: Mon Jan 14, 2013 10:44 am

Re: Rpi 2 gpio lcd touch screen

Thu Mar 26, 2015 10:09 am

Thanks for the custom kernel and the ads7846_device.ko file! I couldn't make the touchscreen (Waveshare 3.5) work on my RPi2 without these. However, I have a small problem because the touchscreen is inverted in the horizontal direction (ok in vertical), so if I click on the left side the cursor goes to right. Can you tell me how to change this behaviour? I followed your instructions precisely.

User avatar
ragnarjensen
Posts: 332
Joined: Wed May 15, 2013 6:13 pm
Location: Stockholm, Sweden

Re: Rpi 2 gpio lcd touch screen

Thu Mar 26, 2015 10:44 am

sharp23 wrote:to ragnarjensen

Help me!!! i can't follow your structure.
You need to give more information.

What have you tried?
Which commands have you used?
What goes wrong?
What are the error messages you get?
--
Ragnar

User avatar
ragnarjensen
Posts: 332
Joined: Wed May 15, 2013 6:13 pm
Location: Stockholm, Sweden

Re: Rpi 2 gpio lcd touch screen

Thu Mar 26, 2015 10:46 am

jsaily wrote:...the touchscreen is inverted in the horizontal direction (ok in vertical), so if I click on the left side the cursor goes to right.
You're not alone to have seen that.
http://www.raspberrypi.org/forums/viewt ... 01#p714601
--
Ragnar

jsaily
Posts: 4
Joined: Mon Jan 14, 2013 10:44 am

Re: Rpi 2 gpio lcd touch screen

Thu Mar 26, 2015 1:14 pm

ragnarjensen wrote:
jsaily wrote:...the touchscreen is inverted in the horizontal direction (ok in vertical), so if I click on the left side the cursor goes to right.
You're not alone to have seen that.
http://www.raspberrypi.org/forums/viewt ... 01#p714601
--
Ragnar
I managed to solve the axis inversion problem and to calibrate the display through these instructions: http://www.circuitbasics.com/raspberry- ... -rotation/

Somehow the calibration data is not passed to the X-display though. ts_test after calibrating shows perfect calibration... But running xinput_calibrator and updating the calibration coefficients like here worked finally :-) http://www.raspberrypi.org/forums/viewt ... 91&t=78805

Thanks a lot for your custom kernel + touchscreen driver! What happens if I update the kernel through rpi-update, will the driver be overwritten?

User avatar
ragnarjensen
Posts: 332
Joined: Wed May 15, 2013 6:13 pm
Location: Stockholm, Sweden

Re: Rpi 2 gpio lcd touch screen

Thu Mar 26, 2015 3:12 pm

jsaily wrote: What happens if I update the kernel through rpi-update, will the driver be overwritten?
I don't know. I never use rpi-update to update the kernel, because I don't know what kind of untested bleeding-edge, experimental stuff it might contain.

EDIT to add: On the other hand, the driver for this particular display is rumored to already be in the kernel you'll get with a rpi-update. Then you wouldn't need my kernel. Don't know the status on the touch-scren driver.

http://www.raspberrypi.org/documentatio ... pdating.md is the offical way to upgrade.
Since you are pointing out a custom kernel in /boot/config.txt, it will still be used after such an upgrade.
There is a risk even with the official way, it might pull in firmware that relies on a newer kernel than mine.

I run custom kernels on all my Pis. I upgrade by pulling the new firmware from the repository and building a new kernel from source.
--
Ragnar

sharp23
Posts: 12
Joined: Wed Mar 25, 2015 6:53 pm
Location: Sydney

Re: Rpi 2 gpio lcd touch screen

Thu Mar 26, 2015 9:32 pm

to ragnarjensen

i tried from https://github.com/notro/fbtft/issues/215 after reboot, it struck at rainbow display
i used RASPBIAN Debian Wheezy

How can i download and install "linux-image-3.18.7-v7upf_3.18.7-v7upf-13_armhf.deb " I'm a bit confuse.

Thank you
Sharp
sorry for my English

User avatar
ragnarjensen
Posts: 332
Joined: Wed May 15, 2013 6:13 pm
Location: Stockholm, Sweden

Re: Rpi 2 gpio lcd touch screen

Thu Mar 26, 2015 10:36 pm

There are two links in my earlier post.

The kernel deb package is here: https://drive.google.com/file/d/0BzIaxM ... sp=sharing
The extra module for the touchscreen is here: https://drive.google.com/file/d/0BzIaxM ... sp=sharing
--
Ragnar

sharp23
Posts: 12
Joined: Wed Mar 25, 2015 6:53 pm
Location: Sydney

Re: Rpi 2 gpio lcd touch screen

Thu Mar 26, 2015 10:57 pm

to ragnarjensen

i already download but i don't know how to install .deb
i tried "sudo dpkg -i linux-image-3.18.7-v7upf_3.18.7-v7upf-13_armhf.deb" but
show "No such file or directory"

pi@raspberrypi ~ $ sudo dpkg -i linux-image-3.18.7-v7upf_3.18.7-v7upf-13_armhf.deb
dpkg: error processing linux-image-3.18.7-v7upf_3.18.7-v7upf-13_armhf.deb (--install):
cannot access archive: No such file or directory
Errors were encountered while processing:
linux-image-3.18.7-v7upf_3.18.7-v7upf-13_armhf.deb


I'm sorry for bother you. l really don't know about it.
Thank you

User avatar
ragnarjensen
Posts: 332
Joined: Wed May 15, 2013 6:13 pm
Location: Stockholm, Sweden

Re: Rpi 2 gpio lcd touch screen

Fri Mar 27, 2015 10:12 am

Did you download the file to /home/pi ?
It looks like you are running the dpkg command from that directory.
You have to cd into the directory where you saved the deb file.
--
Ragnar

jsaily
Posts: 4
Joined: Mon Jan 14, 2013 10:44 am

Re: Rpi 2 gpio lcd touch screen

Fri Mar 27, 2015 10:31 am

sharp23 wrote:to ragnarjensen

i already download but i don't know how to install .deb
i tried "sudo dpkg -i linux-image-3.18.7-v7upf_3.18.7-v7upf-13_armhf.deb" but
show "No such file or directory"

pi@raspberrypi ~ $ sudo dpkg -i linux-image-3.18.7-v7upf_3.18.7-v7upf-13_armhf.deb
dpkg: error processing linux-image-3.18.7-v7upf_3.18.7-v7upf-13_armhf.deb (--install):
cannot access archive: No such file or directory
Errors were encountered while processing:
linux-image-3.18.7-v7upf_3.18.7-v7upf-13_armhf.deb
I downloaded the required packages with my PC and connected to the RPi2 using WinSCP. It's easy then to copy the packages to the /home/pi directory and run the command lines from the Pi.

Return to “Beginners”