Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
howtos:hardware:arm:raspberrypi3_wap [2018/08/26 21:43 (UTC)]
bifferos [Hostapd Install]
howtos:hardware:arm:raspberrypi3_wap [2018/08/28 20:07 (UTC)]
bifferos [Introduction]
Line 5: Line 5:
 This HOWTO shows you how to replace the WiFi element of your home network setup with a Raspberry Pi running Slackware. ​ Other HOWTOs explain how to setup DHCP and so on for your wireless devices, but this tries to keep things really simple and just give you an ethernet->​Wifi bridge. ​ This is very close to the config I ended up with when I configured a TP-LINK ADSL router to do the same thing, only this way I get to patch stuff a lot more easily. This HOWTO shows you how to replace the WiFi element of your home network setup with a Raspberry Pi running Slackware. ​ Other HOWTOs explain how to setup DHCP and so on for your wireless devices, but this tries to keep things really simple and just give you an ethernet->​Wifi bridge. ​ This is very close to the config I ended up with when I configured a TP-LINK ADSL router to do the same thing, only this way I get to patch stuff a lot more easily.
  
 +Although I've tested this HOWTO on a RPi 3, I've since tried it on an RPi2 as well and it works just as well.  Interface wlan1 will obviously change to wlan0 because the Pi2 has no on-board WiFi.
 ===== Hardware Requirements ===== ===== Hardware Requirements =====
  
   * A Raspberry Pi 3 running Slackware 14.2   * A Raspberry Pi 3 running Slackware 14.2
-  * A powered USB hub with 2A Power supply (to ensure the Wifi Dongle ​gets enough juice)+  * A powered USB hub with 2A Power supply (to ensure the Wifi adapter ​gets enough juice)
   * Alfa Network AWUS036NHA - USB WiFi Adapter with chipset ar9271l   * Alfa Network AWUS036NHA - USB WiFi Adapter with chipset ar9271l
   * Ethernet cable   * Ethernet cable
Line 44: Line 45:
  
 ===== Adapter detection ===== ===== Adapter detection =====
 +
 +<​note>​
 +I advise to not connect and disconnect the hub from the Pi while it's running. ​ Instead, power it up with hub connected (and powered) and then connect and disconnect the Wifi adapter as needed.
 +</​note>​
  
 Ensure that iwconfig shows two adapters wlan0 and wlan1. ​ wlan0 is the built-in one on the Pi.  If dmesg isn't showing the Alpha one has been plugged in, then just un-plug it and plug it in again. ​ Bring the Adapter up with: Ensure that iwconfig shows two adapters wlan0 and wlan1. ​ wlan0 is the built-in one on the Pi.  If dmesg isn't showing the Alpha one has been plugged in, then just un-plug it and plug it in again. ​ Bring the Adapter up with:
Line 127: Line 132:
 <​code>#​ chmod 755 /​etc/​rc.d/​rc.hostapd</​code>​ <​code>#​ chmod 755 /​etc/​rc.d/​rc.hostapd</​code>​
  
 +===== QR Codes =====
 +
 +{{ howtos:​hardware:​arm:​hostapd.png?​100 }}
 +
 +No home WiFi network setup is complete without a QR code that you can wave at all your mates when they are round your house wanting to connect. ​ You can create one of these from your WiFi settings using the **qrencode** program, available from [[https://​slackbuilds.org/​repository/​14.2/​graphics/​qrencode/​|Slackbuilds]],​ or alternatively,​ get the build from [[http://​www.slackware.com/​~alien/​slackbuilds/​qrencode/​build/​|Alien Bob]] for a slightly later version.
 +
 +Type the following to create a PNG file with the code, which you can print, copy to your mobile, put on a local webpage or whatever.
 +
 +<​code>#​ qrencode -t PNG -o wifi-setup.png "​WIFI:​S:​MYSSID;​T:​WPA2;​P:​MYPASSWD;​H:​true;"</​code>​
 +
 +The above assumes WPA2, MYSSID should be replaced with your SSID, MYPASSWD replaced with your password. ​ For my Android phone I installed a piece of software from the Play store called [[https://​play.google.com/​store/​apps/​details?​id=com.google.zxing.client.android|Barcode Scanner]] by the [[https://​play.google.com/​store/​apps/​developer?​id=ZXing+Team|ZXing Team]]. ​ It works very well for reading these codes.
 +
 +At a pinch, the following bash script should pull your SSID and passphrase out of the hostapd.conf file, and automatically use them to create a new QR code, so you can quickly keep it up to date after any changes.
 +
 +<​code>#​!/​bin/​sh
 +
 +SSID=$(cat /​etc/​hostapd/​hostapd.conf | grep ^ssid= | cut -d= -f2)
 +PASS=$(cat /​etc/​hostapd/​hostapd.conf | grep ^wpa_passphrase= | cut -d= -f2)
 +
 +qrencode -t PNG -o hostapd.png "​WIFI:​S:​$SSID;​T:​WPA2;​P:​$PASS;​H:​true;"</​code>​
 +
 + 
 ===== Conclusion ===== ===== Conclusion =====
  

In Other Languages
QR Code
QR Code howtos:hardware:arm:raspberrypi3_wap (generated for current page)