Loading Debian (Ubilinux) on the Edison

Pages
Contributors: Shawn Hymel
Favorited Favorite 5

Enable WiFi

After logging into Ubilinux, you will probably want an Internet connection so you can download and install packages at your whim. There are a few ways to connect to the Internet over WiFi. We will show two of them. The first one is the quick and easy way, but it leaves your WiFi password stored in plain text in a file. The second is the preferred method, as it encrypts your password, but the steps are slightly more involved.

If you are logged in as a regular user, run the command:

su

And enter the password for root to gain superuser abilities. As a side note, "su" stands for substitute user.

Quick and Dirty

The easiest way to get on a local WiFi Access Point is to store the SSID and password in a file. The problem is that your password will be stored in plain text, so it is not very secure.

Use your favorite Linux text editor (I'm still a fan of nano) to open the interfaces file:

nano /etc/network/interfaces

Use the arrow keys to navigate to "auto usb0" and add a "#" in front of the line to comment it out.

Navigate down and remove the "#" in front of "auto wlan0" so that our Edison will try to automatically connect to WiFi on boot.

Go down to the "wpa-ssid" and "wpa-psk" lines. Change the default SSID and password (PSK) to your desired WiFi SSID and password.

Change interfaces file to connect to WiFi

Press 'Ctrl-X' to exit and press 'y' to save the file when prompted.

We recommend following the directions in "The Better Way" below, but if you are happy with the quick method, skip to "Test WiFi Connection."

The Better Way

We can store our WiFi password more securely by creating a hash and locking down the /etc/network/interfaces file so that only root has access to it.

With the root account, change the permissions of the /etc/network/interfaces file:

chmod 0600 /etc/network/interfaces

Create a hash of your WiFi password:

wpa_passphrase <YOUR_WIFI_SSID> <YOUR_WIFI_PASSWORD>

That will print out a "network" section in the console.

Using wpa_passphrase to create a hash

Copy the long string of letters and numbers after "psk=" (On PuTTY and many Linux consoles, you just need to highlight the string to copy it). Open the /etc/network/interfaces file:

nano /etc/network/interfaces

Use the arrow keys to navigate to "auto usb0" and add a "#" in front of the line to comment it out.

Navigate down and remove the "#" in front of "auto wlan0" so that our Edison will try to automatically connect to WiFi on boot.

Go down to the "wpa-ssid" line. Change the default SSID to your WiFi's SSID.

Move your cursor to the "wpa-psk" line, delete the default string after "wpa-psk," and paste in the long hash that we generated earlier (you just need to right-click for PuTTY and many other Linux consoles).

Add hash to PSK in interfaces file

Press 'Ctrl-X' to exit and press 'y' to save the file when prompted.

Test WiFi Connection

Restart the wireless driver by entering:

ifup wlan0

Once that configures, your Edison should be connected to your local WiFi. You can check by entering:

ifconfig

You should see an "inet addr" entry under "wlan0" that shows your IP Address.

Ubilinux ifconfig command

To ensure you have access to the Internet, you can ping a known site, such as www.google.com or www.sparkfun.com:

ping www.sparkfun.com

You should see several pings and responses. Press 'Ctrl-C' to stop.

Pinging sparkfun.com

Now that your Edison is connected to a network, you can use SSH to connect to your Edison from another computer. You just need to know the IP Address.