Friday 25 April 2014

Wifi static IP configuration

Introdution


If we want to have a cool wireless robot with which we can remote communicate we need a wireless communication. The best and also the easiest solution seems to be a standard network connection over wifi.

We need

  • Raspberry Pi with ArchLinux
  • wifi dongle
  • enabled and configured wifi router



Wifi dongle


Wifi dongle detection


Plug the wireless dongle into the USB port of Raspberry. Check if the device has been detected, call:
# lsusb
We should see some WLAN adapter, for example:


depending on the wifi dongle written information can be a bit different. On these screens is very cheap and popular device.

Configure static IP


copy example config file:
# cp /etc/netctl/examples//wireless-wpa-static /etc/netctl/robot-wireless-profile
edit new file (you can run more intuitive editor than the vi ;))
# vi /etc/netctl/robot-wireless-profile
 contents of the file:
Description='Lets make a robot example'
Interface=wlan0
Connection=wireless
Security=wpa
ESSID='ssid_of_your_network' #edit this line
Key='your_wpa_shared_key' #edit this line
IP=static
Address='your_static_ip/24' #edit this line
Gateway='192.168.1.1'
DNS=('dns_server1' 'dns_server2')
# Uncomment this if your ssid is hidden
#Hidden=yes
in most default configured networks just modify four lines (yellow text).

Parameter:
Security=wpa
is valid for both WPA and WPA2.

run wifi connection:
# netctl start robot-wireless-profile
if there are no errors check the connection:
# ifconfig
we should see:

To wifi connection was established at system startup you need to call:
# netctl enable robot-wireless-profile

The final test

  • stop ArchLinux:
    # shutdown
  • unplug the ethernet cable
  • reconnect the power
  • try to connect to your wifi ip, eg (change the IP 192.168.1.112 to your):
    # ssh root@192.168.1.112

links:

No comments:

Post a Comment

Note: only a member of this blog may post a comment.