Quick Start Guide
Operating system installation
- Prerequisites:
Any Raspberry Pi model
A microSD card (preferably speed class 10)
A computer with a microSD card reader
- Required steps:
Format the microSD card (preferably with the SD Memory Card Formatter)
Download the zipped disk image for the latest version of Raspbian from https://www.raspberrypi.org/downloads/raspbian/
Unzip the disk image
Find the disk number of microSD card using
diskutil listUnmount micro SD card using
diskutil unmount /dev/disk<number>e.g.diskutil unmount /dev/disk2s1Copy Raspian disk image onto micro SD card using
sudo dd bs=1m if=<disk image file name> of=/dev/rdisk<number> conv=synce.g.sudo dd bs=1m if=2018-03-13-raspbian-stretch.img of=/dev/rdisk2 conv=syncWait until the copy process is finished (This will take around 7 minutes. You can check the process by hitting ctrl-T)
Enable USB OTG mode
All Raspberry Pi models have been designed to be used by connecting a power supply, monitor, keyboard and mouse.
If You have a Raspberry Pi model with only one USB connector (= any model without a built-in USB hub), then You can use Your computer and a single USB cable to connect and power Your Raspberry Pi by enabling the USB OTG mode (= USB On-The-Go).
- Prerequisites:
A Raspberry Pi model A, A+, Zero or Zero W (= any model with only one USB connector)
A microSD card with Raspbian installed onto it
A computer with a microSD card reader
- Required steps:
Connect the microSD card to Your computer
Open the file cmdline.txt with a text editor and insert
modules-load=dwc2,g_etherafterrootwaitand save the changesOpen the file config.txt with a text editor and add a line
dtoverlay=dwc2at the bottom and save the changesCreate a new file in the same directory called ssh (without any content or file name extension) e.g. by typing
touch /Volumes/boot/ssh
The original instructions can be found on Andrew Mullholland’s Blog at https://blog.gbaman.info/?p=791.
Connect to a Raspberry Pi over USB
- Prerequisites:
A Raspberry Pi model A, A+, Zero or Zero W (= any model with only one USB connector)
A micro SD card with Raspbian installed onto it and enabled OTG mode
A micro USB cable
A computer with a USB port
- Required steps:
Insert the microSD card into the Raspberry Pi
Connect the Raspberry Pi micro-USB cable to the socket labelled ‘USB’ (the other one ‘PWR’ works only as a power socket) and Your computer
Open up Terminal and connect via SSH (Secure Shell) by typing
ssh pi@raspberrypi.localWatch the Network panel in System Preferences: You should see the RNDIS/Ethernet Gadget
The default password is
raspberryIn macOS the IP address of the adapter will be 169.254.xxx.xxx on the host side.
To disconnect type
exitTo shutdown type
sudo shutdown -h now(when connected)If ssh pi@raspberrypi.local does not work try
arp -a
Remove ssh key from known_hosts
Remove line in text file open ~/.ssh/known_hosts
Configure the Raspberry Pi
Run the Raspberry Pi configuration tool
sudo raspi-config
and
Change the hostname (2 Network Options -> N1 Hostname)
Connect to a wireless network (2 Network Options -> N2 Wi-fi)
Enable SPI (5 Interface Options -> P4 SPI)
Install additional Libraries
Using pip3
Test the internet connection
ping 8.8.8.8
Update pip3
sudo -H pip3 install --upgrade pip
Install Adafruit_GPIO (from https://pypi.org/project/Adafruit-GPIO/)
sudo pip3 install Adafruit-GPIO
Install Adafruit_LED_Backpack (from https://pypi.org/project/Adafruit-LED-Backpack/)
sudo pip3 install Adafruit-LED-Backpack
Install Adafruit_SSD1306 (from https://pypi.org/project/Adafruit-SSD1306/)
sudo pip3 install Adafruit-SSD1306
Install Adafruit_IO (from https://pypi.org/project/adafruit-io/)
sudo pip3 install adafruit-io
Using apt-get
Test the internet connection
ping 8.8.8.8
Update/install required software
sudo apt-get update
sudo apt-get install build-essential python-pip python-dev python-smbus git
Install Adafruit_GPIO (from https://github.com/adafruit/Adafruit_Python_GPIO)
git clone https://github.com/adafruit/Adafruit_Python_GPIO.git
cd Adafruit_Python_GPIO
sudo python3 setup.py install
Install Adafruit_LED_Backpack (from https://github.com/adafruit/Adafruit_Python_LED_Backpack)
git clone https://github.com/adafruit/Adafruit_Python_LED_Backpack.git
cd Adafruit_Python_LED_Backpack
sudo python3 setup.py install
Install Adafruit_SSD1306 (from https://github.com/adafruit/Adafruit_Python_SSD1306)
git clone https://github.com/adafruit/Adafruit_Python_SSD1306.git
cd Adafruit_Python_SSD1306
sudo python3 setup.py install
Install Adafruit_IO (from https://github.com/adafruit/io-client-python)
git clone https://github.com/adafruit/io-client-python.git
cd io-client-python
sudo python3 setup.py install