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
raspberry_pi:mods [2017/03/18 19:07]
matthias [Using Alternative HostAPD binaries and drivers (For tested devices)] add note about udev rule in 1.1.3
raspberry_pi:mods [2017/07/07 07:28]
matthias [Raspberry Pi(rate)Box Mods] add link to laptop page
Line 4: Line 4:
 Additional Mods: Additional Mods:
   *[[raspberry_pi:​mods:​sfpg|Set up Single File PHP Gallery]]   *[[raspberry_pi:​mods:​sfpg|Set up Single File PHP Gallery]]
 +  *[[http://​blog.danielpecos.com/​2013/​09/​raspberrypi-custom-command-button/#​more-648|RaspberryPI Shutdown button via GPIO]]
 +  *[[laptop:​mods|PirateBox Mods]] for PirateBox itself and not RPi or one-chip specific. ​
 +
 +===== Switch used wifi adapter =====
 +Especially on RPi3 some owners want to switch over to an external Wifi card over the internal. The same is true, if you want to use two wifi cards for some reasons. With **1.1.3** there is an option to prioritize a wifi card. The file ''/​boot/​wifi_card.conf''​ (can be accessed on Windows too) you define the PirateBox-wifi-card. On RPi3 the onboard wifi is usually ''​wlan0'',​ while the first USB wifi is ''​wlan1''​.
 +If you want to use multiple USB cards or you have issues with alternating links between ''​wlan0''​ and the real device, you might need to create a [[https://​wiki.archlinux.org/​index.php/​udev|udev rule]] to assign static names. **Tipp:** Use names with ''​wlan_''​ that other wifi-udev-rules are working.
 +===== Temporary client mode =====
 +:!: On 1.1.3 is a bug, that the command is not executed correctly, run the following lines once to fix that:
 +
 +  sed -i -e '​s|/​rpi/​run_client.sh|/​rpi/​bin/​run_client.sh|g' ​ \
 +     /​opt/​piratebox/​rpi/​bin/​do_switch_client.sh
 +
 +Since 1.1.3, it is possible to switch from AP to client mode with a command. Before booting your RPi Piratebox, edit the ''​wpa_supplicant.conf''​ file on your computer. After the file is adjusted, boot your PirateBox and connect with it via ssh, like in the post installation. Execute the following command:
 +
 +   sudo /​opt/​piratebox/​rpi/​bin/​switch_to_client.sh
 +
 +While executing the command, the wifi connection will drop and the ssh session **will freeze**. This is expected. If you can not connect to your RPi, verify your ''​wpa_supplicant.conf''​ (which you find in ''/​boot''​ - the first SDCard partition). To switch back to normal AP mode, reboot your PI.
 +
 +If you have issues with resolving hostnames, verify if ''/​etc/​resolv.conf''​ has a content (vi,cat). If you get strange error messages, run the following commands
 +
 +   sudo rm /​etc/​resolv.conf
 +   sudo sh -c 'echo "​nameserver 8.8.8.8 >> /​etc/​resolv.conf"' ​
  
 ===== Activate PHP ===== ===== Activate PHP =====
Line 16: Line 38:
  
 After this make a ''​reboot''​. All ''​.php''​ files are processed, as long as these are placed in the ''/​content/''​ folder. This folder is located in ''/​opt/​piratebox/​share''​ - on OpenWrt on the USB stick ''<​usb>/​PirateBox/''​. After this make a ''​reboot''​. All ''​.php''​ files are processed, as long as these are placed in the ''/​content/''​ folder. This folder is located in ''/​opt/​piratebox/​share''​ - on OpenWrt on the USB stick ''<​usb>/​PirateBox/''​.
 +
 +===== Disable client isolation =====
 +Per default it is not permitted to connect directly to another client. To allow this, you need to disable the feature “AP isolation”. Connect via SSH and run the following commands:
 +
 +   sudo sed -i -e '​s|ap_isolate=1|#​ap_isolate=1|g'​ /​opt/​piratebox/​conf/​hostapd.conf
 +   sudo systemctl restart piratebox
 +
 ===== USB FAT-Storage ===== ===== USB FAT-Storage =====
 You have a FAT32 USB-Stick and want to use it on your Ras-PirateBox?​ You have a FAT32 USB-Stick and want to use it on your Ras-PirateBox?​
Line 61: Line 90:
  
 **Sidenote:​** If you use multiple USB-Stick, it is strongly discouraged of using ''/​dev/​sda1''​ as a reference for mounting the devices. It may happen, that one of two devices is named sda per random. For circumventing this issue, use the device ''​UUID''​(Universally Unique Identifier) instead. [[http://​www.cyberciti.biz/​faq/​linux-finding-using-uuids-to-update-fstab/​|Follow this instructions]] for a stable setup. **Sidenote:​** If you use multiple USB-Stick, it is strongly discouraged of using ''/​dev/​sda1''​ as a reference for mounting the devices. It may happen, that one of two devices is named sda per random. For circumventing this issue, use the device ''​UUID''​(Universally Unique Identifier) instead. [[http://​www.cyberciti.biz/​faq/​linux-finding-using-uuids-to-update-fstab/​|Follow this instructions]] for a stable setup.
 +
 +===== Enable WPA for the hotspot =====
 +Change the following configuration file  ''/​opt/​piratebox/​conf/​hostapd.conf'',​ those options will enable the functionality:​
 +
 +  interface=wlan0
 +  driver=rtl871xdrv ​
 +  ssid=PrivateBox
 +  hw_mode=g
 +  channel=1
 +  ieee80211n=1
 +  wmm_enabled=0
 +  wpa=1
 +  auth_algs=1
 +  wpa_passphrase=first123
 +  wpa_key_mgmt=WPA-PSK
 +  wpa_pairwise=TKIP
 +  rsn_pairwise=CCMP
 +  macaddr_acl=0
 +
 +
 ===== PirateBox on SDCard ===== ===== PirateBox on SDCard =====
  
Line 96: Line 145:
 ===== Obsolete: Using Alternative HostAPD binaries and drivers (For tested devices) ===== ===== Obsolete: Using Alternative HostAPD binaries and drivers (For tested devices) =====
  
-**Since PirateBox 1.1.3 there is no need for additional hostap. Adjustments are made via '''/​opt/​piratebox/​rpi/​bin/​wifi_detect.sh'''​ during boot (udev rule).+**Since PirateBox 1.1.3 there is no need for additional hostap. Adjustments are made via ''/​opt/​piratebox/​rpi/​bin/​wifi_detect.sh''​ during boot (udev rule).**
  
 FIXME This is not complete and is mostly based around a particular model FIXME This is not complete and is mostly based around a particular model
Line 147: Line 196:
  --- //​[[wacomalt@gmail.com|WACOMalt]] 2014/11/08 03:52//  --- //​[[wacomalt@gmail.com|WACOMalt]] 2014/11/08 03:52//
  
-===== Enable WPA for the hotspot ===== 
-Change the following configuration file  ''/​opt/​piratebox/​conf/​hostapd.conf'',​ those options will enable the functionality:​ 
- 
-  interface=wlan0 
-  driver=rtl871xdrv ​ 
-  ssid=PrivateBox 
-  hw_mode=g 
-  channel=1 
-  ieee80211n=1 
-  wmm_enabled=0 
-  wpa=1 
-  auth_algs=1 
-  wpa_passphrase=first123 
-  wpa_key_mgmt=WPA-PSK 
-  wpa_pairwise=TKIP 
-  rsn_pairwise=CCMP 
-  macaddr_acl=0