RASP-PiTFT-Soft-Install

De MCHobby - Wiki
Révision datée du 14 décembre 2013 à 22:56 par Admin (discussion | contributions) (Page créée avec « {{RASP-PiTFT-NAV}} == Introduction == {{ADF-Image|RASP-PiTFT-Soft-Install-01.jpg|480px}} In order to add support for the 2.8" TFT and touchscreen, we'll need to install a ... »)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)
Sauter à la navigation Sauter à la recherche


MCHobby investit du temps et de l'argent dans la réalisation de traduction et/ou documentation. C'est un travail long et fastidieux réalisé dans l'esprit Open-Source... donc gratuit et librement accessible.
SI vous aimez nos traductions et documentations ALORS aidez nous à en produire plus en achetant vos produits chez MCHobby.

Introduction

Modèle:ADF-Image

In order to add support for the 2.8" TFT and touchscreen, we'll need to install a new Linux Kernel. Lucky for you, we created a kernel package that you can simply install over your current Raspbian (or Raspbian-derived) install instead of needing a whole new image. This makes it easier to keep your install up-to-date.

To use our kernel .deb files you must be using Raspbian or derivative. This wont work with Arch or other Linux flavors. As Raspbian is the official OS for the Pi, that's the only Linux we will support! Others can recompile their own kernel using our patchfile, but we have no tutorial or support or plans for such.

Avant de commencer

You'll need a working install of Raspbian with network access. If you need help getting that far, check out our collection of Pi tutorials.

We'll be doing this from a console cable connection, but you can just as easily do it from the direct HDMI/TV console or by SSH'ing in. Whatever gets you to a shell will work!

Also, run sudo apt-get update !

Téléchargement et installation

Download the multiple files you'll need by running the following commands:

cd ~
wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-bin-adafruit.deb
wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-dev-adafruit.deb
wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-doc-adafruit.deb
wget http://adafruit-download.s3.amazonaws.com/libraspberrypi0-adafruit.deb
wget http://adafruit-download.s3.amazonaws.com/raspberrypi-bootloader-adafruit-112613.deb

Modèle:ADF-Image

Next install the new kernel with

sudo dpkg -i -B *.deb

This will take a few minutes so go make a sandwich or coffee

Modèle:ADF-Image

Modèle:ADF-Image

Now we'll just reboot to let it all sink in.

If you don't have the TFT installed, shutdown, place the TFT on the Pi and re-power

sudo shutdown -h now

else (if you have the TFT plate installed already)

sudo reboot

Now that you're rebooted, log back in on the console/TV/SSH. There's no screen yet, we'll do a test to make sure everything is perfect first!

Run the following commands to install the screen driver. Note that the screen will go from white to black indicating the commands succeeded.

sudo modprobe spi-bcm2708
sudo modprobe fbtft_device name=adafruitts rotate=90
export FRAMEBUFFER=/dev/fb1
startx 

Modèle:ADF-Image

You should see the Pi desktop show up on the TFT! Congrats, you've completed the first test perfectly. Now we'll make the TFT kernel modules automatically install on boot.

Hit Control-C in the console to quit the X server so we can continue configuration

Auto-chargement du module

We'll now make the modules auto-load. Lets edit the /etc/modules list with

sudo nano /etc/modules

add two lines

spi-bcm2708
fbtft_device

Then Control-X Y [return] to save

Modèle:ADF-Image

You're not done yet! Now we have to add the configuration details in a new modprobe file:

sudo nano /etc/modprobe.d/adafruit.conf

add the following line

options fbtft_device name=adafruitts rotate=90 frequency=32000000

and save like you did before.

The rotate= variable tells the driver to rotate the screen 0 90 180 or 270 degrees. 0 is portrait, with the bottom near the "Adafruit Logo" 90 is landscape, with the bottom of the screen near the buttons. 180 is portrait, with the top near the "Adafruit Logo" 270 is landscape, with the top of the screen near the buttons. You can change this file with nano and reboot to make the change stick.

The frequency= variable tells the driver how to fast to drive the display. 32MHz (32000000) is a pretty nice 20 FPS rate but if your screen is acting funny, try taking it down to 16MHz (16000000)

Modèle:ADF-Image

sudo reboot and look at the console output (or run dmesg in the console window after logging in) you will see the modules install. Look in particular for the STMPE610 detection and the ILI9340 screen frequency as highlighted here

Modèle:ADF-Image

We can set up the touchscreen for rotate=90 configuration by doing the following (for more delicate calibration or for other rotate=XX values, see the next section) Create the directory and new calibration configuration file:

sudo mkdir /etc/X11/xorg.conf.d
sudo nano /etc/X11/xorg.conf.d/99-calibration.conf

and enter in the following lines, then save.

    Section "InputClass"
    Identifier "calibration"
    MatchProduct "stmpe-ts"
    Option "Calibration" "3800 200 200 3800"
    Option "SwapAxes" "1"
    EndSection

Modèle:ADF-Image

You can now try to run X again with

FRAMEBUFFER=/dev/fb1 startx

Type Control-C to quit X

If you don't ever want to have to type FRAMEBUFFER=/dev/fb1 before startx, you can make it a default state by editing your profile file: sudo nano ~/.profile and adding

export FRAMEBUFFER=/dev/fb1

near the top and saving the file. If you log out or reboot it will be in place from then on.

Modèle:ADF-Image


Source: Adafruit PiTFT - 2.8" Touchscreen Display for Raspberry Pi
Créé par LadyAda pour AdaFruit Industries.
Augmenté par Meurisse D. pour MCHobby

Traduction réalisée par Meurisse D pour MCHobby.be.

Toute référence, mention ou extrait de cette traduction doit être explicitement accompagné du texte suivant : «  Traduction par MCHobby (www.MCHobby.be) - Vente de kit et composants » avec un lien vers la source (donc cette page) et ce quelque soit le média utilisé.

L'utilisation commercial de la traduction (texte) et/ou réalisation, même partielle, pourrait être soumis à redevance. Dans tous les cas de figures, vous devez également obtenir l'accord du(des) détenteur initial des droits. Celui de MC Hobby s'arrêtant au travail de traduction proprement dit.

Traduit avec l'autorisation d'AdaFruit Industries - Translated with the permission from Adafruit Industries - www.adafruit.com