Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: madmax6 on March 12, 2016, 08:51:10 AM

Title: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on March 12, 2016, 08:51:10 AM
jivelite lcd touchscreen
waveshare 3.5 touchscreen
i've been trying ages to get this screen to work with picoreplayer without succes, can anyone help...

this is what i ve tried:

sudo mkdir -p/etc/X11/xorg.conf.d
sudo cp ./waveshare35a-overlay.dtb /overlays/
sudo cp -rf ./etc/X11/xorg.conf.d/99-calibration.conf-35 /etc/X11/xorg.conf.d/99-calibration.conf
sudo cp -rf ./usr/share/X11/xorg.conf.d/99-fbturbo.conf /usr/share/X11/xorg.conf.d/
sudo cp ./cmdline.txt /
sudo cp ./inittab /etc/
sudo cp ./boot/config-35.txt /boot/config.txt
filetool.sh -b

screen stays white.
tried it with raspbian and all is working
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: patrikg on March 12, 2016, 08:57:52 AM
What kernel module is loaded in raspbian to support the display.
lsmod
You may need to load that in picore.
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on March 12, 2016, 10:22:31 AM
i don't know what kernel module is loaded, this is the site of the manufacture:
http://www.waveshare.com/wiki/3.5inch_RPi_LCD_(A)
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: Rich on March 12, 2016, 10:37:18 AM
Hi madmax6
Quote
filetool.sh -b
Did you update your  filetool.lst  file first? Were the files you copied restored after you rebooted?

Quote
sudo cp ./inittab /etc/
I don't think you can use a modified  /etc/inittab  using the backup/restore mechanism. I'm pretty sure that by the time
the  inittab  is restored, the original one from the initrd has already been run.
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: jgrulich on March 12, 2016, 10:56:00 AM
Look this thread, I've wrote there everything how to bring the screen working:
http://forum.tinycorelinux.net/index.php/topic,18652.0.html

The first what you need are kernel modules, something like tft.tcz. Than you need modify cmdline.txt. You need to modify it manually, don't use that one from Rasbian. The same with the config.txt.
You don't need inittab, forget it.
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on March 12, 2016, 10:58:46 AM
yes i did, started with:

sudo mkdir -p /etc/X11/xorg.conf.d

sudo echo "etc/X11/xorg.conf.d" >> /opt/.filetool.lst

and so on,
saved my files filetool.sh -b and reboot.

i'm sure all the files are in the right places, i think it has something to do with the config file during boot.
hdmi is loaded and i can see on my hdmi screen but nothing on the 3.5 lcd screen.
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: jgrulich on March 12, 2016, 01:17:59 PM
You need the kernel modules first. In Rasbian all the modules are load by default. In TC you need to load the modules which you really need.
Use, or create and than load the tft.tcz like this: http://forum.tinycorelinux.net/index.php/topic,18652.msg119628.html#msg119628
Than it may work, or continue with this: http://forum.tinycorelinux.net/index.php/topic,18652.msg120902.html#msg120902
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on March 13, 2016, 10:05:56 AM
thnx for the info, but i can not get the screen to work.
i use picoreplayer 2.02 and it usese version 4.13 picore, added modules and added fbcon=map:10 to commandline but screens still white.
i m doing something wrong but can't find it.
can someone please give me a tutorial from scratch how to get touchscreen working?
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: jgrulich on March 14, 2016, 07:13:05 AM
OK than, step by step tutorial as follows:
1) If you're using Rpi1, than make the driver modules as described here:
http://forum.tinycorelinux.net/index.php/topic,18652.msg119628.html#msg119628
If you're using Rpi2, than download the tft.tcz from the link at the first line.
Place the tft.tcz into the /home/tc directory
2) Download the attached file and extract it into the /home/tc directory
3) run the Install script
4) backup
5) reboot

To set which display will be used for shell:
fbcon=map:10 is automatic
fbcon=map:0 is HDMI output only
fbcon=map:1 is tft output only

To set which display will be used for x window is set in the fbtft.conf file:
/dev/fb0 is for HDMI output
/dev/fb1 is for tftf output
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: jgrulich on March 14, 2016, 06:25:38 PM
I've tested in picoreplayer 2.02 and some clarification:
After SSH connection:
0) mount /mnt/mmcblk0p1
Steps 1) to 3)
4) sudo backup
5) sudo reboot
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on March 15, 2016, 03:32:49 AM
thanks, i will give that a try when i have some time and i will get back to you.
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on March 15, 2016, 04:29:23 PM
still no screen, did:

mount /mnt/mmcblk0p1
tft.tcz into the /home/tc directory
TFT.tar.gz  /home/tc directory
tar xvf TFT.tar.gx
cd /TFT
cp ./tft.tcz /mnt/mmcblk0p2/tce/optional
echo "tft.tcz" >> /mnt/mmcblk0p2/tce/onboot.lst
cp ./waveshare35a-overlay.dtb /mnt/mmcblk0p1/overlays/
echo "
dtoverlay=waveshare35a:fps=50" >> /mnt/mmcblk0p1/config.txt
echo " fbcon=map:10" >> /mnt/mmcblk0p1/cmdline.txt
mkdir -p /etc/X11
cp -R ./xorg.conf.d /etc/X11
echo etc/X11 >> /opt/.filetool.lst
sudo backup and sudo reboot

im working with rapberry pi model B
tried this but only get folder BIN with no tft.tcz file

2.   Download 4.1.13-piCore_v7+_modules.tar.xz from http://tinycorelinux.net/7.x/armv7/releases/RPi2/src/kernel/ and unpack it into tmp/core
3.   Rename the original tft.tcz to tft-orig.tcz and copy it to tmp/tft
4.   unsquash tft-orig.tft, this will give you a folder in tmp/tft called squashfs-root
5.   Copy all matching .ko entries from tmp/core to the same directory structure in tmp/tft/squashfs-root, deleting the matching .ko.gz entries - I used xfe for this
6.   In tmp/tft/squashfs-root, run 'find . -name *.ko | xargs gzip' to zip the .ko files to .ko.gz
7.   in tmp/tft squash squashfs-root to tft.tcz
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: jgrulich on March 15, 2016, 06:08:21 PM
I have the RPi B+ and it works. I've tested once again yesterday.

Try to use this tft.tcz to be sure that it's OK:
https://www.dropbox.com/s/h6bkba7qe32fihc/tft-4.1.13-piCore%2B.tcz?dl=0
Rename it to tft.tcz and place into the /mnt/mmcblk0p2/tce/optional directory.

After reboot first look into the /tmp/loop folder if there is tft.tcz to check it the tcz is extracted.
Than try to load the modules manually:

Code: (bash) [Select]
sudo modprobe 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,0x28,-1,0x11,-1,0x29,-3

sudo modprobe fbtft_device name=flexfb rotate=90 speed=16000000 gpios=reset:25,dc:24 txbuflen=32768 fps=50

If everything seems to be ok, no errors and lsmod report the modules loaded and still white screen, than the TFT is probably not Waveshare, or WS compatible, or there is some other HW problem.
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on March 16, 2016, 02:37:08 PM
Thanks  jgrulich,

that seems to work, now i have got a blackscreen with text.
(http://)

how do we autostart this?

ihave create a fbtft.sh with your script and put it in mmcblk0p1 but screen is white
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on March 16, 2016, 03:11:23 PM

how can we see jivelite?
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: jgrulich on March 16, 2016, 04:49:32 PM
Good, the issue was probably in the modules.
You don't need to use any additional script at startup.
Run the script, or the missing corresponding steps from it and do "sudo backup" and "sudo reboot".
Than it will work at startup.


Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on March 17, 2016, 03:18:10 AM
thanks jgrulich dat worked i had to use your simple script for startup, the screen works even after reboot.
so i think i'm alright with it, but my question is how to point jivelite to the screen.
when i start up i can see black screen with text,  but i wan't to see jivelite image of wat is playing, can you help me to set jivelite to the screen?
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: jgrulich on March 17, 2016, 11:28:48 AM
@madmax6
seems that we may close the issue with the tft setup.

Sorry, I don't use jivelite. I've tested to redirect it to the /dev/fb1, but no lucky.
Guess that it's question on the piCorePlayer guys in the another forum:
http://forum.tinycorelinux.net/index.php/topic,14634.90.html#lastPost
I'll post there this request.
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: jgrulich on March 18, 2016, 04:10:16 AM
Have it !!!
Hence the Jivelite is hardcoded to the HDMI, as a last resort I've used the fbcp utility which simply copy /dev/fb0 to /dev/fb1.
The setup is simple:
1) remove fbcon=map:10, or use fbcon=map:0 in the cmdline.txt
2) install rpi-vc.tcz
3) download fbcp into the /opt directory
4) place the /opt/fbcp at the end of the bootlocal.sh
5) sudo backup

And reboot. That's all.
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on March 18, 2016, 06:28:35 AM
Wow that's great news.
So we have to install rpi-vci.tz and then use framecopybuffer?
Something like this?
sudo apt-get install -y cmake
git clone https://github.com/tasanakorn/rpi-fbcp
mkdir -p rpi-fbcp/build
cd rpi-fbcp/build
cmake ..
make
sudo install fbcp /usr/local/bin/fbcp
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: jgrulich on March 18, 2016, 07:08:49 AM
Yes, that's it.
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: jgrulich on March 18, 2016, 03:53:04 PM
The fbcp has slow refresh rate and for the Jivelite VU Meter it's not useful.
Better is to use raspi2fb:
https://github.com/AndrewFromMelbourne/raspi2fb
and set the raspi2fb --daemon --fps 20
Than it's nearly same fast as the LCD at HDMI.
It consumes roughly 10% of the CPU at RPi 1.
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: jgrulich on March 20, 2016, 04:43:34 AM
The TFT works well, but the touchscreen has wrong calibration and mirrored the X axis.
Don't know how to adjust it. Hence the xorg is not running, the standard calibration can't be used.
There need to be some other way how to calibrate the ads7846 module, or additional setup when the module is loaded.
The initial setup is done when the module is loaded with overlay, but it is not enough.
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on March 20, 2016, 10:30:37 AM
Oke i will give it a try tommorow, doesn't read 99config.d?
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: jgrulich on March 20, 2016, 05:51:09 PM
I've tested whatever around /etc/X11 like setup, but no luck.
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: jgrulich on March 21, 2016, 03:29:31 AM
Hence it doesn't run under the xorg, the regular x-window calibration can't be used.
Guess that Jivelite uses general /dev/input/mice for the cursor. But it is OR function from mouse0 - regular mouse and mouse1 - touchscreen. Than I need to somehow recalibrate the mouse1 only to match.
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on March 21, 2016, 11:09:16 AM
how did you install raspi2fb in tiny core, dpkg install doesn't work?
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: jgrulich on March 22, 2016, 04:59:19 AM
I've used this link: https://github.com/AndrewFromMelbourne/raspi2fb/archive/master.zip
Installed compile-essentials, rpi-vc and followed the building steps.
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: patrikg on March 22, 2016, 06:15:03 AM
A great tip for github.

When getting from github this master.zip file, you may use this file.
If you don't have support for zip in linux.
Linux have more support for gzip and tar.

Code: (bash) [Select]
https://github.com/AndrewFromMelbourne/raspi2fb/archive/master.tar.gz
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on March 22, 2016, 06:48:05 AM
i've done that, downloaded the zip file unpack it and use winscp to copy to raspberry home/tc folder.
but the commands on tinycore differ from raspbian, how did you install this?
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on March 22, 2016, 04:37:37 PM
jgrulich can you help me; i have installed cmake and rpi-vci but i don't know how to install raspi2fb and get the screen to show jivelite...
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: jgrulich on March 23, 2016, 04:38:08 AM
The build and setup is the same as for Rasbian, but don't take care, find attached the ready made tcz.
There are both, fbtft and raspi2fb included the necessary libs. You don't need to install rpi-vc.

    [EDIT] Removed attached extension due to forum policy violation.  Rich
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: Rich on March 23, 2016, 10:47:40 AM
Hi jgrulich
Sorry, you are not allowed to post extensions on the forum so I removed it.
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on March 23, 2016, 03:53:56 PM
snatched tcz before it was removed,installed it but do i have to point dev1. cannot see jivelite
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: jgrulich on March 24, 2016, 03:04:36 AM
No, only run
Code: (bash) [Select]
sudo fbtft
or
Code: (bash) [Select]
sudo raspi2fb

as a first line of the bootlocal.sh, or if used the TFT setup there, place the "pause 1" and than the copy command.
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on March 25, 2016, 04:30:19 PM
yes thnx jgrulich ive magnaged the screen to work!
tce-load -i hdmitotft.tcz
sudo fbtft doesn't work
sudo  raspi2fb and the screen works! only touchscreen doesn't work and image is very small (i think it has to do with rendering from 1920 to 480)
is there a way to change the screen size?
and how do i startup all this automaticly?
do we need to write a simple startup script?
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on March 28, 2016, 08:45:34 AM
jgrulich thanks very much for your help, i've got it all to work.
just had to add raspi2fb to bootlocal.sh and everything works on startup!

just one last question, the raspi2fb forces hdmi screen to 320x480 but the image is to small. when i change it skinmenu from 1980 x 1080 it doesn't matter it stays small, any tips how to increase the screen image?
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on March 28, 2016, 09:00:34 AM
found the problem when raspi2fb starts:
raspi2fb[964]:info:copying from 1920x1080 to 320x480

but the screen is 480 X 320, any way to change this?
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: jgrulich on March 28, 2016, 12:32:52 PM
It resizes it automatically. You don't need to do anything.
If you like to have different resolution for the HDMI, than change it in the config.txt.
The resolution for Jivelite is set in the Jivelite setup - screen setup.
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on March 30, 2016, 04:23:20 PM
i know it adjust automatticly but the screensize is too small.
when selecting skin 640 or 1024 or 1920 it stays small n=(not fill thescreen)
i think hight en width are switched
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on March 30, 2016, 04:46:55 PM
is there a way to adjust hdmitotft to 480 x320?
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: jgrulich on April 01, 2016, 12:32:56 PM
Set the HDMI resolution in the config.txt. Look wiki how to do so.
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on February 04, 2017, 10:35:25 AM
Hello

Anyone create a working TFT.tcz for picoreplayer 3.10?
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: bmarkus on February 04, 2017, 12:26:40 PM
Hello

Anyone create a working TFT.tcz for picoreplayer 3.10?

Please visit the picoreplayer support forum.
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on February 05, 2017, 11:26:32 AM
Need some help!

managed to get the screen to work thanks to jgulrich
only scale isn't good. see image
how can we fix this?
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: jgrulich on February 05, 2017, 05:28:50 PM
Try to use
Code: (bash) [Select]
/usr/sbin/fbset -g 800 480 800 480 16
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on February 06, 2017, 04:24:07 AM
just use this in shh shell or bootlocal or config.txt
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: madmax6 on February 06, 2017, 04:58:45 AM
jgrulich this is what happens see image
no sound anymore
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: ElBoz73 on March 11, 2017, 08:51:11 AM
Hello,
I bought a PI 3 with the waveshare touchscreen and I try to get it work with picore to replace my squeezbox touch.

I found a skin for jivelite (I tested it on a standard debian ) that works with the 3.5" screen but I do not manage to install it to the picore.
Do anyone can explain to me how to add this skin?

Thanks,
Title: Re: waveshare 3.5 touchscreen how to get working in picore
Post by: ElBoz73 on March 19, 2017, 09:00:03 AM
Hi again,
I was able to get my waveshare working. But since I reformat my sd card, I am no more able to get it woks.
I use the last picore with a rasp pi 3.

Do you have a clean procedure that could help me?
Thanks for your help