If you want to run a webserver on the Gnublin board and connect to it with a smartphone or a browser or if you want to send some data to a server you need a connection to the internet. If you won't use a cable to connect to the internet, WLAN is an optimal solution to connect to the internet. If you are a Linux beginner it's recommended to use a WLAN-Adapter which is described below or a WLAN-Adapter which is available at the Gnublin Store.

The article refers to the use of Gnublin distribution (for beginners). The advanced students can also work with the outdated ELDK rootfs and should also come to the same conclusion.

For beginners with the Gnublin distribution

For easy access to your local hotspot we wrote a small program which is called gnublin-wlan. You can run the program with the following command:

gnublin-wlan -s <SSID> -k <KEY> -t <dhcp/static>

<SSID> should be the name of your access point and <KEY> should be your WLAN key (wep/wpa/wpa2). With the parameter -t you can decide if you either want a static ip (static) or to get an ip address automaticly (dhcp).

If you want to configure your ip address as a static ip, you can set the ip address you want with the parameter -i <XXX.XXX.X.X> and your gateway ip with -g <XXX.XXX.X.X> where X stands for your wanted IP or gateway IP.

Connect to the wireless access-point (depends on the encryption like WEP, WPA/WPA2)

Setup the connection to the internet

Note: You can start directly with the adapter from the Gnublin-shop described in the following short video [1] . You only have to edit your config-wpa or config-wpa2 to match with your access-point. Detailed instructions how to edit the config-wpa/wpa2 can be found below.

Identify the USB-Sticks

It's recommended that you identify the device and the driver used by that device by plugging the device into a PC or Laptop running Linux. Here you can see and example of the output:

You can display the devices plugged in over USB by typing the following command in a shell.

lsusb

The output should look like:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 001 Device 003: ID 0b05:1791 ASUSTek Computer, Inc.

or similar!

To go on you should be sure which chipset is used in your Hardware. Unfortunately the manufacturers sometimes change the internal chipsets.
You can have a look at the Hardware_Database to check if your stick was previously tested by somebody. On this site you can also see which module is used by the device.

ASUS WL-167g

ASUS WL-167g v3

Bus 001 Device 003: ID 0b05:1791 ASUSTek Computer, Inc.

Modul: r8712u

The WLAN stick needs both the driver as well as a firmware file that will be loaded dynamically if you load the module.The best way to get this stick running is to use the precompiled kernel with integrated drivers and firmware from the following site (Gnublin Version 1.1 to 1.3 with 8 MB RAM): [2].

Connect to the Wireless Access-point

Activating the interface:

ifup wlan0

ifconfig wlan0 up

Searching for available connections:

iwlist wlan0 scan

The next steps depend on the local configuration of your access-point. After the encryption-mode dependent configuration we're going on with the procedure to connect to the internet which is the same for all encryption types.

WLAN with no encryption

iwconfig wlan0 mode managed essid "access-point-name" (without "")

After that you can go on to the topic "Connection to the Internet".

WEP

WPA and WPA2

If your access point uses wpa or wpa2 encryption you must first setup a configuration file, e.g. config-wpa or config-wpa2. You can do this with an editor like vi or nano. This configuration file will be used afterwards to connect to the access-point.