I am running an image processing algorithm on my Raspberry Pi and I need to access it wirelessly (wired connection is sooo ’90s :p ). So my requirements are following:
– WiFi Access Point for remote access
– no need internet connection
– runs on Raspbian Wheezy
1. Configuring network
/etc/network/interfaces, remove anything related to wlan0 then add this lines:
iface wlan0 inet static address 10.0.0.1 network 10.0.0.0 netmask 255.255.255.0 broadcast 10.0.0.255
Although the configuration is already defined, sometimes it won’t be applied by the system upon booting. To make sure, add
ifup wlan0 inside
/etc/rc.local file before
exit 0 so it will look like this:
#!/bin/sh -e # # rc.local ... # add this ifup wlan0 exit 0
2. Installing DHCP Server and “DNS” Configuration
DHCP is the one that is responsible to give out IP addresses to clients who are connected to the Access Point. Meanwhile, DNS or Name Service is working as some kind of dictionary, that translates numbers of IP address into human-readable names that are easy to remember and to type.
This time I will use
dnsmasq for easy and fast DHCP+DNS deployment.
sudo apt-get -y install dnsmasq
After installation it will run the daemon automatically. Stop it and then we work on the configuration:
sudo service dnsmasq stop sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig sudo touch /etc/dnsmasq.conf
Now edit the newly created
dnsmasq.conf config file. For minimum setup, this should be the content of the config file:
interface=wlan0 expand-hosts domain=local dhcp-range=10.0.0.10,10.0.0.20,24h dhcp-option=3,10.0.0.1
For full configuration options, you can refer to the original config file (
Although 10.0.0.1 is easy enough to remember, isn’t it easier if we use “raspi” as address? So then you can simply type
ssh raspi or
http://raspi/. To make this happen, edit
/etc/hosts file, append with this:
10.0.0.1 raspi raspberrypi raspi.local raspberrypi.local
This WiFi USB Dongle from Edimax uses Realtek chipset, it is rtl8192 to be precise. Kindly enough, Realtek has provided
hostapd implementation which is specific for this chipset.
For installation instructions, I suggest you to follow Jens Segers’ blog post.
After finishing installation, edit the
hostapd configuration file to fit your needs.