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 [2016/10/24 03:39]
matthias [USB FAT-Storage] added disable of CHOWN option in droopy
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 =====
 +This mod requires PirateBox 1.1. 
 +
 +PHP should be ready to run. To activate PHP on PirateBox, you need to edit ''/​opt/​piratebox/​conf/​lighttpd/​lighttpd.conf''​ and remove the ''#''​ in front of the last line: ''#​include "/​opt/​piratebox/​conf/​lighttpd/​fastcgi-php.conf"''​
 +
 +The can be achieved with the following command, too:
 +
 +   sed -i -e '​s|^#​include "/​opt/​piratebox/​conf/​lighttpd/​fastcgi-php.conf"​|include "/​opt/​piratebox/​conf/​lighttpd/​fastcgi-php.conf"​|'​ \
 +     /​opt/​piratebox/​conf/​lighttpd/​lighttpd.conf
 +
 +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?​
  
 +**Notice:** Since PirateBox 1.1, there is utility available for automatically enable your USB storage: ​
 +
 +   sudo /​opt/​piratebox/​rpi/​bin/​usb_share.sh ​
 +
 +**Disk usage:** Under some circumstances,​ the USB free storage is not displayed correctly. Try the following command and trigger a refresh via webui: ''​sudo touch -t 197001010101 /​opt/​piratebox/​www/​diskusage.html''​
 +
 +==== Manually configure USB ====
 Login via SSH into your box, or get direct access to it. You need to be logged in as root. The following commands assume that you have a USB Stick with one partition formatted as FAT32 and you want to switch over the complete content to your USB stick. Login via SSH into your box, or get direct access to it. You need to be logged in as root. The following commands assume that you have a USB Stick with one partition formatted as FAT32 and you want to switch over the complete content to your USB stick.
  
Line 43: 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 =====
 +
 +There is a script available since RPi image for PirateBox 1.1.3 . This script covers all needed steps and eliminates the need for a reboot. Execute the following line to use the free space of the SDCard:
 +
 +    sudo /​opt/​piratebox/​rpi/​bin/​sdcard_share.sh
 +
 +==== Manual Setup ====
  
 FIXME This howto is not finished nor approved as working FIXME FIXME This howto is not finished nor approved as working FIXME
Line 71: Line 143:
    ​swapon -a    ​swapon -a
  
-===== 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).**
  
 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 122: 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