Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 8 of 8
  1. #1
    Junior Member
    Join Date
    Mar 2016
    Posts
    12

    Waveshare 4inch touchscreen

    Hi all. After a lot of time of searching, I decided to make a thread asking for help. As you have read from the title, I want to make my waveshare touchscreen work with the picore player. I've read a lot of posts asking the same thing but they haven't found any solution. Could please, anyone that know how this might work, give me a how to guide? Thx in advance.

  2. #2
    Senior Member tcutting's Avatar
    Join Date
    May 2008
    Location
    Southern California, USA
    Posts
    1,343
    Quote Originally Posted by efthk23 View Post
    Hi all. After a lot of time of searching, I decided to make a thread asking for help. As you have read from the title, I want to make my waveshare touchscreen work with the picore player. I've read a lot of posts asking the same thing but they haven't found any solution. Could please, anyone that know how this might work, give me a how to guide? Thx in advance.
    Looking at the Waveshare site, it looks like there are two different 4 inch screens - the 4inch RPi LCD which is 320x480 pixels and connects via SPI, and the 4inch HDMI LCD, which is 800x480 pixels and connects via HDMI. I have a screen very similar to the second one (but without the touch screen), and it works well since (1) it connects via HDMI and (2) it's the same resolution as the official rPi 7 inch display, so the JiveLite skins for this resolution just work. I assume you have the 320x480 SPI version?

  3. #3
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    693
    In a previous message, he mentioned he is using the 4" spi version.


    I'm assuming that you are trying to get jivelite working. First install jivelite, this will also install the Touchscreen kernel modules. In pCP 3.20, I've started to include the ads7846.ko module that waveshare uses as a touch interface.

    First, I'm doing this all based on reading, the instructions http://www.waveshare.com/wiki/4inch_RPi_LCD_(A)#Driver I don't have a waveshare screen, so there is no way for me to troubleshoot.

    You will need to download this to. http://www.waveshare.com/w/upload/7/...-170309.tar.gz Hopefully this is designed for the new 4.9.y kernels.

    Once extracted, do not run the LCD4-show script......but you need to read what that script is doing.

    The files of interest are

    waveshare35a-overlay.dtb
    -Copy this file to /mnt/mmcblk0p1/overlays/waveshare35a-overlay.dtbo
    -and /mnt/mmcblk0p1/overlays/waveshare35a-overlay.dtb


    The next files are the configs for orientation......look at the last lines of the file

    boot/config-4.txt
    boot/config-4.txt-90
    boot/config-4.txt-180
    boot/config-4.txt-270

    depending on the orientation (This is the lines from config-4.txt) Add these lines to /mnt/mmcblk0p1/config.txt
    dtoverlay=waveshare35a
    dtoverlay=ads7846,cs=1,penirq=17,penirq_pull=2,spe ed=1000000,keep_vref_on=1,swapxy=0,pmax=255,xohms= 60,xmin=200,xmax=3900,ymin=200,ymax=3900

    After making the edits, reboot and see if the screen starts up......there is a chance that the screen will stay dark.....the key will be if /dev/fb1 is present on your system, there should also be some messages in dmesg. Lets see how this goes, before moving on.


    Reminder, if you save files in your home directory, backup before rebooting (pcp bu)
    /mnt/mmcblk0p1 is persistent, so backup is not needed here.

  4. #4
    Junior Member
    Join Date
    Mar 2016
    Posts
    12

    Waveshare 4inch touchscreen

    Thx for your quick reply. I've done everything you suggested but the white screen is still there. when i type the dmesg command, it returns this many times: status 0x80000001
    [ 351.495198] bcm2708_fb soc:fb: Failed to allocate GPU framebuffer (-22)
    [ 351.495204] bcm2708_fb_pan_display(0,0) returns=-22

    I've also added the lines in the config.txt file. The /dev/fb1 file is not there. I've seen that the script "LCD-show" tries to install xserver. I attach the dmesg result.


    1.txt


    Quote Originally Posted by paul- View Post
    In a previous message, he mentioned he is using the 4" spi version.


    I'm assuming that you are trying to get jivelite working. First install jivelite, this will also install the Touchscreen kernel modules. In pCP 3.20, I've started to include the ads7846.ko module that waveshare uses as a touch interface.

    First, I'm doing this all based on reading, the instructions http://www.waveshare.com/wiki/4inch_RPi_LCD_(A)#Driver I don't have a waveshare screen, so there is no way for me to troubleshoot.

    You will need to download this to. http://www.waveshare.com/w/upload/7/...-170309.tar.gz Hopefully this is designed for the new 4.9.y kernels.

    Once extracted, do not run the LCD4-show script......but you need to read what that script is doing.

    The files of interest are

    waveshare35a-overlay.dtb
    -Copy this file to /mnt/mmcblk0p1/overlays/waveshare35a-overlay.dtbo
    -and /mnt/mmcblk0p1/overlays/waveshare35a-overlay.dtb


    The next files are the configs for orientation......look at the last lines of the file

    boot/config-4.txt
    boot/config-4.txt-90
    boot/config-4.txt-180
    boot/config-4.txt-270

    depending on the orientation (This is the lines from config-4.txt) Add these lines to /mnt/mmcblk0p1/config.txt
    dtoverlay=waveshare35a
    dtoverlay=ads7846,cs=1,penirq=17,penirq_pull=2,spe ed=1000000,keep_vref_on=1,swapxy=0,pmax=255,xohms= 60,xmin=200,xmax=3900,ymin=200,ymax=3900

    After making the edits, reboot and see if the screen starts up......there is a chance that the screen will stay dark.....the key will be if /dev/fb1 is present on your system, there should also be some messages in dmesg. Lets see how this goes, before moving on.


    Reminder, if you save files in your home directory, backup before rebooting (pcp bu)
    /mnt/mmcblk0p1 is persistent, so backup is not needed here.
    Last edited by efthk23; 2017-04-25 at 08:53.

  5. #5
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    693
    Quote Originally Posted by efthk23 View Post
    Thx for your quick reply. I've done everything you suggested but the white screen is still there. when i type the dmesg command, it returns this many times: status 0x80000001
    [ 351.495198] bcm2708_fb soc:fb: Failed to allocate GPU framebuffer (-22)
    [ 351.495204] bcm2708_fb_pan_display(0,0) returns=-22

    I've also added the lines in the config.txt file. The /dev/fb1 file is not there. I've seen that the script "LCD-show" tries to install xserver. I attach the dmesg result.
    Can you ask Waveshare if they support 4.9.y kernels yet. It sure would be nice if they just submit their overlays to rpi for inclusion in the standard kernel.

  6. #6
    Junior Member
    Join Date
    Mar 2016
    Posts
    12
    They said that there is no support for 4.9 kernel only for 4.4. They also said that it doesn't matter which kernel version is supported.
    Last edited by efthk23; 2017-04-26 at 02:07.

  7. #7
    Hello efthk23,

    with the help of this two threads I get the Waveshare 4" TFT working well with jivelite.
    I use Picoreplayer 3.02 with kernel 4.4.

    Link 1
    Link 2

    I hope it helps you to.

  8. #8
    Quote Originally Posted by paul- View Post
    ...
    I'm assuming that you are trying to get jivelite working. First install jivelite, this will also install the Touchscreen kernel modules. In pCP 3.20, I've started to include the ads7846.ko module that waveshare uses as a touch interface.
    ...
    supplementary:
    The module ads7846.ko is only for the touch interface.
    To get the screen working the module fbtft.ko ist required. This module is standard in debian releases but not in PiCorePlayer based on TinyCore Linux. To get the module in PiCorePlayer you have to build in the module and recompile the kernel.
    In my case I dont know how to recompile a kernel. So I build a .tcz extension that loads the module on startup.
    Last edited by piPlayer; 2017-04-27 at 01:50.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •