User avatar
saper_2
Posts: 232
Joined: Sun Aug 03, 2014 10:08 am
Location: PL

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Thu Apr 21, 2016 8:47 pm

Hi,

This start to get on me, asking here "does kedei screen works with blahblahblah" - use google, does really this young generation have some brain illness and can't use google?, I'm pretty sure there is already answer (not that I'm going to check), I think it was answered already too.

As author of topic, if I'll be in bad mood then I'm going to ask moderator to whack that post (and give some notice/warning) :twisted: (you're lucky that I'm not mod or admin :D )
This topis is for hardware modification and controlling this screen from user-space (CLI) program
So, any post not fitting this might be reported (depends on my mood :twisted: )
GAMELASTER wrote:Hello, I have KeDei v5.0 (the 2016 version) and I want to run the RetroPie, but its not working.
And another question, is possible to increase the frequency of the display?
I don't know if retropie will work, ask on retropie forum - anyway I wouldn't be optimistic - issue is refresh rate, and it's going to your second question - no it is not possible to get decent refresh rate (decent > 15fps) with given hardware design of this lcd.



Conjur
I don't know how fast is "bitbang" mode in FT232 but I think this might not work :),, ftdi might not keep up to interface (usb normal devices (not HID) are polled every about 10ms...)...

OT:
Anyway I'm not idle too, on weekend I committed a copy-paste (find&replace ;) ) driver for DS2413 clone ( 3A 2100H ) , I just can't find good time to push the code into github & issue pull request on rpi kernel repo (my git-extension is moody...) (on my YT channel there is demo movie :) ).
Also I'm one step closer to the interface, I etched in last weekend too a one-sided pcb with fbtft-interface, so I just need to solder it, and hook up to lcd module. At least one project is slowly going forward ;) (there is still a whole pile of other pending projects...)

GAMELASTER
Posts: 38
Joined: Sat Feb 14, 2015 8:05 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Thu Apr 21, 2016 10:33 pm

@saper_2
Okay, thanks for info! :-)
@Conjur
:lol: spyware? lol. I found the standalone driver in kedei website:
http://en.kedei.net/raspberry/raspberry.html
Its contains a spyware too?

And that CLI things would be awesome? I dont want to make the display working nonstop :D

User avatar
saper_2
Posts: 232
Joined: Sun Aug 03, 2014 10:08 am
Location: PL

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Sat Apr 23, 2016 12:42 pm

GAMELASTER wrote: :lol: spyware? lol. I found the standalone driver in kedei website:
http://en.kedei.net/raspberry/raspberry.html
Its contains a spyware too?
First, the "driver" is not driver, this is a complete kernel with modules (and some script to swap kernels&modules...) - it's compiled.
AS for spyware - I don't know, I had to route pi net traffic through (or mirror all traffic to) a computer with network sniffer&analyzer , and check if it's making any "unusual connections" - but doing it is a pain in neck... Not to mention to download kedei sysimage at light speed of 8kb/s :shock: (yes, as programmer/electronic constructor I'm lazy person :D ).

-- eidt --
Actually I found an interesting information while looking for "kernel decompile", I stumbled on this post on XDA: http://forum.xda-developers.com/showpos ... ostcount=3, author say interesting thing:
If the vendor got some specific patches (they do), you'll have to get the kernel source from them, patches included. They must supply you the source, or be in violation of the GNU General Public License.
Well, we probably can guess what manufacturer have approach to this matter (he probably don't give a *&[email protected]#[email protected]# about this...). I'll look how I can get in touch with manufacturer...

Conjur
Posts: 17
Joined: Wed Apr 06, 2016 8:55 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Sun Apr 24, 2016 3:02 am

saper_2 wrote:
GAMELASTER wrote: :lol: spyware? lol. I found the standalone driver in kedei website:
http://en.kedei.net/raspberry/raspberry.html
Its contains a spyware too?
First, the "driver" is not driver, this is a complete kernel with modules (and some script to swap kernels&modules...) - it's compiled.
AS for spyware - I don't know, I had to route pi net traffic through (or mirror all traffic to) a computer with network sniffer&analyzer , and check if it's making any "unusual connections" - but doing it is a pain in neck... Not to mention to download kedei sysimage at light speed of 8kb/s :shock: (yes, as programmer/electronic constructor I'm lazy person :D ).

-- eidt --
Actually I found an interesting information while looking for "kernel decompile", I stumbled on this post on XDA: http://forum.xda-developers.com/showpos ... ostcount=3, author say interesting thing:
If the vendor got some specific patches (they do), you'll have to get the kernel source from them, patches included. They must supply you the source, or be in violation of the GNU General Public License.
Well, we probably can guess what manufacturer have approach to this matter (he probably don't give a *&[email protected]#[email protected]# about this...). I'll look how I can get in touch with manufacturer...
saper_2-
While messing with KeDei's driver, I noticed some strange connections in the netstat on the RPi it's self; going to servers that are in Chinese (well. the website on the server is in Chinese)

As for GPL, good luck; already traveled this road with the Sapido routers. Chinese "manufactures" really don't care about GPL, and ignore it freely. It's kind of depressing really; with some good opensource drivers, their products would see a pretty healthy boost in sales....

Finally, IRT the FT232; the kedei "driver" sets the SPI clock to core/8... I set core speed to 1 (causes lots of issues on the system; but the display init's properly), effectively giving me a spi bus speed of 125k; and you are correct, I was not able to retrieve anything useful yet; can't even capture clock ticks or chip select for some reason (clock and L_CS always reads 0); but when reading MOSI ~100k times per second, I get random numbers, but so far every dump is a different; starting to think that I am just picking up a random number from having MOSI floating...

V/r,
Mike

Roverius
Posts: 3
Joined: Sun Apr 24, 2016 12:03 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Sun Apr 24, 2016 12:12 pm

I also have tried to get this TFT to work.

When i boot up the Pi, the display just stays white.

I downloaded the driver from the kedei website (V.5) but i have no idea how to install this.
I am a rooky into adding and/or compiling drivers.

Is there any good explanation how to install this drivers.
The most things i found, did not work at all.

Or, i did something wrong, or the TFT is mallfunction.

Regards,
Roverius

User avatar
saper_2
Posts: 232
Joined: Sun Aug 03, 2014 10:08 am
Location: PL

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Sun Apr 24, 2016 1:41 pm

Roverius wrote:I also have tried to get this TFT to work.

When i boot up the Pi, the display just stays white.

I downloaded the driver from the kedei website (V.5) but i have no idea how to install this.
I am a rooky into adding and/or compiling drivers.

Is there any good explanation how to install this drivers.
The most things i found, did not work at all.

Or, i did something wrong, or the TFT is mallfunction.

Regards,
Roverius
Unpack it:

Code: Select all

tar zxf LCD_show_v5.tar.gz
, go to dir LCD_show_v5, first run:

Code: Select all

sudo ./LCD_backup
Then run:

Code: Select all

sudo ./LCD35_v5
Pi reboot, and LCD should work.
Note: first expand raspbian filesystem, update & upgrade os.

If you don't get it, then grab whole system image - it have about 4GiB @ 8kb/s :D

Roverius
Posts: 3
Joined: Sun Apr 24, 2016 12:03 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Sun Apr 24, 2016 2:42 pm

saper_2 wrote:
Roverius wrote:I also have tried to get this TFT to work.

When i boot up the Pi, the display just stays white.

I downloaded the driver from the kedei website (V.5) but i have no idea how to install this.
I am a rooky into adding and/or compiling drivers.

Is there any good explanation how to install this drivers.
The most things i found, did not work at all.

Or, i did something wrong, or the TFT is mallfunction.

Regards,
Roverius
Unpack it:

Code: Select all

tar zxf LCD_show_v5.tar.gz
, go to dir LCD_show_v5, first run:

Code: Select all

sudo ./LCD_backup
Then run:

Code: Select all

sudo ./LCD35_v5
Pi reboot, and LCD should work.
Note: first expand raspbian filesystem, update & upgrade os.

If you don't get it, then grab whole system image - it have about 4GiB @ 8kb/s :D

Well thx, that made it work

I did lots of things with that driver files, but your simple explanation made it work.

Thanks a lot :)

Roverius
Posts: 3
Joined: Sun Apr 24, 2016 12:03 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Mon May 02, 2016 5:02 pm

Hi,

Is there a way to change the \boot\config.txt file so that the resolution for:

Screen1 LCD 3.5 inch stays at 480x320

and HDMI screen is set to like the 1280x720

for the moment, the HDMI size is small (like 480x320)

I have added the config.txt
Attachments
config.rar
config file
(971 Bytes) Downloaded 340 times

User avatar
saper_2
Posts: 232
Joined: Sun Aug 03, 2014 10:08 am
Location: PL

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Mon May 02, 2016 7:37 pm

Roverius wrote:Hi,

Is there a way to change the \boot\config.txt file so that the resolution for:

Screen1 LCD 3.5 inch stays at 480x320

and HDMI screen is set to like the 1280x720
I don't know, try forcing HDMI mode, google for it. I use it (force hdmi mode - pi have problem with detecting native resolution of my old LG lcd monitor) from time-to-time and I find this by google.
Test it ,and write your results.

masterjon
Posts: 4
Joined: Thu Feb 18, 2016 3:45 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Tue May 03, 2016 3:58 pm

Does anyone know how to permanently change the size of the windows so they fit the screen.

PiFir
Posts: 5
Joined: Sun Apr 24, 2016 9:11 am

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Mon May 09, 2016 5:24 pm

saper_2 wrote:
Roverius wrote:I also have tried to get this TFT to work.

When i boot up the Pi, the display just stays white.

I downloaded the driver from the kedei website (V.5) but i have no idea how to install this.
I am a rooky into adding and/or compiling drivers.

Is there any good explanation how to install this drivers.
The most things i found, did not work at all.

Or, i did something wrong, or the TFT is mallfunction.

Regards,
Roverius
Unpack it:

Code: Select all

tar zxf LCD_show_v5.tar.gz
, go to dir LCD_show_v5, first run:

Code: Select all

sudo ./LCD_backup
Then run:

Code: Select all

sudo ./LCD35_v5
Pi reboot, and LCD should work.
Note: first expand raspbian filesystem, update & upgrade os.

If you don't get it, then grab whole system image - it have about 4GiB @ 8kb/s :D
I did this on OSMC, bricked my Pi whoops :/
When I connect the power it shows this on the tft:
https://drive.google.com/open?id=0B6bpk ... nBqSkFPTkE
HDMI is not working yet screen is not on sleep mode and no ethernet to connect to SSH.

Any help would be appreciated :) If I have to re-flash the image is it possible to get all of my Kodi addons to the new flash?

WolleP
Posts: 1
Joined: Sat May 21, 2016 12:50 am

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Sat May 21, 2016 1:11 am

Hello,

I have two questions about this display (V6.0)

1)
I have tried to programm it with python and pygame this way:

Code: Select all

import pygame
import os
from time import sleep

# os.environ["SDL_FBDEV"] = "/dev/fb0"
os.putenv('SDL_FBDEV', '/dev/fb0')
...
The display woks this way.

But if i try to use the touch function this way:

Code: Select all

import pygame
import time
import RPi.GPIO as GPIO
from pygame.locals import *
import glob
import sys
import os

os.environ["SDL_FBDEV"] = "/dev/fb0"
# os.environ["SDL_MOUSEDEV"] = "/dev/input/touchscreen"
# os.environ["SDL_MOUSEDEV"] = "/dev/input/mouse0"
os.environ["SDL_MOUSEDEV"] = "/dev/input/event0"
# os.environ["SDL_MOUSEDEV"] = "/devices/virtual/input/input0"
# os.environ["SDL_MOUSEDEV"] = "/dev/input/mice0"
os.environ["SDL_MOUSEDRV"] = "TSLIB"
I get the following:
File "gpiocontrol.py", line 60, in <module>
screen = pygame.display.set_mode(size)
pygame.error: Unable to open mouse
What is the fault?
With Adafruit 2.8 Capacitive it works.
(With
os.environ["SDL_FBDEV"] = "/dev/fb1"
os.environ["SDL_MOUSEDEV"] = "/dev/input/touchscreen"
)


And
2)
What is the way to configure and calibrate the device?
Does anybody knows?

Thank you very much!!

jjh1
Posts: 5
Joined: Mon May 23, 2016 9:39 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Mon May 23, 2016 9:48 pm

Hello all,

When I opened the .gz file provided for V6 from Kedei I found the two kernels for Raspbian Jessie but also a lib directory. This tree matches the lib tree inside of an installed new version of Jessie and contains .hw and .ko files and a Drivers directory. I'm too new at this to be implementing all this but I think that inside of this lib directory may be the info we are looking for.

Jen

jjh1
Posts: 5
Joined: Mon May 23, 2016 9:39 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Tue May 24, 2016 12:24 am

I took the .ko files out of the KeDei video and touchscreen directories and used them to overwrite the identical files in the new non Kedei Jessie installation. No change. Is there any way to make the kernel recognize these new .ko files? - j

jjh1
Posts: 5
Joined: Mon May 23, 2016 9:39 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Tue May 24, 2016 2:23 am

After looking in an alias file I found this:

alias platform:ili9341 fb_ili9341
alias spi:ili9341 fb_ili9341
alias platform:fb_ili9341 fb_ili9341
alias spi:fb_ili9341 fb_ili9341
alias of N*T*Cilitek,ili9341* fb_ili9341

so I put fb_ili9341 in my /etc/modules file. It was accepted. Modprobe finds it and lsmod shows it as loaded. I still haven't gotten an fb01 file in the /dev directory. When I try to put ili9341 in the /etc/modules file it won't work. What can I do next? This is all inside of the new official Raspbian Jessie, not Kedei's img file. Thanks. -j

jjh1
Posts: 5
Joined: Mon May 23, 2016 9:39 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Tue May 24, 2016 3:38 am

Also, if this matters, fbtft is shown as used by fb_ili9341. I just don't know how to get this all to create the fb1 file so that I can load the LCD. (or I could be completely off track) -j

harbaum
Posts: 7
Joined: Mon Jun 04, 2012 10:33 am

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Tue May 24, 2016 7:57 am

saper_2 wrote: Unpack it:

Code: Select all

tar zxf LCD_show_v5.tar.gz
...
I just received a v6 version of this display from ebay. My experience so far: The LCD_show_v6.tar.gz (and likely also the v5 package) expect a 4.1.19 kernel. The latest raspbian will thus not work as it relies on a newer kernel. I had partial success with the LCD_show_v6.tar.gz package on top of https://downloads.raspberrypi.org/raspb ... 016-03-18/

"Partial" success because after installation the display came alive and the system booted into the desktop. But the desktop immediately froze. Maybe an even older version of raspbian is required.
saper_2 wrote: If you don't get it, then grab whole system image - it have about 4GiB @ 8kb/s :D
I asked my chinese ebay seller for software as he states one should ask him for the link. He gave me exactly this 8kb/s link. I complained since the download would take longer than a day. He then sent me a login to his own account on some cloud share thing. Unfortunately that only had "drivers" up to v5 but he sent me a v6 board. So i complained again. He promised to upload a v6 asap (he probably also has to grab it with 8kb/s himself). I'll then ask him for a version for the latest raspbian and/or the source code which i am sure he'll not be able to provide that ...

As a side note: The v5 divers don't give any visible result on the v6 board. So there actually seems to be a hardware difference. I was hoping that at one point the hardware may have changed to get it closer to the faster setups. But that doesn't seem to be the case. The hw still consists of the same 3 shift registers. I don't know what the differences between v5 and v6 are.

harbaum
Posts: 7
Joined: Mon Jun 04, 2012 10:33 am

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Tue May 24, 2016 8:15 am

jjh1 wrote:I'm too new at this to be implementing all this but I think that inside of this lib directory may be the info we are looking for.
No, these are just binariy kernel modules for a specific kernel version. You cannot just copy them forth and back between different kernels. Kernels refuse to use modules with a mismatching version. You need the diver source code to be able to recompile it for a recent kernel. Imho noone here has access to that even though the GPL license the linux kernel comes under requires the source code of such modified modules to be made available.

jjh1
Posts: 5
Joined: Mon May 23, 2016 9:39 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Tue May 24, 2016 5:51 pm

I've got 30 of these KeDei V6.0 screens that I would be willing to take a partial loss on if they went to people who were interested in making them work with fbtft and outside of KeDei's precompiled kernel. PM me if you're interested. - j

harbaum
Posts: 7
Joined: Mon Jun 04, 2012 10:33 am

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Wed May 25, 2016 7:07 am

I am nor sure it's worth the effort to write a proper driver You'd need to manually reinstall the driver whenever you update the kernel.

I like saper_2's approach of modifying the hardware. I wonder if it would be possible to keep the two 595's on the displays data lines of the KeDei, remove and bridge the third shift register and rewire just the control signals to the gpio to make the whole setup waveshare compatible ... or similar.

But 30 displays are worth ~$300 and modifying them probably isn't worth the time ...

Gold samurai
Posts: 11
Joined: Mon May 30, 2016 4:40 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Mon May 30, 2016 5:06 pm

Hi I just signed up with this board.

I need help. I followed the instructions by saper_2

When I connect the Pi to ]the HDMI monitor I get as far as here then a black screen


When I just put LCD in I get bricked here
Attachments
IMG_0915.JPG
IMG_0915.JPG (43.12 KiB) Viewed 6727 times
IMG_0914.JPG
IMG_0914.JPG (19.59 KiB) Viewed 6727 times
IMG_0914.JPG
IMG_0914.JPG (19.59 KiB) Viewed 6727 times

User avatar
saper_2
Posts: 232
Joined: Sun Aug 03, 2014 10:08 am
Location: PL

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Tue May 31, 2016 9:26 pm

Hi,

WolleP - did you even checked that those devices exists? Device might be locked by some other process too...

jjh1 - I already looked around the kedei kernel but those comes from a 4.1.x kernel (kernel that still have ili-drivers not moved to fbtft ).

harbaum (@24 may) - diffs between v5 and v6 might be in init sequence. I'm not suprised it didn't work, or there might be even swapped some signal lines between '595 and LCD display to make pcb simpler (I do this sometimes too - I change (while building prototype) pcb design for shorter traces/less vias/etc. and compensate those hw changes in software/firmware).

jjh1 - I think you wasted money for those 30pcs (you locked yourself for kedei precompiled kernel, but try to press on seller to provide you the source code of driver - for this quantity he/she should give you).... But first (before spending that much money), you should look around and even ask, I would (probably not only me :) ) suggest you to get a lcd's that are natively supported by fbtft...
harbaum wrote:I like saper_2's approach of modifying the hardware.
I like it too :mrgreen: but I can't force myself to finish this little project :/

samurai
I'm not sure if I understand you correctly...
Your Pi with kedei lcd hang's at boot... If I see right (btw. your photo sucks ;) - it's blurry and there is reflection from lamp ), then image that you written into card is broken (bad download) or sd card is too small for it... Burn it again to card if nothing change then download anew...
HDMI screen switch off the moment kedei kernel get loaded because kedei "hijack hdmi output" (explaining it the simplest way - it was explained few times already how the "driver" works) and redirect to 3,5" lcd...


@@ end of batch answer :lol: @@

Gold samurai
Posts: 11
Joined: Mon May 30, 2016 4:40 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Wed Jun 01, 2016 2:59 am

bigbone wrote: LAST QUESTION. What do I have to do to at least switch between HDMI and LCD?

Thanks again!
Sorry but did anyone have an answer to this? I might have missed it

My Kedei is 6.1 version

Pilsener
Posts: 58
Joined: Thu Jan 03, 2013 3:25 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Thu Jun 02, 2016 2:14 pm

Any solution to make these displays work yet?

DenisPac
Posts: 1
Joined: Wed Sep 18, 2013 1:04 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Thu Jun 02, 2016 2:24 pm

I've succedded to make working this v1.1 KeDei touchscreen using an old Wheezy image.
My goal is to use it to make a kind of Squeezebox touch.
I've installed SqueezeLite and JiveLite successfully, but the low resolution of the screen prevents me to configure JiveLite properly (default 800x600). As a workaround I tried to connect the RPI to a HDMI screen, but since the fb0 is hijacked by the kerlel patch installed to make the TFT screen working, I can't use the simple con2fbmap 1 1 to swap between screen.
Is there any way to swap the screen?

Thanks in advance.

Return to “Interfacing (DSI, CSI, I2C, etc.)”