The Wi-Fi Broadcast System is a Wi-Fi 802.11 hotspot with a difference. Connected users find that no matter where they surf all they get it the internal site. It’s fully self contained and battery powered with no connection to the Internet involved. It basically makes a Wi-Fi radio station, ideal for providing information in areas with lots of Wi-Fi users.
It works by pretending to be a regular hotspot but when users connect their browsers are sent to an internal web server because the DNS server is configured to lie. No matter that site they try to lookup the name of, it always returns the laptop’s address. Memeteam.net, Google.com or anything else becomes 10.0.0.1, the home of our web server.
Then the laptops web server is setup to redirect any request to its own content.
We also made a Cantenna to increase directional range.
This page is meant to give a general outline of the process, not a step by step guide. This isn’t the most dangerous territory but breaking the laptops network drivers, web server, etc wouldn’t be too hard. A fair bit of familiarity with Linux is a good thing if you want to do this.
Parts and Software:
Parts for hotspot:
Dell Inspiron 1420 (any laptop that can run Ubuntu should work)
Airlink101 AWLL-3026 802.11g USB Wi-Fi Adapter (or other Wi-Fi adapter that supports master mode)
Male to Female USB cable (as long as needed)
Software:
Ubuntu Linux (7.04 Feisty Fawn Dell Remaster in our case)
zd1211b Vendor Based Driver
Apache2 - Web server
Pure-FTPd - FTP server
DNSMasq - Provide DHCP and redirected DNS to users
Optional Parts for Cantenna:
48oz Gravy can
Cupboard handle
3/4" rubbery grommet
Dremel tool with cutting discs
Setting up the Wifi Adapter:
The key to building a Wi-Fi hotspot is the Wi-Fi adapter responsible for transmitting and receiving signals from users. For everything to be slick, the adapter and its drivers needs to support something called ‘Master Mode’.
Unfortunately figuring out if a given adapter can do this trick without buying it isn’t easy. The internal adapter in our laptop didn’t work. Then we got lucky and found the AWLL-3026.
The AWLL-3026 costs less then $30 but not that easy to find. We also tried an AWLL-3025v2, it didn’t work.
ORiNOCO based PCMCIA cards are suppose to work too but the Inspiron 1420 we used (to our surprise) doesn’t have a PCMCIA/Cardbus slot, it has a ExpressCard slot instead. PCMCIA probably offers more power, but USB is easier to make into a cantenna.
To check if an adapter and driver can do master mode you can use a program called ‘iwconfig’.
Typing ‘sudo iwconfig‘ into a terminal window should list all available wireless interfaces.
Assuming your adapter is connected and its drivers are loaded, try the following.
sudo iwconfig wlan1 mode master
Replace wlan1 with whatever Ubuntu is calling your adapter. If you don’t get an error you’re in business.
In our case, the Airlink 101 AWLL-3026 has a zd1211 chipset, which supports master mode, but the drivers built into Ubuntu for the zd1211 chipset doesn’t. Luckily another set of drivers exist and they work with master mode.
If you’re compiling and installing the zd1211 VendorBasedDriver for the AWLL-3026 you’ll need to edit the Makefile to enable zd1211b mode. Also you’ll likely need to blacklist the driver built-in to the kernel to let the new VendorBasedDriver load instead. (sudo echo zd1211rw >> /etc/modprobe.d/blacklist)
Setup your adapter for the hotspot. Run the following in a terminal (assuming your adapter its on wlan1).
sudo iwconfig wlan1 essid "my network" mode Master enc off
Replace "my network" with whatever you want your hotspot to be called. "Free Internet!" "Protest Information" etc.
Now setup the network details for your hotspot.
sudo ifconfig wlan1 10.0.0.1 netmask 255.255.255.0 broadcast 10.0.0.255 up
Setup DNSMasq:
DNSMasq is a package for providing DHCP and DNS services. You need to provide DHCP to show up when users scan for open Wi-Fi connections. DNS is used to redirect all web traffic to your laptops internal server.
Install DNSMasq using a package manager or apt-get (sudo apt-get install dnsmasq). Now setup DNSMasq to provide DHCP.
Edit /etc/dnsmasq.conf (sudo nano -w /etc/dnsmasq.conf)
Change "interface=" to "interface=wlan1".
Now DNSMasq will only deal with the adapter being used for the hotspot.
Change "#dhcp-range=" to "dhcp-range=10.0.0.10,10.0.0.110,6h".
These are the IP addresses your hotspot will assign to users.
Change "#address=/doubleclick.net/127.0.0.1" to "address=/#/10.0.0.1".
This redirects all web traffic to the hotspot’s own web server.
Restart DNSMasq. (sudo /etc/init.d/dnsmasq restart)
Scan for available Wi-Fi connections from another computer. Your hotspot should show up with the name you configured with iwconfig.
Connect to your hotspot and try using the web. It should connect but the web should seriously not work because DNSMasq is redirecting all the traffic back to the hotspot and there isn’t a web server there yet.
Setup Apache2:
Apache2 is a web server. It will send the web pages to anyone trying to surf from your hotspot. This only covers a very basic setup, to do more you’ll likely want to install MySQL and PHP too.
But for now just install Apache2. (sudo apt-get install apache2)
Stick a quick index.html file on the server for testing. (sudo echo Test > /var/www/index.html)
Now we setup a custom 404 page so that Apache2 will serve you content no matter what URLs users try to go to.
Edit /etc/apache2/apache2.conf (sudo nano -w /etc/apache2/apache2.conf)
Change "#ErrorDocument 404 /missing.html" to "ErrorDocument 404 /index.html"
Now when anyone goes to a page that isn’t there, which will happen all the time because of the DNSMasq redirect, they’ll get index.html.
Restart apache2. (sudo /etc/init.d/apache2 restart)
Try surfing some more from the other computer. No matter what URL you try and go to, you should see "Test" or whatever is in the hotspot’s index.html file. Basically done, but the next step makes life easier.
Setup Pure-FTPd:
Pure-FTPd is an FTP server, it will let you connect to the hotspot from another computer and upload web content.
Install Pure-ftpd (sudo apt-get install pureftpd)
Tell Pure-ftpd not to try and resolve clients. Otherwise it gets confused.
sudo echo "yes" > /etc/pure-ftpd/conf/DontResolve
Now we need to set things up so Pure-FTPd can access the servers web content easily.
Change the ownership of your web servers content directory to your regular user. (sudo chown -R memeteam:memeteam /var/www; sudo chmod oug+r /var/www)
Setup a symbolic link between the content directory and your user directory. (ln -s /var/www ~/www)
Now try and connect to 10.0.0.1 via FTP from the other computer. User and password should be the same as your regular Ubuntu login. Everything in the ‘www’ directory is your web content.
Making Content:
You must use full paths. The hotspot’s server should be able to host anything any other server would, but because of the sneakyness going on with DNSMasq any links (to images, other sites, etc) in your HTML must contain the full URL, which will start with "http://10.0.0.1" if your followed the setup shown here.
<img src="images/someimage.jpg">
has to become
<img src="http://10.0.0.1/images/someimage.jpg">
to work.
Adding a Cantenna: Gravy
The Airlink101 AWLL-3026 looks perfect for sticking a cantenna waveguide onto. This is just a specially sized tin can that reflects Wi-Fi radio waves in useful ways. It should increase range and power in whatever direction the can is pointing.
We used a 48oz can of gravy that has about a 4"/102mm inside diameter and is about 6.9"/175mm deep.
Checking a cantenna calculator, this turns to be an almost perfect size. We need to cut a hole 1.72"/45mm from the back of the can and stick the USB adapter about 31mm in.
Measure 45mm from the base and cut a square hole in the can using a dremel tool with a cutting disc.
Now stick in a 3/4" rubber grommet from home depot, mark 31mm from the top of the AWLL-3026 and work it into the grommet.
Drill a couple of holes for the cupboard handle. We had to shorten the included screws using the cutting disc.
Voila, cantenna. Luckily, things don’t need to be perfect to get decent results.


