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
openwrt:zsun [2016/04/28 22:50]
theexpertnoob moved lighttpd stuff
— (current)
Line 1: Line 1:
-===== Piratebox on the Zsun ===== 
-Like many of us have read the [[https://​hardware.slashdot.org/​story/​16/​01/​26/​1430201/​openwrt-turns-a-14-card-reader-into-the-smallest-wireless-ap|article]] on slashdot about the Openwrt capabilities of the Zsun Wifi card Reader. ​ 
-The idea of having PirateBox running on the smallest device yet made me order one from China. ​ 
-After many hours of installing, troubleshooting,​ resetting e.d. I now have a complete working Piratebox installation. ​ 
-I would like to share my installation scripts in order to let you install your own. 
  
-<WRAP center round important 100%> 
-OpenWrt (15.05 “Chaos Calmer”) and PirateBox (1.0.7) were used in the making of this tutorial. 
-</​WRAP>​ 
- 
-**DISCLAIMER:​** NOBODY will take responsibility or be liable for anything you do to your zsun. If you brick it trying these procedures, **YOU** are solely responsible for your actions. **YOU HAVE BEEN WARNED**. 
- 
-==== 0. PreSetup ==== 
-  * Having a Zsun running OpenWrt. I've used the [[https://​wiki.hackerspace.pl/​projects:​zsun-wifi-card-reader|hackerspace.pl]] method. ​ 
-  * microSD card 
-  * Root password [[https://​wiki.openwrt.org/​doc/​howto/​firstlogin|set]]. 
- 
-  * Change the default uhhtpd (LuCI) ports to **9080** and **9443**. 
-<​code>​ 
-#uhttpd config 
-uci set uhttpd.main.listen_http=9080 
-uci set uhttpd.main.listen_https=9443 
-uci commit 
-</​code>​ 
- 
-  * Get internet working on the zsun. 
-<​code>​ 
-#wireless config 
-uci set wireless.radio0.channel=auto 
-uci set wireless.radio0.txpower=18 
-uci set wireless.radio0.country=00 
-uci set wireless.radio0.disabled=0 
-uci add wireless wifi-iface 
-uci set wireless.@wifi-iface[-1].device=radio0 
-uci set wireless.@wifi-iface[-1].ssid='​your Wifi name' 
-uci set wireless.@wifi-iface[-1].mode=sta 
-uci set wireless.@wifi-iface[-1].network=wwan 
-uci set wireless.@wifi-iface[-1].encryption=psk2 
-uci set wireless.@wifi-iface[-1].key='​yourSuperSecurePass'​ 
-uci set wireless.@wifi-iface[-1].disabled=0 
-uci commit  
-  
-#netwerk interface config 
-uci set network.wwan=interface 
-uci set network.wwan.proto=dhcp 
-uci commit 
-  
-#firewall config 
-uci set firewall.@zone[1].network='​wan wan6 wwan' 
-uci commit 
-  
-#reload new config 
-/​etc/​init.d/​network reload && /​etc/​init.d/​firewall reload && wifi 
-</​code>​ 
- 
-  * Reconnect to OpenWRT 
-<WRAP center round important 100%> 
-An additional wireless connection with your own WiFi is made in '​sta'​ mode. Because OpenWrt (and PirateBox) are using the IP 192.168.1.1 (sub-netmask /24) the network (WiFi) you are connecting to can't use the same sub-net mask. 
-</​WRAP>​ 
-  * Verify your internet connection using 
-<​code>​ 
-ping google.com 
-opkg update 
-</​code>​ 
- 
-==== 1. Setup Mounts ==== 
-  * Format sdcard to ext4 
-<​code>​ 
-opkg update && opkg install -d ram e2fsprogs ​ 
-export LD_LIBRARY_PATH='/​lib:/​usr/​lib:/​tmp/​lib:/​tmp/​usr/​lib'​ 
-export PATH="​$PATH:/​tmp/​bin:/​tmp/​sbin:/​usr/​sbin"​ 
-/​tmp/​usr/​sbin/​mkfs.ext4 /dev/sda1 
-</​code>​ 
-<​code>​ 
-mkdir /mnt/ext 
-mkdir /mnt/usb 
-mkdir /​mnt/​sda1 ​ 
-mount /dev/sda1 /mnt/sda1 
-tar -C /overlay -cvf - . | tar -C /mnt/sda1 -xf - 
-uci add fstab mount 
-uci set fstab.@mount[-1].target=/​overlay 
-uci set fstab.@mount[-1].device=/​dev/​sda1 
-uci set fstab.@mount[-1].fstype=ext4 
-uci set fstab.@mount[-1].options=rw,​sync 
-uci set fstab.@mount[-1].enabled=1 
-uci set fstab.@mount[-1].enabled_fsck=0 
-uci commit 
-reboot 
-</​code>​ 
-  * Reconnect to OpenWRT 
-==== 2. Setup extendRoot and Piratebox ==== 
-<​code>​ 
-echo "​src/​gz piratebox http://​stable.openwrt.piratebox.de/​all/​packages"​ >> /​etc/​opkg.conf 
-sed '​s|option check_signature 1||g' -i /​etc/​opkg.conf 
-opkg update 
-opkg install extendRoot 
-sed -i '​s|ext_linktarget="/​usr/​local"​|ext_linktarget=""​|g' ​ /​etc/​ext.config 
-opkg install piratebox 
-</​code>​ 
-  * Connection will be closed, reconnect to ssid piratebox with fixed ip on client pc. 
-    *IP: 192.168.1.2 
-    *GW: 192.168.1.1 ​ 
-  * finish install with: 
-<​code>​ 
-/​etc/​init.d/​lighttpd stop 
-/​etc/​init.d/​lighttpd disable 
-/​etc/​init.d/​piratebox init 
-/​etc/​init.d/​piratebox start 
-chmod a+w /​opt/​piratebox/​share/​tmp 
-/​etc/​init.d/​piratebox enable 
-  
-# and enable LuCI 
-/​etc/​init.d/​uhttpd start 
-/​etc/​init.d/​uhttpd enable 
-</​code>​ 
-=== Install Imageboard === 
-  * This is a password **YOU** set. 
-<​code>​opkg install piratebox-mod-imageboard 
-/​opt/​piratebox/​bin/​board-autoconf.sh</​code>​ 
-=== Install Minidlna === 
-<​code>​ 
-opkg update 
-opkg install minidlna 
-cp /​opt/​piratebox/​src/​openwrt.example.minidlna /​etc/​config/​minidlna 
-/​etc/​init.d/​minidlna start 
-/​etc/​init.d/​minidlna enable 
-</​code>​ 
-=== Turn off Internet connection === 
-<​code>​ 
-uci set wireless.@wifi-iface[1].disabled=1 
-uci commit 
-</​code>​ 
-==== All done! ==== 
-<​code>​reboot</​code>​ 
-  * Return your Client PC back to its original IP settings. 
-==== Credits ==== 
-  * Matthias - for the Piratebox Project and updated code. 
-  * meduza - for the majority of the scripting for the Zsun. 
-  * stylesuxx - for the wifi configuration and troubleshooting. 
-  * TheExpertNoob - for troubleshooting and this wiki guide. 
- 
-If I forgot anyone else, PM me.