WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Official raspberry touch screen support thread  (Read 15271 times)

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Official raspberry touch screen support thread
« on: September 29, 2015, 02:58:32 PM »
Hi
Just connected the official raspberry touchscreen and the display is working right out of the box using piCore 4.1.6 and 4.1.8.

However, the touch function is not working.

I therefore made a small touch.tcz containing
/kernel/drivers/input/touchscreen/

As I already had the modules build for 4.1.6 I used this as a test using a matching piCore.img

It loads OK as seen with lsmod - however the touch function is still not working


Code: [Select]
tc@piCorePlayer1:~$ lsmod
Module                  Size  Used by    Not tainted
snd_bcm2835            19931  1
snd_pcm                75265  2 snd_bcm2835
snd_timer              18165  1 snd_pcm
snd                    52642  4 snd_bcm2835,snd_pcm,snd_timer
rpi_ft5406              2821  0
i2c_bcm2708             4966  0
bcm2835_gpiomem         2983  0
spi_bcm2835             7068  0
uio_pdrv_genirq         2977  0
uio                     8187  1 uio_pdrv_genirq

Steen

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Official raspberry touch screen support thread
« Reply #1 on: October 01, 2015, 01:38:29 PM »
Installed evtest as suggested here: https://www.raspberrypi.org/forums/viewtopic.php?f=108&t=121716 and here https://www.raspberrypi.org/forums/viewtopic.php?f=108&t=121220&p=820733

Code: [Select]
tc@piCorePlayer1:~$ sudo evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      Logitech Optical USB Mouse
Select the device event number [0-0]:

But as shown it only found the USB mouse and not the touch screen input.
So evtest is working but it seems like the touchscreen is not.

Steen

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Official raspberry touch screen support thread
« Reply #2 on: October 02, 2015, 08:09:26 AM »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Official raspberry touch screen support thread
« Reply #3 on: October 03, 2015, 08:02:17 AM »
Hi

Just tested it on a vanilla raspberry system. Here the touch function is working.

lsmod produces the following:

Code: [Select]
pi@raspberrypi ~ $ lsmod
Module                  Size  Used by
cfg80211              420690  0
rfkill                 16659  1 cfg80211
sg                     18159  0
joydev                  9047  0
evdev                  10232  6
bcm2835_gpiomem         2995  0
rpi_ft5406              2826  0
uio_pdrv_genirq         2966  0
uio                     8235  1 uio_pdrv_genirq
i2c_dev                 6047  0
snd_bcm2835            19769  3
snd_pcm                74825  1 snd_bcm2835
snd_timer              18157  1 snd_pcm
snd                    52116  9 snd_bcm2835,snd_timer,snd_pcm
fuse                   81710  3
ipv6                  339514  30


So what is loaded in raspbian (working touch) and not loaded in piCore (no working touch) is the following modules:
Code: [Select]
cfg80211              420690  0
rfkill                 16659  1 cfg80211
sg                     18159  0
joydev                  9047  0
evdev                  10232  6
uio_pdrv_genirq         2966  0
i2c_dev                 6047  0
fuse                   81710  3
ipv6                  339514  30


Therefore, it piCore must need one of these to get the touch running - Am I correct in this deduction?
I think that we might need evdev - but I could be wrong.

Steen
lsmod

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Official raspberry touch screen support thread
« Reply #4 on: October 03, 2015, 08:21:43 AM »
Nope evdev is not enough:

I installed libevdev.tcz and i2c-tools-dev.tcz
Then rebooted:

Code: [Select]
tc@piCorePlayer1:~$ lsmod
Module                  Size  Used by    Not tainted
snd_bcm2835            19931  1
snd_pcm                75265  2 snd_bcm2835
snd_timer              18165  1 snd_pcm
rpi_ft5406              2821  0
snd                    52642  4 snd_bcm2835,snd_pcm,snd_timer
evdev                  10212  0
spi_bcm2835             7068  0
bcm2835_gpiomem         2983  0
i2c_bcm2708             4966  0
uio_pdrv_genirq         2977  0
uio                     8187  1 uio_pdrv_genirq

But evtest is still not seeing the touch screen:

Code: [Select]
tc@piCorePlayer1:~$ sudo evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      Logitech Optical USB Mouse
/dev/input/event1:      CHICONY HP Basic USB Keyboard
Select the device event number [0-1]:

Steen
« Last Edit: October 03, 2015, 08:37:47 AM by sbp »

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Official raspberry touch screen support thread
« Reply #5 on: October 03, 2015, 08:42:23 AM »
Sorry talking to myself here....

I found an error in dmesg which is of relevance:
Code: [Select]
[   12.118788] rpi-ft5406 touchscreen: Probing device
[   12.118813] rpi-ft5406 touchscreen: Missing firmware node
[   12.118839] rpi-ft5406: probe of touchscreen failed with error -2

Missing firmware note..

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Official raspberry touch screen support thread
« Reply #6 on: October 05, 2015, 08:13:45 AM »
SUCCESS it is working now.

The info on the raspberry github is not correct: https://github.com/raspberrypi/linux/issues/1147
we need to add dtoverlay=rpi-ft5406-overlay to config.txt

At the moment I'm using a home build initrd where I added the touchscreen directory to the input directory, so the structure now is:

/lib/modules/4.1.6-piCore_v7+/kernel/drivers/input/touchscreen/

I will try to make a touch_screeen.tcz to see if it is still working.

Notice - the calibrations is somewhat off. The cursor is usually located one cm above and to the left of where my finger is pressing.

Steen 

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Official raspberry touch screen support thread
« Reply #7 on: October 05, 2015, 08:26:48 AM »
OK Bela.

The touch.tcz I have send you is actually working.
It just needed us to add the dtoverlay to the config.txt file.

The next issue we need to figure out is how to calibrate the touch input with the screen resolution.

Regards
Steen

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Official raspberry touch screen support thread
« Reply #8 on: October 08, 2015, 10:39:34 AM »
Hi Bela.

Just added tc.tzc to the latest alpha_v7+ image (RPi2).
Added the touchscreen.tcz I send you and let piCore boot to GUI and the touchscreen is working fine. Here there is no calibration issue - so when you press on anything on the screen it reacts as it should. Good work..

So unfortunately it seems like it is only for using the Jivelite GUI which uses framebuffer directly I have a problem.

Regards
Steen

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: Official raspberry touch screen support thread
« Reply #9 on: October 08, 2015, 05:10:26 PM »
Hi,

I've connected the 3.5" TFT with touchscreen. Picture is perfect, but touchscreen is right/left mirrored.
I'm using this overlay for touchpanel:
Code: (bash) [Select]
dtoverlay=ads7846,speed=1000000,penirq=17,penirq_pull=2,swapxy=1,xmin=200,xmax=3900,ymin=200,ymax=3900,pmax=255,xohms=60
I've tried to use swapxy=0, but it is than completely mirrored.

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Official raspberry touch screen support thread
« Reply #10 on: October 09, 2015, 04:37:03 AM »
Hi
I'm very impressed with piCore and the new 7" official raspberry touchscreen. It reacts very smoothly to any gesture.

Se this small movie clip (piCore version 7alpha on a RPi2): https://drive.google.com/file/d/0B4EZAibb1cniWmZmX0QwcDVOT2c/view?usp=sharing

Regards
Steen

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: Official raspberry touch screen support thread
« Reply #11 on: October 09, 2015, 01:12:23 PM »
I've bring the touchscreen working. It need to create the folder
Code: (bash) [Select]
/etc/X11/xorg.conf.d
and there make file calibration.conf:
Code: (bash) [Select]
Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ADS7846 Touchscreen"
        Option  "Calibration"   "3932 300 294 3801"
        Option  "SwapAxes"      "1"
EndSection

This file sets the boundaries and scale for the touchscreen and inverts the left/right orientation.

Than I've created another file fbtft.conf:
Code: (bash) [Select]
Section "Device"
    Identifier "DeviceTFT"
    Option "fbdev" "/dev/fb1"
EndSection

This file makes the Xoutput to fb1 instead of default fb0. Strange is that it works from the command prompt, but not at the boot. It boots Xorg to HDMI and I need to exit to prompt and statrx to get it at TFT.

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: Official raspberry touch screen support thread
« Reply #12 on: October 09, 2015, 03:52:49 PM »
Finally is the issue in TFT screen size which is little bit smaller than the window. The size is smaller in both axis.
Means that the  right top corner is not visible. But there is no adjustment or calibration for flexb, or fbtft_device.
Any idea how to make the calibration of the screen size?

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: Official raspberry touch screen support thread
« Reply #13 on: October 09, 2015, 04:44:28 PM »
It will help to reduce the default GUI size of window in which is the program opened, or even better to open it in full screen mode. Than it has best resolution. Where is some setup for this?

Offline nitram

  • Hero Member
  • *****
  • Posts: 1054
Re: Official raspberry touch screen support thread
« Reply #14 on: October 09, 2015, 07:09:37 PM »
// ...or even better to open it in full screen mode.

Not familiar with Raspberry but saw reference to xorg.conf.d so maybe not that much different. Openbox provides config settings to open all applications full screen and undecorated, works great on my small netbook screen.

Not on that system ATM, something like:
    <!-- Maximize all normal windows when launched -->
    <application type="normal">
      <maximized>true</maximized>
    </application>
https://help.ubuntu.com/community/Lubuntu/Windows#Launching_Windows_Maximized_or_Fullscreen