« Cohabitation écran Adafruit PiTFT 2.8" et HDMI » : différence entre les versions

De knowledge
Aller à la navigation Aller à la recherche
mAucun résumé des modifications
Ligne 9 : Ligne 9 :


== Méthode 1 : Console sur PiTFT ==
== Méthode 1 : Console sur PiTFT ==
<syntaxhighlight lang="ini">
Le fichier est soit dans /boot/config.txt soit dans /boot/firmware/config.txt C'est dans bookworm que le changement est apparu.<syntaxhighlight lang="bash">
# /boot/config.txt
# /boot/config.txt
# /boot/firmware/config.txt
dtoverlay=pitft28-resistive,rotate=90,speed=32000000,fps=20
dtoverlay=pitft28-resistive,rotate=90,speed=32000000,fps=20
</syntaxhighlight>
</syntaxhighlight>Même chose pour /boot/cmdline.txt<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="ini">
# /boot/cmdline.txt
# /boot/cmdline.txt
# /boot/firmware/cmdline.txt
console=tty1 fbcon=map:10
console=tty1 fbcon=map:10
</syntaxhighlight>
</syntaxhighlight>


== Méthode 2 : Console sur HDMI ==
== Méthode 2 : Console sur HDMI ==
<syntaxhighlight lang="ini">
/boot/firmware/config.txt<syntaxhighlight lang="bash">
# /boot/config.txt
# /boot/firmware/config.txt
#dtoverlay=pitft28-resistive,rotate=90,speed=32000000,fps=20
dtoverlay=pitft28-resistive,rotate=90,speed=32000000,fps=20 # Comment to disable LCD
hdmi_force_hotplug=1
hdmi_force_hotplug=1
hdmi_group=2
hdmi_group=2         # 1=TV 2=Monitor
hdmi_mode=82
hdmi_mode=82         # Mode 82=1920x1080 60 Hz progressive 16=1024x768 à 60 Hz
</syntaxhighlight>
</syntaxhighlight>Et<syntaxhighlight lang="bash">
 
# /boot/firmware/cmdline.txt
<syntaxhighlight lang="ini">
# /boot/cmdline.txt
console=tty1 fbcon=map:0
console=tty1 fbcon=map:0
</syntaxhighlight>
</syntaxhighlight>
Ligne 40 : Ligne 39 :
=== Script de mappage framebuffer ===
=== Script de mappage framebuffer ===
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sudo nano /etc/init.d/fbmap.sh
sudo vi /etc/init.d/fbmap.sh
</syntaxhighlight>
</syntaxhighlight>



Version du 10 octobre 2025 à 21:18

Configuration écran Adafruit PiTFT 2.8" et HDMI sur Raspberry Pi

Contexte

Le Raspberry Pi gère plusieurs framebuffers :

  • /dev/fb0 : sortie HDMI
  • /dev/fb1 : écran PiTFT

Par défaut, la console s'affiche sur fb0. L'installation du PiTFT peut rediriger la console vers fb1, rendant l'écran HDMI noir.

Méthode 1 : Console sur PiTFT

Le fichier est soit dans /boot/config.txt soit dans /boot/firmware/config.txt C'est dans bookworm que le changement est apparu.

# /boot/config.txt
# /boot/firmware/config.txt

dtoverlay=pitft28-resistive,rotate=90,speed=32000000,fps=20

Même chose pour /boot/cmdline.txt

# /boot/cmdline.txt
# /boot/firmware/cmdline.txt
console=tty1 fbcon=map:10

Méthode 2 : Console sur HDMI

/boot/firmware/config.txt

# /boot/firmware/config.txt
dtoverlay=pitft28-resistive,rotate=90,speed=32000000,fps=20  # Comment to disable LCD
hdmi_force_hotplug=1
hdmi_group=2         # 1=TV 2=Monitor
hdmi_mode=82         # Mode 82=1920x1080 60 Hz progressive 16=1024x768 à 60 Hz

Et

# /boot/firmware/cmdline.txt
console=tty1 fbcon=map:0

Méthode 3 : Multi-console (switch avec Ctrl+Alt+Fn)

Permet d'afficher :

  • tty1 sur PiTFT
  • tty12 sur HDMI

Script de mappage framebuffer

sudo vi /etc/init.d/fbmap.sh

Contenu :

#!/bin/bash
con2fbmap 1 1   # tty1 → fb1
con2fbmap 12 0  # tty12 → fb0

Activation :

sudo chmod +x /etc/init.d/fbmap.sh
sudo update-rc.d fbmap.sh defaults

Bascule clavier

  • Ctrl+Alt+F1 → PiTFT
  • Ctrl+Alt+F12 → HDMI

Test rapide

cp /dev/random /dev/fb0  # bruit sur HDMI
cp /dev/random /dev/fb1  # bruit sur PiTFT

Notes

  • Le mappage fbcon=map:X est global. Pour un contrôle fin, utiliser con2fbmap.
  • X11 peut être configuré pour s'afficher sur un framebuffer spécifique via xorg.conf.

Voir aussi