How To: Setting Up a New Raspberry Pi

You’ve just purchased a new Raspberry Pi.    So, now what?

Components needed for this step include:

  • Raspberry Pi
  • Micro SD memory card with SD card adapter
  • Monitor with HDMI connection
  • USB or wireless keyboard
  • USB or wireless mouse
  • Ethernet connection
  • Computer to format and initialize your SD memory card

The first step is to format your micro-SD memory card.   I use an application called “SD Memory Card Formatter” that can be downloaded  <here>    Install this application.   Insert the micro SD card into the SD adapter and insert the SD adapter into your computer and format your SD using default settings shown below.   Your SD card is now formatted and ready to accept the operating system.

Begin the next step by downloading a copy of the latest version of the NOOBS Raspberry Pi operating system to your desktop/laptop.  This is a zipped file file that can be downloaded <here>.    Download and unzip the file on your PC.   Once the file is unzipped, copy the entire contents of the unzipped NOOBS  operating system to the SD card using Windows Explorer.

Once all the files are transferred onto the micro SD, remove it from the computer and adapter,

Insert the following devices into your Rasberry Pi:

  • Micro SD card
  • HDMI monitor
  • Ethernet connection
  • USB/wireless keyboard
  • Mouse
  • Power cord

Provide power to your Raspberry Pi.    You should begin seeing the boot sequence scrolling across the monitor.    If the monitor doesn’t show the “raspberries” at the top left corner,  something is wrong (although I’ve never had this not work successfully).

You should now see the raspberry pi desktop displayed on your monitor.   Our next step is to configure the Raspberry Pi.   We’ll change the delivered password, set the correct time zone, language, and Wi-Fi country.

Start by selecting the terminal application icon   and enter the following command at the command prompt:
 sudo raspi-config
Enter “1” to change the default password for your Raspberry Pi.    Select option “4” and change the language, timezone and Wi-Fi country.    Finally select option “5” to enable SSH to be used to gain remote access to your Pi.  You can now exit the configuration application.
The last step is to optionally assign a static IP address to your Raspberry Pi.   I do this with all my Raspberry Pi devices but is entirely optional.    Assigning a static IP address is done in one of two ways.   If your Raspberry Pi will always be connected to the internet via an ethernet cable then follow procedure #1 below.    If your Pi will use a wireless connection to access the internet, then use procedure #2 below.
Procedure #1:
To assign a static IP address for devices connected to the internet via an ethernet cable, edit the file /etc/dhcpcd.conf and add two lines to the bottom of the file.   Double-click the terminal icon and enter the following command:
sudo nano  /etc/dhcpcd.conf
This will display the file in edit mode where you can make changes.  Using your down arrow button, go to the bottom of the file.    The following lines will be located at the bottom of the file:
# A hook script is provided to lookup the hostname if not set by the DHCP 
# server, but it should not be run by default. 
nohook lookup-hostname

Immediately following these lines enter copy/paste the following lines.   Change the static ip address to the desired values.

interface eth0
static ip_address=192.168.1.155/24
static routers=192.168.1.254
static domain_name_servers=8.8.8.8
Once the IP addresses are specified in the file, issue the following commands to save and exit edit mode:
Control-X
Y
You should now reboot your Raspberry Pi by issuing the following command:
sudo reboot
Procedure #2:
To assign a static IP address for devices connected to the internet via wireless connection, edit the file /etc/network/interfaces and add the following lines to the bottom of the file.   Double-click the terminal icon and enter the following command:
 sudo nano /etc/network/interfaces
Change the following line from
iface eth0 inet manual
to
iface eth0 inet static
and add the following lines directly underneath changing the red text to the desired IP address:
    address 192.168.1.240
    netmask 255.255.255.0
    network 192.168.1.0
    broadcast 192.168.1.255
    gateway 192.168.1.254
Once the IP addresses are specified in the file, issue the following commands to save and exit edit mode:
Control-X
Y
Always update all software on your new Raspberry Pi device by issuing the following command in your terminal session:
sudo apt-get update && sudo apt-get upgrade
You should now reboot your Raspberry Pi by issuing the following command:
sudo reboot

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.