Howto: Gumstix and Wifi Setup

From The Robotics Primer Workbook

Serial Connection

The first step in the process of configuring your Gumstix is to establish a serial connection between a PC and the Gumstix. A serial connection is a simple communication mechanism between two points, in our case the Gumstix and a PC.

This serial connection requires special hardware, both of which are inexpensive. The first option makes use of a standard serial cable, and the second a USB cable. Look at your PC, determine which kind of port you have at your disposal, and follow the appropriate instructions below.

USB Connection

Your Gumstix stack does not have a standard USB port. Fortunately, you can buy an USB adaptor that plugs into the Robostix. The adaptor is sold by Acroname for about 29.00 USD. You can find the product here.

Plug the USB adaptor into the white socket on the Robostix. Look carefully at the image, the adaptor plugs in upside down.

Put image here

Use the USB cable that came with the USB adaptor to connect your PC to the Robostix.


The hardware connection is now complete, so we can proceed with setting up the software on the PC.


We will use a terminal program called Kermit to communicate with the Gumstix. Before running the Kermit program, your need a configuration file that will instruct kermit how to establish a connection.


In your favorite editor, create a .kermrc in your home directory, and copy in the following text.

set line /dev/ttyUSB0
set flow-control none
set carrier-watch off
set speed 115200
set reliable
fast
set prefixing all
set file type bin
set rec pack 4096
set send pack 4096
set window 5
set handshake none

Now skip the Serial section and continue with Running Kermit.

Serial

Your Gumstix stack does not have a standard 9-pin serial port. Fortunately, you can buy an Serial adaptor that plugs into the Robostix. The adaptor is sold by Acroname for about 19.00 USD. You can find the product here.

Plug the Serial adaptor into the white socket on the Robostix. Look carefully at the image, the adaptor plugs in upside down.

Put image here

Use the serial cable that came with the serial adaptor to connect your PC to the Robostix.


The hardware connection is now complete, so we can proceed with setting up the software on the PC.


We will use a terminal program called Kermit to communicate with the Gumstix. Before running the Kermit program, your need a configuration file that will instruct kermit how to establish a connection.


In your favorite editor, create a .kermrc in your home directory, and copy in the following text.

set line /dev/ttyS0
set flow-control none
set carrier-watch off
set speed 115200
set reliable
fast
set prefixing all
set file type bin
set rec pack 4096
set send pack 4096
set window 5
set handshake none

Proceed with the next section on Running Kermit.

Running Kermit

Now run the Kermit program.

$ kermit

You will see a new prompt which will look similar to this.

(/root/) C-Kermit>

At this new prompt, type connect and hit enter. Make sure the the Gumstix is powered on.

(/root/) C-Kermit>connect

You may have to hit enter a couple times in order to see some text. At this point you will either see a login prompt. Login as root using the password gumstix.

gumstix login: root
Password: gumstix

You have now successfully logged into the Gumstix, and should see a new command prompt that looks like a pound sign #.

Now we can continue on to setting up the Wifistix.

Wifistix Setup

By default the Wifistix is probably not configured properly, meaning that no wireless connection is establish when the Gumstix is powered on. This section will describe how to change this.

At the Gumstix command prompt, go to the /etc/network directory.

# cd /etc/network

Using your favorite editor open the interfaces file.

# vi interfaces

At the bottom of this file you should see something similar to the following:

auto mwlan0
iface mwlan0 inet dhcp
  pre-up /sbin/iwconfig $IFACE essid any txpower 100mW

The first line tells the Wifistix to turn on automatically. You shouldn't change this line.

The second line tells the Wifistix to use DHCP to get and IP address. If you want to assign a static IP to the Gumstix, then replace dhcp with your desired IP address. The following text is an example where 192.168.0.1 is assigned to the Wifistix.

iface mwlan0 inet 192.168.0.1

The import part of the third line instructs the Wifistix what wireless access point to associate with. Change the any text on this line to the essid of your access point. The following is an example where the essid is set to linksys.

  pre-up /sbin/iwconfig $IFACE essid linksys txpower 100mW

Save your changes and exit the text editor.

Test out your changes by rebooting the Gumstix.

# reboot

When the Gumstix comes back up, login again, and check out the wireless configuration using the iwconfig and ifconfig commands. The iwconfig command will display information about the wireless settings, including the essid it is associated with. The ifconfig command displays information about the network interfaces, including the IP address assigned to each interface. Run both of these commands to make sure that your configuration is correct.

# ifconfig
# iwconfig

Your wireless is now setup correctly. The final test is a remote login. This is where your login into the Gumstix through the wireless interface. On your PC, use ssh to create a connection to the Gumstix. See the example below.

$ ssh root@<gumstix IP address>

Replace <gumstix IP address> with the IP address of the Gumstix which can be found by executing the ifconfig on the Gumstix. You will be prompted for a password, which is the same as before: gumstix. At this point you should see the Gumstix prompt.

And now you are done with the wireless setup.