-
Notifications
You must be signed in to change notification settings - Fork 214
Install PiTFT on Raspberry Pi
Calvin Hass edited this page Feb 3, 2019
·
5 revisions
Overview > Installing on Raspberry Pi >
The following walkthrough assumes the user is using Windows 10. Steps for other operating systems should be similar.
- In alignment with the Adafruit PiTFT Easy Install Guide, we will use the same Raspbian release
- Download Raspbian stretch image (2018/03/13)
- Unzip the *.zip file
- This will create a *.img file:
- Download SDFormatter
- Set Options -> Format Size Adjustment to ON
- Click Format
- Download Win32 Disk Imager
- https://sourceforge.net/projects/win32diskimager/
- For this walkthrough I used had used version 0.9.5
- Run Win32DiskImager
- Click the folder icon to locate the image file (*.img)
- Ensure the device is currently naming the drive of your formatted memory card (eg. Device G:)
- Click on Write and then Yes when asked if you are sure
- The imaging process will take several minutes
- Finally, a message will be shown saying Write Successful
- Ignore Windows warning dialogs
- After formatting the card for RPI, Windows might complain that it can't read the memory card and may ask you if you want to format it. Click Cancel
- After this, you may see yet another warning dialog. Click on OK.
- Remove SD card
- Use the "Safely Remote Hardware and Eject Media" option from the taskbar
- Insert card into RPi
- Plug in HDMI cable and USB for keyboard/mouse into RPi
- Power up via USB
- At this point you will likely get a white screen on the PiTFT display. This is normal since the RPi is primarily outputting to the HDMi port at this point.
- You should see the Raspbian "Pixel" desktop boot
In this step we'll enable WiFi access, adjust the keyboard settings and enable several interfaces.
- Enabling WiFi
- By default, it is unlikely that the desktop environment will have connectivity to your wireless LAN network, so you will see an icon on the top right of the menubar with two vertical gray lines and two red Xs (signaling no wireless connectivity)
- Click on the WiFi icon on the top right menubar
- Find your local WLAN's SSID, click on it and enter your Pre Shared Key (wireless password)
- You should now see a familiar blue wireless beacon icon, indicating connectivity is present
- Configuring system settings
- Click on Preferences -> Raspberry Pi Configuration from the menu (accessed via the raspberry icon in the top left of the menu bar)
- In the System configuration tab:
- The default is "Boot: To Desktop". Select "To CLI" (command-line interface).
- This is an optional step, but appropriate for most users of GUIslice from the shell (ie. without the desktop)
- In the Interfaces configuration tab:
- All interfaces are disabled by default. Enable SSH, SPI and I2C
- In the Localisation configuration tab:
- Use Set Locale... to change from Country: GB to US or other appropriate option
- Use Set TImezone... to change your time zone
- Use Set Keyboard... to change your keyboard layout. For users in the US, failing to change the keyboard layout from the default United Kingdom / English (UK) will cause some unexpected keyboard mappings (eg. try shift-4
$
).
- After completing your reconfiguration and pressing OK, you will be asked to perform a reboot. Press Yes.
- Upon reboot, you should see the console login prompt.
- Enter username (
pi
) and password (default:raspberry
) - After the login is authenticated, we need to determine the IP address assigned to the RPi. While it is possible that your wireless router and RPi may change their assignments (DHCP) over time, in most cases you can continue to use the address reported by the
ifconfig
command: - Enter
ifconfig
and look for a section like the following:
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.20 netmask 255.255.255.0 broadcast 192.168.0.255
- Note down the IP address shown after inet (
192.168.0.20
in my case) - More advanced users may want to configure a static IP address, but that is out of scope for this walkthrough. I have some description of this additional configuration on my ImpulseAdventure website.
- Load PuTTY (or other SSH client) and connect to the RPi via the IP address noted above
- PuTTY can be downloaded from here
- Upon connecting for the first time, PuTTY may present a security alert. Click Yes.
- Now you should see the terminal window and should be connected to the RPi
- If you haven't changed the default credentials, login as
pi
and use passwordraspberry
- If you haven't changed the default credentials, login as
- Fetch and run the PiTFT install script from the Adafruit Easy Install page:
cd ~
wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/adafruit-pitft.sh
chmod +x adafruit-pitft.sh
sudo ./adafruit-pitft.sh
- Follow the directions on the Adafruit page according to your display size, touchscreen type and orientation preferences
- For the purposes of this demo, I have selected:
- Configuration:
PiTFT 2.8" capacitive touch (240x320)
- Rotation:
90 degrees (landscape)
- Configuration:
- At the prompt for "console to appear on the PiTFT display?", enter
Y
- This setting will correspond to the Adafruit notes under "PiTFT as Text Console"
- Reboot
- Disconnect HDMI & USB
- Should now see boot console appear on PiTFT display
- Now that the PiTFT is functional, it is time to install the SDL graphics driver