PiTFT 3.5” Touch Screen on Raspberry Pi 2 running Jivelite

Stacks Image 4427
First of all I assume you have a working installation of Raspbian Wheezy. You can use Jesse however you have to downgrade a library called SDL which in my mind breaks some other things. I strongly recommend using Wheezy for this project.

Okay the assumption is that you have Wheezy and networking established.

You need a Raspberry Pi 2 and the Touch Screen I recommend buying from Amazon as Adafruit’s shipping is a bit steep in my opinion. Now lets make sure Wheezy is up to date. Run these commands at a terminal prompt.

sudo apt-get update

sudo apt-get upgrade

Now run the following 4 commands to install the drivers and kernel patches for the Touch Screen.

curl -SLs https://apt.adafruit.com/add-pin | sudo bash

sudo apt-get install raspberrypi-bootloader

sudo apt-get install adafruit-pitft-helper

sudo adafruit-pitft-helper -t 35r

Let’s see if it boots. If it does you are ready to install jivelite.


If that didn’t work, try this.

FRAMEBUFFER=/dev/fb1 startx

Either way…..It is working. If you just want to stop here and use this for a desktop touch screen interface……you’re done. While I think it is cool it really isn’t that useful.

So we’ll add Jivelite which makes it a little music media server. Run this command.

sudo apt-get install git libsdl1.2-dev libsdl-ttf2.0-dev libsdl-image1.2-dev libsdl-gfx1.2-dev libexpat1-dev

Now install luajit.


mkdir luajit

cd luajit

git clone http://luajit.org/git/luajit-2.0.git
cd luajit-2.0
sudo make install
sudo ldconfig

Now for Jivelite.

NOTE: Someone very nicely pointed out to me that the previous code links for Jivelite were broken. I have updated the new repository below. The new repository changes the folder name from "jivelite" to triode-jivelite. I THINK that I fixed all the associated code below. If you run a command from this page and it doesn't work start looking at the folder name part of the syntax.


mkdir jivelite

cd jivelite

git clone https://github.com/ralph-irving/triode-jivelite.git

cd triode-jivelite

sudo make PREFIX=/usr/local


Now hook your Pi up to a TV screen and reboot. Run this command to start Jivelite on the TV. It will boot to an HD skin If you try to just boot to the touch screen the resolution is too high and it just freezes. So we have to use the TV to resize it.

sudo SDL_FBDEV=/dev/fb0 /home/pi/jivelite/triode-jivelite/bin/jivelite

Once it starts:

>set to English

>Settings>Screen>Skin>then set skin to WQVGA Small Print Skin located at the bottom of the list.

>Keep this skin

Now open another terminal and type this

sudo SDL_VIDEODRIVER=fbcon SDL_FBDEV=/dev/fb1 SDL_MOUSEDEV=/dev/input/touchscreen SDL_MOUSEDRV=TSLIB /home/pi/jivelite/triode-jivelite/bin/jivelite &

This WILL NOT Launch. You’ll get an a bunch of text in the console saying the window manger won’t open. That’s okay. Hit CTL+ C to stop jivelite and then

sudo shutdown -r now

Now reboot and issue the command again.

sudo SDL_VIDEODRIVER=fbcon SDL_FBDEV=/dev/fb1 SDL_MOUSEDEV=/dev/input/touchscreen SDL_MOUSEDRV=TSLIB /home/pi/jivelite/triode-jivelite/bin/jivelite &

It should boot perfectly to Jivelite. Now you need to configure logitechmediaserver and a squeezelite player.


mkdir logitech

cd logitech

wget -O logitechmediaserver_all.deb $(wget -q -O - "http://www.mysqueezebox.com/update/?version=7.9.0&revision=1&geturl=1&os=deb")

After it downloads type


and highlight and copy the file it downloaded and then type

sudo dpkg -i logitechmediaserver_all.deb

Hit enter and then it installs. Wait a few minutes after it installs and then go to a browser on your computer (on the same network) and type youripaddress:9000 Note that is my address. Probably not your address. Adjust accordingly.

Now lets add squeezelite.


mkdir squeezelite

cd squeezelite

wget https://squeezelite.googlecode.com/files/squeezelite-armv6

Now do this:

mv ./squeezelite-armv6 /usr/bin/squeezelite

This moves the file and renames it. Easier to call, easier to type.

Now this to change the permissions:

chmod ug+x /usr/bin/squeezelite

If you did everything right it will list your output devices when you type this at a terminal.

squeezelite -l

In my case to start squeezelite I issue this command. I have a HiFiMeDIY USB DAC. This command only works for that. You can tweak squeezelite to your DAC.

squeezelite -o front:CARD=DAC,DEV=0 -n PiTFT -s

Below is the output of squeezelite -l change your info to my command above. For example if you want to use the onboard audio of the Pi only use this

squeezelite -o sysdefault:CARD=ALSA -n PiTFT -s
Stacks Image 6086
Go to my other page for more details on this process.


Now lets make it start at boot.

At the terminal type the following

sudo nano /usr/bin/startlxde-pi

Scroll to the bottom of the file and you’ll see the last line says this:

exec /usr/bin/lxsession -s LXDE-pi -e LXDE

Change it to this by putting a # sign in front of that line

#exec /usr/bin/lxsession -s LXDE-pi -e LXDE

Add another line below it that says this:

exec sudo SDL_VIDEODRIVER=fbcon SDL_FBDEV=/dev/fb1 SDL_MOUSEDEV=/dev/input/touchscreen SDL_MOUSEDRV=TSLIB /home/pi/jivelite/triode-jivelite/bin/jivelite &

CTL + X then Y to save the file and then reboot. Now it should boot directly to jivelite. Once your squeezelite player is configured properly you can select it as a player. Be sure to refer to my other page for setting up Squeezelite and logitechmediaserver.