WiFi book

From Publication Station

https://opencourse.mywdka.nl/openaanbod/wp-content/uploads/sites/260/2017/01/bibliotecha-logo.png

Resources

Day 1

WiFi book brain storm

  • What is a Wifi book?
  • How does the Wifi book work?
  • Why would you create a Wifi book?
  • What content does the Wifi book provide?

WiFi publications and interventions

Bibliotecha

http://bibliotecha.info/imgs/data/book/web/04_bibliotecha.png

Pirate box

https://piratebox.cc/_media/piratebox-openwrt.300.gif


Weise7 in/compatible Laboratorium Archive

https://julianoliver.com/output/images/weise7-book/weise7-book-home5.jpg


A Public Domain by lnd4 (aka Linda Hilfling)

http://apd.lnd4.net/images/APD-diagram.png http://apd.lnd4.net/images/apd_amazon.png



content

De Hel van het Eschmarkerveld by Kim Hospers will be the content to the book. However you can choose to use and develop other content that you consider more appropriate for a Wifi Book. Or you can add other content to the De Hel van het Eschmarkerveld, such as audio, video, images or texts.

https://raw.githubusercontent.com/wdka-publicationSt/WiFi-Book/master/content-DeHel/image/schutblad.png

The De Hel van het Eschmarkerveld is only content (in HTML) with some structure. It contains no style (CSS).

The content is located inside the open course's git repository, inside the folder content/

Go through the content and discuss with your group how do you want to:

  • present that content: how it should look like
  • structure the content: do you want have in a continuous flow, or in "pages"
  • navigate it: by scrolling, clicking "next page", clicking a menu that links to the different parts of the book
  • add extra material

Most likely the WiFi book will be a website. Therefore, before having it in the Wifi Book device it should work on your laptops

Download content from Git https://github.com/wdka-publicationSt/WiFi-Book/archive/master.zip

collaborative tools

etherpad

If you want to work together on the same document (e.g. an HTML file) you can use the collaborative editing software etherpad

You just need to create a new pad, share its address with you group and start typing away.

You can use the program - tools/download-pad.sh, in your computer's terminal with the address of the pad.

Example:

./download-pad.sh https://stuff2233.club/padlife/p/wifibook-test.html

This will download the pad's content, which can be viewed on the browser and refreshed to get the latest changes.



Day 2: WifiBook on a RaspberryPi

Get the Pi running

  • downaload the img file with the mibian distribution, and a few more configuration set up, in order to save time. http://publicationstation.wdka.hro.nl/files/rpi-base.img
  • write that file onto the the card, by:
    • inserting the sd-card to your computer
    • write the image to the sd-carddd if=rpi-base.img of=/dev/mmcblk0 bs=4M
      • BE AWARE: the location and naming of the sd-card in your computer's file-system will changed based on the operating system your are running. In Debian it is located in /dev/mmcblk0

Once dd has finished writing to the sd-card, remove it from your computer and get it running on the Pi:

  • insert the sd-card with the operating system image into the Pi
  • connect the Pi to a Ethernet port
  • power the Pi

If all is good you will see crazy blinking leds. Wait for the them to stop and look for the Pi's IP address

Once you know the IP address of your Pi, using the terminal, login to it as the user root (the owner of the system), using its IP address:

ssh root@the.ip.address

The default password is raspberry

once you are in the Pi, expand its file-system, by running

raspi-config

And choosing option 1. Say yes and reboot.

Wait a bit for the Pi to reboot, and log once more into the Pi, using the previous ssh command.


install software

Let's install some software, which we'll need, by running

apt-get install --yes nginx dnsmasq nano usbutils hostapd wireless-tools git


  • nginxis a lightweight webserver
  • dnsmasqis a Domain Name System (DNS) forwarder
  • Nanois a simple text editor
  • usbutilsare a bunch of tools to inspect what is plugged into the USB ports
  • hostapdturn normal network interface cards into access points
  • wireless-toolsare a bunch of tools to work with the wifi
  • gitis a version trakcing software, which will use to import configuration files to the Pi

set-up the wifi dongle

In the best case scenario you have a generic 802.11 wifi dongle. We will be using the TP-Link TL-WN722N wifi dongle, as it is a generic one, that works well.

check what make is your wifi dongle

lsusb | grep 802.11

In the case of TL-WN772N its make is Atheros, therefore requiring installing firmware-atheros

apt-get -y install firmware-atheros

Configure the WiFi access point

hostapd

Edit the file /etc/hostapd/hostapd.conf, with Nano

nano /etc/hostapd/hostapd.conf


Git clone

The essential configuration files for running the WiFiBook are stored in a Git repository.

That allow us to import, or in Git slang "clone" those files into our system and place them in their correct location.

To do so follow these step:

cd / go to the root / of the RaspberryPi's file-system

git init initiate a new git repository

git remote add origin https://github.com/wdka-publicationSt/WiFi-Book-Rpi.git add the WifiBook repository as remote - the Git place to pull and push files

git fetch origin Fetch the content of the repository

git checkout -f --track origin/master ensure you are in the master branch, from the origin remote

That's it! If you encountered no errors all the configuration files have been dowloaded in place in the right locations, within the RaspberryPi file-system.

If you wanna see what files were downloaded and where they are located, run: git ls-tree master -r --name-only


Reboot to WifiBook

reboot the RaspberryPi

reboot

Wait a bit for the Pi to reboot, and log once more into the Pi, using the previous ssh command.

If all is good your Pi salutes you with

   _      _       _____        ____
   |  |  /    ,   /    '   ,   /   )                /
 --|-/|-/--------/__----------/__ /-----__----__---/-__-
   |/ |/    /   /        /   /    )   /   ) /   ) /(
 __/__|____/___/________/___/____/___(___/_(___/_/___\__
      

And the it has created a wifi hotspot with name WifiBook

Connect to it, perhaps with your mobile phone as you dont want to loose your ssh connection to the Pi

And in your browser visit any http (not https) URL. You should see nginx's (the Pi's webserver) landing page.

To load the WifiBook landing page (stored in /var/www/wifibook/index.html), you must

Make the wifibook website configuration enabled

ln /etc/nginx/sites-available/wifibook /etc/nginx/sites-enabled/

Disable nginx default site by removing it from the the sites-enabled directory

rm /etc/nginx/sites-enabled/default

Reload nginx

ngnix -s reload


Now if you reload the same or other http URL you'll get forwarded to the WiFiBook landing page, and you can navigate the few pages that are there.


Make it yours

At the moment several public elements of WifiBook book network are in their default state. But you can edit any of them, to make the WifiBook be what you decide.

These elements are:

  • the Wifi hostspot configuration /etc/hostapd/hostapd.conf
    • its name can be changed in the line ssid=WiFiBook
  • the name of the machine (raspberry) /etc/hostname
  • the salutation /etc/motd
  • the webpage files /var/www/wifibook/
    • the index.html file is the landing page

The webpage files /var/www/wifibook/ files can be changed any time and the changes will be right away visible when you refresh the changed page in your web browser.

The other changes require you to reboot the Pi.