Accessing Galileo via Wi-Fi
Using the onboard Ethernet port is great for accessing your Galileo board remotely. However, this is not always convenient. Most of our devices nowadays are connected wirelessly, and it can be strange sometimes to still use Ethernet cables.
This is why we are going to find out how to easily install a Wi-Fi board on the Galileo and then access the board remotely. You will then be able to complete all the projects in this book without ever connecting an Ethernet cable again.
Getting ready
For this recipe to work, you will need to have followed most of the previous recipes in this chapter. You need a working Galileo board, with either the simple Linux image or the IoT image installed. You should also have checked that you can access the board via Ethernet first, to make sure that everything is working.
Then, you need a Wi-Fi board. I recommend using the Intel N-135 Wi-Fi board, which is very easy to install and will work out of the box. This is a picture of this board:
You can easily find it online, for example on Amazon, here:
It might be possible to use other Wi-Fi boards, but they could be more difficult to use or require the use of drivers to work. You can also use a Wi-Fi dongle that is compatible with the Galileo board.
How to do it...
You can simply install the board by following all the steps in this section:
- First, power down the Galileo board and remove all the connection cables.
- Then, turn the board over and locate the mini PCI express port, as shown here:
- Insert the Wi-Fi card into the port at a small angle.
- After that, press it down until you hear a click, meaning the board was successfully installed.
- Connect all the cables to the Galileo board again and power it up.
Now that the Wi-Fi module is correctly installed, you will have some simple steps to follow to set up your Wi-Fi connection. Let's assume here that you have a WPA-secured Wi-Fi network, which is the case for most Wi-Fi networks, then follow these steps:
- Log on to your Galileo as
root
, just as you learned in the previous recipes in this chapter. - Create the file that will contain your network's configuration by typing the following command, replacing
MySSID
with your Wi-Fi network name:# wpa_passphrase MySSID << EOF > /etc/wpa_supplicant.conf
- Then, type the following command, replacing
MyPassPhrase
with your Wi-Fi network password:> MyPassPhrase
- Finally, type:
> EOF
This will connect your board to your Wi-Fi network. You can then follow these steps to connect it to your network automatically:
- Edit the
/etc/network/interfaces
file withvi
. - Add the line
auto wlan0
. - Save, using the
:w
command followed by the:q
command. - Restart the wireless interface by typing:
/etc/init.d/networking restart ifdown wlan0 ifup wlan0
From now on, your Galileo board will automatically connect to your network using Wi-Fi. You need to take these steps again if you modify your Wi-Fi network name and/or password.
You can now remove the Ethernet cable and login to your Galileo board again via Wi-Fi.
How it works...
The Galileo board mini PCI express port was made specifically to support extensions such as this Wi-Fi board. This port can be used to extend the possibilities offered by the Intel Galileo board.
There's more...
You can use the mini PCI express slot that we used in this recipe for many extensions other than Wi-Fi. For example, there are specific extensions for Bluetooth 4.0, and for more SD card slots for additional storage.