4. Connect the Raspberry Pi to the Internet

Share for us

Sometimes you may wonder: is my Raspberry Pi power on? It’s easy to tell with a screen since you can see the interface directly. However, how to check its status and how to handle it after booting without a screen may be an issue. But don’t worry! We’ll take a look at these problems. Let’s see how to connect the Raspberry Pi to the network first.

4.1 The Ethernet

The easiest way for networking is to connect to the Ethernet with a network cable. You can insert one terminal of the cable into the Raspberry Pi and the other to the router in your house. You’d better prepare a router, especially if you do not have a screen.

With a screen:

After inserting the network cable, you will see the network icon showing signals at the top right corner. You can open a web browser to try surfing the Internet. Welcome to the Net!

Without a screen:

If you can’t be sure whether your Raspberry Pi has been booted or not, you can log in and go to the setting interface of your router if you have one. The setting interface of each router is different; please consult the supplier for details. You will see the connection of a device named Raspberry Pi and its IP address. We will check how to remotely log into the Raspberry Pi in the lessons later.

4.2 Wi-Fi

The built-in Wi-Fi is available of the Raspberry Pi 3 model B. Have a try! Or, if you are using other models, you can check the Wi-Fi adapter supported by the Raspbian here: http://elinux.org/RPi_VerifiedPeripherals#USB_Wi-Fi_Adapters. DO choose from the list in case some cannot be recognized by the Raspberry Pi. Insert the Wi-Fi adapter into the USB port.

It’s simple for the users with a screen display at hand. After booting the Raspberry Pi, find the connection icon at the top right corner where the Wi-Fi has been configured.

If you do not have a screen, you can modify the Wi-Fi configuration file wpa-supplicant.conf of the SD card.

As for the file system of Raspbian, the SD card will be divided into two partitions after the Raspbian is burnt. One is the /boot/ directory in FAT32 format, and the other is the root directory “/” in EXT4 format. It means, if you insert the SD card into a PC running on Linux, you will see all the files on both partitions and be able to modify them. But if it runs on Windows, you can only check and modify the files under /boot/.

The file wpa-suppicant.conf is in the /etc/wpa-supplicant/, namely, under the “/” directory. If your PC runs on Linux, you can modify this file directly. But if it runs on Windows, you won’t be able to do so.  

Luckily, the latest Raspbian Jessie has offered a solution for this problem (screenshot from the raspberrypi.org website):

Namely, for the Windows users, you only need to add the file wpa_supplicant.conf to /boot/ (a 60M folder that can be recognized by Windows), and it will be moved to /etc/wpa_supplicant/ and cover the previous file automatically next time the system is booted. So Windows users now can also configure the Wi-Fi by modifying this file.

Here is the content of the configuration file:

ssid= “(name of the Wi-Fi)”

psk= “(your Wi-Fi password)”

When both ssid and psk are correct, the Raspberry Pi can connect to this network the next time the system is booted.

Notes:

1. For the 2016-11-25 release or above, SSH (a protocol securing remote login session and other network service) is Disabled by default. Therefore, when you need to log in remotely, you need to create a file named “ssh” under /boot/ to enable it.

2. If you’ve used NOOBS to install the system, you can set the Wi-Fi by modifying the wpa-supplicant.conf file. But you may not manage it by connecting the SD card to the computer; instead, you need to log into the Raspberry Pi to modify the file there.