Step 3: Configure WiFi Network and Ethernet Bridge (optional)

Setting up a wireless access point on your Raspberry Pi is only necessary if you have a wired network but don’t have a wireless network.  This allows devices like iPad’s and laptops to connect wirelessly receive NMEA data for navigational apps.  It also gives these devices access to the rest of your network.

Even if you have a wireless network, you might also want to do this if you want to have a dedicated wireless network for navigational purposes only.

Okay, that said, let’s get to it:

First let’s make sure we have the most up-to-date list of the available software packages..
sudo apt-get update

Now let’s install the 3 packages we need for this task
sudo apt-get install hostapd bridge-utils iw

Next we need to edit some configuration files to set things up correctly:

sudo nano /etc/default/hostapd
Uncomment and edit the following line as shown..      DAEMON_CONF=”/etc/hostapd/hostapd.conf”
Save and close the file (CTRL-X)

sudo nano /etc/hostapd/hostapd.conf
Edit the file as follows:
    interface=wlan0
    bridge=br0
    driver=rtl871xdrv
    country_code=US
    ssid=<TypeInYourWiFiNetworkNameHere>
    hw_mode=g
    channel=6 #you can pick any channel from 1 to 11
    macaddr_acl=0
    auth_algs=1
    ignore_broadcast_ssid=0
    wpa=2
    wpa_passphrase=<TypeInYourPassPhraseHere>
    wpa_key_mgmt=WPA-PSK
    wpa_pairwise=TKIP
    rsn_pairwise=CCMP
    ieee80211n=1
Save and close the file (CTRL-X)

Backup the network interfaces config file and edit it:
sudo cp /etc/network/interfaces /etc/network/interfaces.bak
sudo nano /etc/network/interfaces
Edit the file as follows:
   auto lo
   auto br0
   iface lo inet loopback
   iface br0 inet static
      address (IP address you want your RaspBerry Pi device to use)
      netmask 255.255.255.0
      bridge_fd 1
      bridge_hello 3
      bridge_maxage 10
      bridge_stp off
      bridge_ports eth0 wlan0

   auto eth0
   allow-hotplug eth0
   iface eth0 inet manual

   auto wlan0
   allow-hotplug wlan0
   iface wlan0 inet manual
Save and close the file (CTRL-X)

Now we need to change to a different version of the hostapd package to support the EDIMAX WiFi USB device

Reference: http://blog.sip2serve.com/post/48420162196/howto-setup-rtl8188cus-on-rpi-as-an-access-point
   Note: I used this as a starting point as well as the replacement file, but the instructions I am providing are slightly different from the referenced page.  This is because I had trouble getting it all to work and had to modify a few things.  The instructions I am posting are from what I actually did to make it work.

Backup the current executable file
cd /usr/sbin
  sudo cp /usr/sbin/hostapd /usr/sbin/hostapd.bak

Delete the original file
sudo rm –f hostapd

Download the replacement file to support the EDIMAX WiFi
  sudo wget http://dl.dropbox.com/u/1663660/hostapd/hostapd

Now set permissions on the file so it will run
  sudo chown root:root hostapd
  sudo chmod 755 hostapd

Now that all the files are configured and ready, let’s restart the rPi again
  reboot

The network should appear on other devices now.

 

Next Step: Step 4: Install kPlex NMEA Multiplexer