drballindahouse
Posts: 8
Joined: Wed May 20, 2015 10:48 pm

PiPlay and Adafruit screen

Wed May 20, 2015 10:54 pm

I bought myself a adafruit 2.8inch touch screen which connects to the Pi's GPIO and I want to get PiPlay to display on it but am having trouble with it. Ive followed the adafruit instructions on how to get it working but ive had no results so far...any ideas? I've also tried cupcade but for some reason my keyboard and controller aernt picked up by it and I can't figure out how to get mega drive ROMs on it but that's not what I need help with!!!

Many thanks!

DazzF
Posts: 22
Joined: Sun Aug 19, 2012 5:32 pm

Re: PiPlay and Adafruit screen

Thu May 21, 2015 8:39 am

Hi,

I have had the same problem in the past, so first up, does the screen actually work?

When powered on the screen should turn white. If the screen does not turn white it’s a basic hardware problem, for me it was both my poor soldering and the ribbon cable that attached the screen to the Adafruit PCB was not correctly fitted.

Once I got passed that the screens turn white, but nothing else happened. Eventually I found a post about the fbtft kernel modules. So here’s how I fixed it…

Go to the command line by either plugging in a keyboard/mouse/monitor or SSH to it from another machine, login and type the command sudo dmesg

Search the output and hopefully you should get something like this… I did not

[ 4.943251] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[ 4.961348] fbtft_device: module is from the staging directory, the quality is unknown, you have been warned.
[ 4.975924] fbtft_device: SPI devices registered:
[ 4.982202] fbtft_device: spidev spi0.0 500kHz 8 bits mode=0x00
[ 4.989911] fbtft_device: spidev spi0.1 500kHz 8 bits mode=0x00
[ 4.997537] fbtft_device: 'fb' Platform devices registered:
[ 5.004551] fbtft_device: bcm2708_fb id=-1 pdata? no
[ 5.011276] fbtft_device: Deleting spi0.0
[ 5.018110] fbtft_device: GPIOS used by 'pitft':
[ 5.024671] fbtft_device: 'dc' = GPIO25
[ 5.031535] fbtft_device: SPI devices registered:
[ 5.038035] fbtft_device: spidev spi0.1 500kHz 8 bits mode=0x00
[ 5.042428] fb_ili9340: module is from the staging directory, the quality is unknown, you have been warned.
[ 5.057511] fbtft_device: fb_ili9340 spi0.0 60000kHz 8 bits mode=0x00

I eventually figured out the command modprobe fbtft_device name=pitft rotate=90 speed=60000000 fps=60
The screen went black as the drivers started. I then installed ‘fbcp ‘ and started it with the command sudo /usr/local/bin/fbcp &
The screen now displayed whatever was on the HMDI output, and when I started mame the games played really well.

Hope some of this helps…

Dazz

drballindahouse
Posts: 8
Joined: Wed May 20, 2015 10:48 pm

Re: PiPlay and Adafruit screen

Thu May 21, 2015 8:16 pm

Thanks but i dont quite understand how to "search the outpost" or does it do it automatically? and do i just type "modprobe fbtft_device name=pitft rotate=90 speed=60000000 fps=60" into the kernal and it works, or??? Does it load to the screen automatically? Also if its not too much trouble could you send me your edited img so i can just load it up instead of having to do all of this stuff because i've been doing it for so long now almost 30 hours and its just not working! if you do can u just let me know what version of PiPlay it is just because of my sd card size! But ill have a crack at it some when anyway from what you've said!

-Thanks!

DazzF
Posts: 22
Joined: Sun Aug 19, 2012 5:32 pm

Re: PiPlay and Adafruit screen

Sat May 23, 2015 9:06 am

Hi,

My apologies for not being very clear, when I say search the output, I meant look through the output text from the command ‘sudo dmesg’. You’re looking for the text listed here, or something very similar.

[ 4.943251] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[ 4.961348] fbtft_device: module is from the staging directory, the quality is unknown, you have been warned.
[ 4.975924] fbtft_device: SPI devices registered:
[ 4.982202] fbtft_device: spidev spi0.0 500kHz 8 bits mode=0x00
[ 4.989911] fbtft_device: spidev spi0.1 500kHz 8 bits mode=0x00
[ 4.997537] fbtft_device: 'fb' Platform devices registered:
[ 5.004551] fbtft_device: bcm2708_fb id=-1 pdata? no
[ 5.011276] fbtft_device: Deleting spi0.0
[ 5.018110] fbtft_device: GPIOS used by 'pitft':
[ 5.024671] fbtft_device: 'dc' = GPIO25
[ 5.031535] fbtft_device: SPI devices registered:
[ 5.038035] fbtft_device: spidev spi0.1 500kHz 8 bits mode=0x00
[ 5.042428] fb_ili9340: module is from the staging directory, the quality is unknown, you have been warned.
[ 5.057511] fbtft_device: fb_ili9340 spi0.0 60000kHz 8 bits mode=0x00

If you cannot see this text then use the command

sudo modprobe fbtft_device name=pitft rotate=90 speed=60000000 fps=60

The screen should now turn black? If your screen does turn black at this point, then you’re ready to configure the module to load at boot.

Use the following command to edit the file that loads modules during the boot sequence.

sudo nano /etc/modules

Here is a listing of my modules file…

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

snd-bcm2835
#ft6x06_ts
uinput
joydev
#stmpe-ts
fbtft_device name=pitft rotate=90 speed=60000000 fps=60

NOTE: I’ve commented to out the original entry of the PITFT ft6x06_ts and have simply added the parameters the modprob command.

The next step is to get fbcp to run as a service during boot, as this utility copies the contents of the frame buffer to the TFT display. You can create a new service to start at boot by creating a file in the directory /etc/init.d, use the following command to create a file for editing.

sudo nano /etc/init.d/zzz-fbcp

my file looks like this..

#! /bin/sh
### BEGIN INIT INFO
# Provides: start fbcp at the on of the services loading section of the boot sequence.
# Required-Start:
# Required-Stop:
# Should-Start:
# Default-Start: S
# Default-Stop:
# Short-Description: Show custom splashscreen
# Description: Show custom splashscreen
### END INIT INFO


do_start () {
/usr/local/bin/fbcp &
exit 0
}

case "$1" in
start|"")
do_start
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
# No-op
;;
status)
exit 0
;;
*)
echo "Usage: asplashscreen [start|stop]" >&2
exit 3
;;
esac

Once created, we just need to run a couple of commands to set the file is executable and tell the operating system that the service needs to be started at boot.

sudo chmod a+x /etc/init.d/zzz-fbcp
sudo insserv /etc/init.d/zzz-fbcp

And that’s it………

DazzF
Posts: 22
Joined: Sun Aug 19, 2012 5:32 pm

Re: PiPlay and Adafruit screen

Sat May 23, 2015 9:10 am

As far as and images, I’m using a 32 GB SD card that’s fully loaded ROMs. I’ll have a go at removing the ROMs and shrink the image to see if I can upload it.

Return to “Graphics, sound and multimedia”