To prepare the Pi for use with a 5″ HDMI display and the ability to connect via SSH on a USB connection, flash the latest Raspbian to an SD card and then use Windows to make the following edits on the card:
SSH over USB Settings
Add the following line to the bottom of /boot/config.txt file:
dtoverlay=dwc2
Add the following line to /boot/cmdline.txt after the word rootwait:
modules-load=dwc2,g_ether
Add the following lines to /etc/modules:
dwc2
g_ether
The above is not listed in all instruction guides and can only be done via a keyboard plugged into the Pi. It seems necessary in most cases, and if required there is no way to configure a Pi to be SSH accessible over USB without using a monitor and keyboard as the etc folder is not accessible on the SD card via Windows.
To enable SSH, add an empty file to /boot named:
ssh
Keyboard Settings
Setup the keyboard by clicking Raspberry Icon/Preferences/Mouse and Keyboard Settings, then choose the Keyboard tab, then click the Keyboard Layout button. Select United States in the left column and English (US) in the right column.
Changing the Password
The default SSH login username and password are pi and raspberry.
In a console on the Pi, use the passwd command.
VNC Settings
This can easily be done with a monitor and mouse. Click the Raspberry Icon/Preferences/Raspberry Pi Configuration and select the Interfaces tab. Set VNC to Enabled.
[wip — add note about Bonjour and accessing as raspberrypi.local]
Serial Settings
To access the serial port in a program, disable its use by the system: Click the Raspberry Icon/Preferences/Raspberry Pi Configuration and select the Interfaces tab. Set Serial to Disabled.
Locale and Time Zone Settings
To access the serial port in a program, disable its use by the system: Click the Raspberry Icon/Preferences/Raspberry Pi Configuration, select the Localization tab and then:
- Click the Locale button and set Language to en(English), Country to US (United States) and Character Set to UTF-8, then click OK
- Click the Timezone button and set Area to America and Location to Chicago (for Central Time), then click OK
- Click the Set Keyboard button and set Country to United States and Variant to English (US), then click OK
- Click the Set WiFi Country and select US United States, then click OK
Setting a Static IP Address for the SSH over USB Connection
Add the following to the bottom of the Pi’s /etc/dhcpcd.conf file:
interface usb0
static ip_address=192.168.2.2/24
static routers=192.168.2.1
static domain_name_servers=8.8.8.8
For the Windows 10 Ethernet adapter that appears when the Pi USB is plugged in:
IPv4 Address: 192.168.2.1
IPv4 Subnet Mask: 255.255.255.0
IPv4 Default Gateway: leave blank
You’ll have to comment out the lines in the dhcpcd.conf file and set the Windows 10 Ethernet adapter back to Obtain an IP address automatically if you want to share a Windows ethernet connection with the Pi.
NOTE Regarding WiFi Access when USB or Ethernet Active
When Ethernet is active via an Ethernet adapter or via an Ethernet-Over-USB connection, Raspbian will default to accessing the Internet over those connections rather than via the WiFi. If the Ethernet connections do not have Internet access, then the Pi will not have access either.
Updating Raspbian Linux
In a console, use the following commands:
sudo apt-get update
sudo apt-get dist-upgrade