peps1
Posts: 7
Joined: Wed Dec 31, 2014 9:06 pm

Picking a TFT to work with a RetroPie Project?

Wed Dec 31, 2014 9:16 pm

I am brand new to the world of Pi, and want to build a handheld RetroPie.

I ordered a TFT, but the one I have seems to have the drivers built into the kernel making it unusable for this project.

The unit is a Waveshare 3.2inch, and here is some discussion on the drivers being built into the kernel issue https://github.com/notro/rpi-firmware/issues/6

So, is anyone able to recommend similar sized TFT that I will be able to use without proprietary kernels, so I can get cracking with my first project?

gknight4
Posts: 5
Joined: Thu Jan 01, 2015 12:55 am

Re: Picking a TFT to work with a RetroPie Project?

Thu Jan 01, 2015 1:12 am

I just got started with an A+ and the WaveShare 3.2 that I got from eBay. This worked for me:

https://github.com/notro/fbtft/wiki

The instructions are all here, but it took me awhile to understand what it all meant.

Enter:
sudo raspi-config

This will "expand the file system". Apparently not necessary if you're running NOOBS.

Enter:
sudo nano /usr/share/X11/xorg.conf.d/99-fbturbo.conf

There's a line in here that refers to "fb0" - apparently the HDMI monitor - and should be changed to fb1.

Enter:
sudo nano /etc/modprobe.d/raspi-blacklist.conf

There is a line in this file that disables spi:
blacklist spi-bcm2708

Comment it out:
# blacklist spi-bcm2708

Enter:
sudo REPO_URI=https://github.com/notro/rpi-firmware rpi-update

This will download and install the loadable drivers.

Enter:
sudo reboot

To load all the new drivers.

Enter:
sudo modprobe fbtft_device name=waveshare32b

To actually load the fbtft driver after the reboot.

Enter:
sudo modprobe spi-bcm2708

To load the spi driver.

Enter:
FRAMEBUFFER=/dev/fb1 startx

To run the XServer on fb1.

At this point the Raspberry Pi wallpaper appeared on the screen, along with a menu, etc., and the mouse attached through USB was active.

This all happened mere minutes before I read your post, so all the steps listed above may not be necessary. But that's what I did, and, by golly, it worked!

All of this is possible because of the work of notro, to whom we owe a great debt. Thanks!

klricks
Posts: 6705
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Picking a TFT to work with a RetroPie Project?

Thu Jan 01, 2015 4:16 am

Unless the screen (interface) has HDMI or Composite inputs then no.
There are 3.5" HDMI monitors made for professional video cameras but they are quite expensive.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

peps1
Posts: 7
Joined: Wed Dec 31, 2014 9:06 pm

Re: Picking a TFT to work with a RetroPie Project?

Fri Jan 02, 2015 4:04 am

gknight4 wrote: There's a line in here that refers to "fb0" - apparently the HDMI monitor - and should be changed to fb1.
OK, first, Thank you!

I did this and it worked, but when i restarted the pi it went back to the screen not working.......is there a way to save these setting so I don't have to type all this when ever I switch on the pi?

DirkS
Posts: 10086
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Picking a TFT to work with a RetroPie Project?

Fri Jan 02, 2015 12:29 pm

peps1 wrote:
gknight4 wrote: There's a line in here that refers to "fb0" - apparently the HDMI monitor - and should be changed to fb1.
OK, first, Thank you!

I did this and it worked, but when i restarted the pi it went back to the screen not working.......is there a way to save these setting so I don't have to type all this when ever I switch on the pi?
Yes, the modules that are loaded with 'sudo modprobe' in the 'recipe' above can be added to the file /etc/modules.
Edit the file with

Code: Select all

sudo nano /etc/modules
Add the lines (if not already there, of course):

Code: Select all

spi-bcm2708
fbtft_device name=waveshare32b
Save the file, close the editor and reboot.

Gr.
Dirk.

peps1
Posts: 7
Joined: Wed Dec 31, 2014 9:06 pm

Re: Picking a TFT to work with a RetroPie Project?

Fri Jan 02, 2015 10:50 pm

Thank you,

I have added:

spi-bcm2708
fbtft_device name=waveshare32b

to the sudo nano /etc/modules

But when I reboot I just get a blank black screen on the TFT and have to pug in my monitor to see it has booted into Emulation Station.

But, to get anything on the TFT, I have F4 out of Emulation Station into Shell, and type FRAMEBUFFER=/dev/fb1 startx to bring up anything, and that only bring up Raspbian? desktop not the GUI for Emulation Station.

So........still need it boot into Emulation Station, and show on the TFT by default.

Thank you all for your help so far :)

savall21
Posts: 11
Joined: Fri Jan 02, 2015 11:20 pm

Re: Picking a TFT to work with a RetroPie Project?

Fri Jan 02, 2015 11:22 pm

I'm trying to get a SainSmart St7735 working with my Pi. I'm following the steps but I don't have a /dev/fb1 directory. Just /dev/fb0. Should I have both if its installed properly?

gknight4
Posts: 5
Joined: Thu Jan 01, 2015 12:55 am

Re: Picking a TFT to work with a RetroPie Project?

Sat Jan 03, 2015 3:49 am

peps1:

First, I'd suggest that you get a network connection working, and then make sure that you can ssh to the pi, so that you have command line access from another computer. Then install:
apt-get install tightvncserver

so that you can use the GUI from another computer. Now you should be able to do just about anything *without* having real access to the console.

As DirkS explained, adding
fbtft_device name=waveshare32b

to /etc/modules means that you don't have to do the modprobe thing each time. The spi module doesn't seem to need to be explicitly loaded.

To run startx automatically, I followed the instructions here:
http://elinux.org/RPi_Debian_Auto_Login

Namely:

sudo nano /etc/rc.local
Scroll to the bottom and add the following above exit 0:

su -l pi -c startx

This seems to run X without any intervention.

Now my pi a+ automatically boots to the gui, with the usb keyboard and mouse active on the WaveShare 3.2 TFT. Pretty cool!

gknight4
Posts: 5
Joined: Thu Jan 01, 2015 12:55 am

Re: Picking a TFT to work with a RetroPie Project?

Sat Jan 03, 2015 3:58 am

If you're not familiar with the WaveShare, its available from eBay for 18.99 with free shipping, as:
3.2" TFT LCD Module Touch Screen Monitor Display for Raspberry Pi B/B+ dll

Has anyone been able to get the touch screen working?

The board comes with a CD that has a 4GB image that can be copied to an SD Card and the pi can run off of it. It shows a desktop, and *does* have a working touchscreen interface. Unfortunately, it seems buggy, and incompletely implemented. The method of making it work as described above seems to have a lot more future to it.

savall21
Posts: 11
Joined: Fri Jan 02, 2015 11:20 pm

Re: Picking a TFT to work with a RetroPie Project?

Sat Jan 03, 2015 6:02 am

Can anybody suggest where I'm going wrong?? My Linux troubleshooting chops are not very good. I'm trying to figure out whats not installed. The firmware update installs. I'm using sudo modprobe fbtft_device name=flexfb because I have a SainSmart 1.8 ST7735. The command executes so I know the fbtft module is loaded. However, I don't have a /dev/fb1. I'm not sure if thats a hardware or software issue. Does anyone have any troubleshooting tips?

peps1
Posts: 7
Joined: Wed Dec 31, 2014 9:06 pm

Re: Picking a TFT to work with a RetroPie Project?

Sat Jan 03, 2015 8:36 am

gknight4 wrote:peps1:

First, I'd suggest that you get a network connection working, and then make sure that you can ssh to the pi, so that you have command line access from another computer. Then install:
apt-get install tightvncserver

so that you can use the GUI from another computer. Now you should be able to do just about anything *without* having real access to the console.
Thank you gknight4,

Had a play with PuTTY lastnight, but will download tightvncserver onto the pie as having access to the GUI will be very handy!
gknight4 wrote:As DirkS explained, adding
fbtft_device name=waveshare32b

to /etc/modules means that you don't have to do the modprobe thing each time. The spi module doesn't seem to need to be explicitly loaded.

To run startx automatically, I followed the instructions here:
http://elinux.org/RPi_Debian_Auto_Login

Namely:

sudo nano /etc/rc.local
Scroll to the bottom and add the following above exit 0:

su -l pi -c startx

This seems to run X without any intervention.

Now my pi a+ automatically boots to the gui, with the usb keyboard and mouse active on the WaveShare 3.2 TFT. Pretty cool!
Thank you for this, the only issue is I don't want to automatically boot into the Debian desktop environment (though this is really handy to know how to do!).

The image I'm using on the SD card is RetroPie by default boots into a program called 'Emulation Station', so you can boot right into paying video games with nothing but a USB controller plugged in, bypassing the desktop environment.

Is there a way I can still do this, but having the output on the TFT?
savall21 wrote: Can anybody suggest where I'm going wrong??
You may want to start your own thread, as your SainSmart 1.8 is different to the WaveShare 3.2 being discussed here.

peps1
Posts: 7
Joined: Wed Dec 31, 2014 9:06 pm

Re: Picking a TFT to work with a RetroPie Project?

Sat Jan 03, 2015 12:34 pm

Edit to add:

Its quite strange, when my Pi is connected to an external monitor via HDMI and power up its show 'emulation station' (witch is good, as I want to to boot into this, Just on the TFT), BUT..... the TFT is black.

When I also connect to the Pi via VNC from my PC I see the Debian? desktop environment (LXDE?), but also cant quit out of it?

Every time I click on the red power-button on the bottom right it just gives me the logout or cancel option, but fails to log out if I click log out, so am unable to get back to shell?

So guess my questions are, why is the HDMI showing what I want the TFT to show, and why do I see a totally different environment when also connected via VNC?

DirkS
Posts: 10086
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Picking a TFT to work with a RetroPie Project?

Sat Jan 03, 2015 12:40 pm

There is a problem getting framebuffer devices (such as the small screens with notro's kernel / drivers) working with RetroPie / Emulationstation.
See for example http://www.raspberrypi.org/forums/viewt ... 28&t=88431
This suggests the use of fbcp (https://github.com/tasanakorn/rpi-fbcp).

Gr.
Dirk.

peps1
Posts: 7
Joined: Wed Dec 31, 2014 9:06 pm

Re: Picking a TFT to work with a RetroPie Project?

Sat Jan 03, 2015 12:47 pm

DirkS wrote: This suggests the use of fbcp (https://github.com/tasanakorn/rpi-fbcp).
Thanks Dirk,

How would I go about using installing something from github onto Pi?

peps1
Posts: 7
Joined: Wed Dec 31, 2014 9:06 pm

Re: Picking a TFT to work with a RetroPie Project?

Sun Jan 04, 2015 7:44 pm

Would I just type:

Code: Select all

sudo apt-get install rpi-fbcp
or

Code: Select all

sudo REPO_URI=https://github.com/tasanakorn/rpi-fbcp
or something totally different?

User avatar
DougieLawson
Posts: 36832
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Picking a TFT to work with a RetroPie Project?

Sun Jan 04, 2015 7:51 pm

Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

wermy
Posts: 2
Joined: Thu Mar 12, 2015 5:04 pm

Re: Picking a TFT to work with a RetroPie Project?

Thu Mar 12, 2015 5:06 pm

peps1 wrote:Would I just type:

Code: Select all

sudo apt-get install rpi-fbcp
or

Code: Select all

sudo REPO_URI=https://github.com/tasanakorn/rpi-fbcp
or something totally different?
Hi,
I've got the exact same screen as you on its way to me, and I'm intending to use it with retropie as well. Just curious if rpi-fbcp fixed your issues?

wermy
Posts: 2
Joined: Thu Mar 12, 2015 5:04 pm

Re: Picking a TFT to work with a RetroPie Project?

Fri Mar 13, 2015 2:59 pm

I got it working by following this guide: https://github.com/watterott/RPi-Displa ... he-display

But man, it's slow. :( Is there any way to use a screen like this at a reasonable framerate (i.e fast enough to run emulators on)?

awatterott
Posts: 8
Joined: Sat Aug 23, 2014 11:14 am
Contact: Website

Re: Picking a TFT to work with a RetroPie Project?

Wed Mar 18, 2015 8:38 am

Does your spi_bcm2708 module has DMA support?
You can check it with

Code: Select all

modinfo -F parm spi_bcm2708
If not then you can use our script for updating:
https://github.com/watterott/RPi-Displa ... -8-bit-spi

readlee
Posts: 2
Joined: Mon Oct 26, 2015 12:12 pm
Location: UK

Re: Picking a TFT to work with a RetroPie Project?

Mon Oct 26, 2015 12:18 pm

Hi, I am creating a hand held RetroPie project. I have the LCD screen working, but only with 'fbcp', which I have running from rc.local.

The issue I have is, this means the emulator runs via framebuffer /dev/fd0 (the HDMI port) as primary and fbcp = FrameBufferCopy is duplicating the buffer from the HDMI to /dev/fb1 (the LCD GPIO port). At first glace, my screen seems slow.

Can I not switch the FRAMEBUFFER somewhere at boot up, allowing 'emulationstation' to run on /dev/fd1 as primary without the need to load fbcp?

Example?:

vi /etc/rc.local
...add lines somewhere...

export FRAMEBUFFER=/dev/fb1
export SDL_FBDEV=/dev/fb1

Many thanks
Crush your enemies. See them driven before you. Hear the lamentations of their women!

leoman36
Posts: 1
Joined: Thu Nov 05, 2015 11:50 am

Re: Picking a TFT to work with a RetroPie Project?

Thu Nov 05, 2015 12:02 pm

Exact same problem, my waveshare 3,5 screen is working with retropie but image is slow and games unplayble.

But the problem is allready here with the raspbian image made for the LCD,

I'm not far to conclude that this screen just sucks

slimjim2222
Posts: 5
Joined: Fri Jan 08, 2016 4:04 am

Re: Picking a TFT to work with a RetroPie Project?

Tue Jan 12, 2016 5:10 am

this works beautiful for ada fruit 3.5 tft

sudo raspi-config

expand filesystem

disable overscan

force audio to 3.5mm

advanced options >> enable Device Tree

advanced options >> enable SPI >> load SPI kernel module by default

sudo reboot

---------------------------------------
sudo nano /boot/cmdline.txt ---> put this at the end on the same line fbcon=map:10
---------------------------------------
cd
curl -SLs https://apt.adafruit.com/add-pin | sudo bash
sudo apt-get install raspberrypi-bootloader
y
sudo apt-get -y install adafruit-pitft-helper
sudo adafruit-pitft-helper -t 35r ( speed 4800000 fps 60 ) later on change in /coot/config.txt
console on display? no
gpio 23 as on off button?

------------------------------------------
This is the over lay to produce image

sudo apt-get install cmake
git clone https://github.com/tasanakorn/rpi-fbcp
cd rpi-fbcp/
mkdir build
cd build/
cmake ..
make
sudo mkdir /usr/local/bin
sudo install fbcp /usr/local/bin/fbcp
-------------------------------------------
Instead of using the asplashscreen fix I added the boot function for fbcp to
-------------------------------------------
on its own on the second line before emulationstation is called.

sudo nano /etc/profile.d/10-emulationstation.sh
then add this

/usr/local/bin/fbcp &
----------------------------------------
To stop the cursor or blinking screen sense your there are overlapping
-------------------------------------------
sudo nano /etc/rc.local
Con2fbmap 1 0
Add this above exit 0
-------------------------------------------
/boot/config.txt
-------------------------------------------

sudo nano /boot/config.txt
hdmi_force_hotplug=1
hdmi_cvt=320 240 60 1 0 0 0
hdmi_group=2
hdmi_mode=87
dtoverlay=pitft35r,rotate=90,speed=80000000,fps=60
-----------------------------------------
This is for function get_all_modes
----------------------------------------
sudo nano /opt/retropie/supplementary/runcommand/runcommand.sh
Add the following lines to the script:
mode_new = "DMT-87"
return

sudo nano restart :D ;)

Return to “Beginners”