Anonymous
Not logged in
Talk
Contributions
Create account
Log in
Publication Station
Search
Editing
WiFi book
(section)
From Publication Station
Namespaces
Page
Discussion
More
More
Page actions
Read
Edit
History
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= 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 * once downloaded check the img integrity against the hash in http://publicationstation.wdka.hro.nl/files/rpi-base.md5 * write that file onto the the card, by: ** inserting the sd-card to your computer ** write the image to the sd-card<code>dd if=rpi-base.img of=/dev/mmcblk0 bs=4M</code> *** 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</code> Once <code>dd</code> 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 * <code>nginx</code>is a lightweight webserver * <code>dnsmasq</code>is a Domain Name System (DNS) forwarder * <code>Nano</code>is a simple text editor * <code>usbutils</code>are a bunch of tools to inspect what is plugged into the USB ports * <code>hostapd</code>turn normal network interface cards into access points * <code>wireless-tools</code>are a bunch of tools to work with the wifi * <code>git</code>is 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 <code>firmware-atheros</code> apt-get -y install firmware-atheros ==Git clone== The essential configuration files for running the WiFiBook are stored in a [https://github.com/wdka-publicationSt/WiFi-Book-Rpi 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: <code>cd /</code> go to the root <code>/</code> of the RaspberryPi's file-system <code>git init</code> initiate a new git repository <code>git remote add origin https://github.com/wdka-publicationSt/WiFi-Book-Rpi.git</code> add the WifiBook repository as remote - the Git place to pull and push files <code>git fetch origin</code> Fetch the content of the repository <code>git checkout -f --track origin/master</code> 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: <code>git ls-tree master -r --name-only</code> ==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 <pre> _ _ _____ ____ | | / , / ' , / ) / --|-/|-/--------/__----------/__ /-----__----__---/-__- |/ |/ / / / / ) / ) / ) /( __/__|____/___/________/___/____/___(___/_(___/_/___\__ </pre> 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 <code>/var/www/wifibook/index.html</code>), 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 <code>/etc/hostapd/hostapd.conf</code> ** its name can be changed in the line <code>ssid=WiFiBook</code> * the name of the machine (raspberry) <code>/etc/hostname</code> * the salutation <code>/etc/motd</code> * the webpage files <code>/var/www/wifibook/</code> ** the index.html file is the landing page The webpage files <code>/var/www/wifibook/</code> 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. ------
Summary:
Please note that all contributions to Publication Station are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
Publication Station:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation
Main navigation
Main page
Printmaking Studio
Print Studio
Dig. Publishing Studio
Namespaces
Grafiwiki
Random Page
Log in
Wiki tools
Wiki tools
Page tools
Page tools
User page tools
More
What links here
Related changes
Page information
Page logs