Robot Yacht is a fully autonomous sailing vessel tasked with sailing around the Island of Corsica unmanned, with little or no human intervention...

Setting up Voyage – Basic Networking

Posted: February 16th, 2009 | Author: admin | Filed under: linux, networking | 2 Comments »

Connect to a wireless network

wifi

This will probably only work if you have a very similar system to what I have set up. This should work if you have an Atheros card and your wifi is protected by a WEP key. WPA gets more complicated…

wlanconfig ath0 create wlandev wifi0 wlanmode sta
ifconfig ath0 up
iwconfig ath0 essid "YOUR NETWORK SSID"
iwpriv ath0 authmode 1
iwconfig ath0 key 1234123412341234
dhclient ath0
The first line creates the ath0 device, the second turns it on, the third tells it which network to connect to, the fourth sets the authmode which is hardly ever anything but 1. The second to last line sets the WEP key and the last line tells the box to ask the network connected to ath0 for an IP address using DHCP. Phew!
You should be able to prove your box can connect to the internet by sending a ping:
ping google.com
to stop pinging type [ctrl]+[c]

Change the Hostname

You have probably noticed the command prompt says:

voyage:~#

This is the computers Hostname and we want to change it – not only could you have more than one Voyage box on your network, but we want something more memorable! Remember your computer can be accessed at http://hostname/ on your local network – we’ll set this up later.

To change the hostname, we need to edit a file. Files can be edited using a number of editors, I tend to use Nano, which is not installed as standard. To install we need to type the following commands:

apt-get update
apt-get install nano 

The first command updates the database for available packages, the second installs the one we want. The box needs to be connected to the internet before this will work!

Make sure you set the file system to read/write (remountrw) before you try editing any files otherwise you wont be able to save your changes.

nano /etc/hostname

Make the changes and then press [ctrl]+[x] to save the file.

Reboot the system for the changes to take effect.