[SETUP] Zsun WiFi Card Reader an €10 PirateBox

Posted by meduza 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 26, 2016 06:43PM
Quote
TheExpertNoob
Hey meduza, we could probably just omit the entire vfat partition and make the entire sdcard ext4 on sda1 because this method doesn't really implement the vfat partition. Which means we have to change all instances of sda2 to sda1 in the scripts, such as Presetup in step 1.
I see where this is going. Shall we rename the wiki to 'Piratebox on the Zsun - Windows friendly SD'?
and try to make a more non techie user install with only one sda ext4 partition?
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 26, 2016 06:59PM
My change proposal:
old:
vi /etc/config/uhttpd
/etc/init.d/uhttpd reload

new:
uci set uhttpd.main.listen_http=9080
uci set uhttpd.main.listen_https=9443
uci comit



old
config wifi-iface
	option ssid 'yourWifiName'
	option device 'radio0'
	option mode 'sta'
	option network 'wwan'
	#option encryption 'none'
	option encryption 'psk2'
	option key 'yourSuperSecurePass'

new:
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 commit


old:
config interface 'wwan'
	option proto 'dhcp'
new
uci set network.wwan=interface
uci set network.wwan.proto=dhcp
uci commit

Network configuration can be reloaded with
/etc/init.d/network reload

Please test before publish winking smiley

Similar is possible for the firewall config, too. My firewall entry on my test box was messed up, what is the reason why I didn't nailed something together.

You can summarize all changes to one "uci commit" at the end.


hope that helps,
best regards
Matthias
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 26, 2016 08:59PM
These uci comments are nice. I reviewed them and this is the working result.
(Tested with a fresh system (firstboot))

0.uci_PreSetup.sh
Language: HTML
#uhttpd config uci set uhttpd.main.listen_http=9080 uci set uhttpd.main.listen_https=9443 uci commit   #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



Edited 1 time(s). Last edit at 04/26/2016 09:14PM by meduza.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 27, 2016 10:08AM
What i did so far:
* Format the SD to a single ext4 filesystem (/dev/sda1)
* Firstboot in order to reset the zsun
* Exec the 0.uci_PreSetup.sh script (see post above) with my own WiFi setting
* Next getting the overlay: (1.preSetup.sh)
Language: HTML
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
* Install and init extendroot (without run and enable) (2.Setup.sh)
Language: HTML
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 /etc/init.d/ext init source /etc/profile

When is install the normal piratebox the following postinstall error are given:
Language: HTML
//usr/lib/opkg/info/piratebox.postinst: .: line 26: can';t open ';/usr/local/etc/piratebox.config';
and
Language: HTML
/etc/rc.common: .: line 26: can';t open ';/usr/local/usr/share/piratebox/piratebox.common';
I could of course solve this by sym-linking 'ln -s /etc /usr/local/' and 'ln -s /usr /usr/local/' before the piratebox installation...

@Matthias
Q1: am I using the wrong packages do i need to use extendRoot-piratebox instead of the normal piratebox package?
Q2: There is a typo within the piratebox postinst file (line 18). What's the best way to adress these?



Edited 1 time(s). Last edit at 04/27/2016 02:21PM by meduza.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 27, 2016 02:19PM
And I have Piratebox (without imageboard yet) running.
I did script 0, 1 and 2 (previous post)
and than the manual steps 3.InstallPiratebox.txt
Language: HTML
#run manual # some symlync ln -s /etc /usr/local/ ln -s /usr /usr/local/   # solve port 80 issue opkg install lighttpd /etc/init.d/lighttpd stop /etc/init.d/lighttpd disable   # Letsgo opkg install piratebox   #Connection will be closed, reconnect to ssid piratebox with fixed ip # finish install with /etc/init.d/piratebox init /etc/init.d/piratebox start /opt/piratebox/bin/timesave.sh /opt/piratebox/conf/piratebox.conf install /etc/init.d/piratebox timesave chmod a+w /opt/piratebox/share/tmp /etc/init.d/piratebox enable   # and enable LuCI /etc/init.d/uhhtpd start /etc/init.d/uhhtpd enable

Conclusion:
Far much easier setup (for user) and maintainable (for developer) but without the windows friendly SD card partitioning. No easy content storage/removal from SD (read: PirateBox upload directory) by putting the SD in your windows computer.



Edited 3 time(s). Last edit at 04/27/2016 06:24PM by meduza.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 27, 2016 07:26PM
Quote

Q1: am I using the wrong packages do i need to use extendRoot-piratebox instead of the normal piratebox package?
Q2: There is a typo within the piratebox postinst file (line 18). What's the best way to adress these?

I wrote this howto based on VoCore installation. Have a look at this steps. This is how I prepare the configuration without activating with /etc/init.d/ext init

That should solve your problem smiling smiley

best regards Matthias
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 28, 2016 01:45AM
Reworked Wiki. Testing now.... I'll report back.


PirateBox Installs:
2x Zsun's (both testing, one with serial interface)
A5-V11 (mostly for OpenWRT testing DIY)
2x RPi Zero's
(one active in car 24/7, gets a lot of hits at Walmart, movie theaters and the mall)
2x RPi3's (both home servers, one Ubuntu custom install along side a ton of other services)
1x RPi2 (currently work server)
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 28, 2016 02:52AM
Everything seems to be working except minidlna and the storage usage percentage on the main page.
I got the Imageboard running. BUT I just clicked on the kareha.pl link in the directory listing so I dont know if the last wget line actually works or not.

Also a 1-liner for disabling the internet. I'm sleepy. I'll see what you have in the morning.

EDIT: also just realized I never did a '/etc/init.d/ext init' during the whole setup.


PirateBox Installs:
2x Zsun's (both testing, one with serial interface)
A5-V11 (mostly for OpenWRT testing DIY)
2x RPi Zero's
(one active in car 24/7, gets a lot of hits at Walmart, movie theaters and the mall)
2x RPi3's (both home servers, one Ubuntu custom install along side a ton of other services)
1x RPi2 (currently work server)



Edited 2 time(s). Last edit at 04/28/2016 03:03AM by TheExpertNoob.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 28, 2016 09:35AM
Quote
Matthias
I wrote this howto based on VoCore installation. Have a look at this steps.
This is how I prepare the configuration without activating with /etc/init.d/ext init
Darn, I did search for it but ended on the general openwrt 'Rootfs on External Storage (extroot)' wiki.
If I had known this before...

Quote
TheExpertNoob
Also a 1-liner for disabling the internet. I'm sleepy. I'll see what you have in the morning.
Language: HTML
uci set wireless.@wifi-iface[1].disabled=1 uci commit



Edited 1 time(s). Last edit at 04/28/2016 10:02AM by meduza.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 28, 2016 12:51PM
I also believe
Language: HTML
mkdir /usr/local/ ln -s /etc /usr/local/ ln -s /usr /usr/local/
wont be needed because we did this.
Language: HTML
sed -i ';s|ext_linktarget="/usr/local"|ext_linktarget=""|g'; /etc/ext.config
Also actually initializing extRoot after that step may actually fix minidlna.
I'll test in about 8-9 hours from now when I'm back home.


PirateBox Installs:
2x Zsun's (both testing, one with serial interface)
A5-V11 (mostly for OpenWRT testing DIY)
2x RPi Zero's
(one active in car 24/7, gets a lot of hits at Walmart, movie theaters and the mall)
2x RPi3's (both home servers, one Ubuntu custom install along side a ton of other services)
1x RPi2 (currently work server)
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 28, 2016 05:05PM
Thanks for the wiki update, I did the following steps:

Language: HTML
uci set uhttpd.main.listen_http=9080 uci set uhttpd.main.listen_https=9443 uci commit 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 uci set network.wwan=interface uci set network.wwan.proto=dhcp uci commit uci set firewall.@zone[1].network=';wan wan6 wwan'; uci commit /etc/init.d/network reload && /etc/init.d/firewall reload && wifi
reconnect
Language: HTML
ping google.com 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
Sitenote: are the 'mkdir /mnt/ext' and 'mkdir /mnt/usb' needed?

reconnect
Language: HTML
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 lighttpd /etc/init.d/lighttpd stop /etc/init.d/lighttpd disable opkg install piratebox
reconnect
Language: HTML
/etc/init.d/piratebox init /etc/init.d/piratebox start /etc/init.d/piratebox enable sed -i ';s|DROOPY_USE_USER="no"|DROOPY_USE_USER="yes"|g'; /opt/piratebox/conf/piratebox.conf /opt/piratebox/bin/install_piratebox.sh /opt/piratebox/conf/piratebox.conf part2 chmod a+w /opt/piratebox/share/tmp /etc/init.d/piratebox reload /etc/init.d/uhttpd start /etc/init.d/uhttpd enable

After this I have the Piratebox up with the upload, shoutbox and the storage usage percentage working.
After dinner I will continue with imageboard and minindla

------------------------------
post-dinner break:
Language: HTML
opkg install minidlna /etc/init.d/piratebox start /etc/init.d/uhttpd start /etc/init.d/uhttpd enable
Getting the following error's
Language: HTML
... Command failed: Not found /etc/init.d/piratebox: Creating piratebox loop image... umount: /opt/piratebox: target is busy (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1).) umount: /opt/piratebox: not mounted /etc/init.d/piratebox: WARNING: unable to umount piratebox image losetup: /dev/loop1: detach failed: No such device or address ...
There's no need to do "cp /opt/piratebox/src/openwrt.example.minidlna /mnt/ext/etc/config/minidlna"
minidlna seems to be working fine. (please confirm)

And finishing the installation with imageboard:
Language: HTML
opkg install piratebox-mod-imageboard /opt/piratebox/bin/board-autoconf.sh
A reboot is required.



Edited 6 time(s). Last edit at 04/28/2016 09:51PM by meduza.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 28, 2016 08:28PM
your believe is right, because of that sed, you don't need that folders.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 28, 2016 08:40PM
Hey,
why do you have this additional step
opkg install lighttpd
/etc/init.d/lighttpd stop
/etc/init.d/lighttpd disable
?
At least I'm interested in the additional lighttpd.

On the wiki, it is still
 opkg install -d ext minidlna


Quote

Command failed: Not found
/etc/init.d/piratebox: Creating piratebox loop image...
umount: /opt/piratebox: target is busy
(In some cases useful info about processes that
use the device is found by lsof(8) or fuser(1).)
umount: /opt/piratebox: not mounted
/etc/init.d/piratebox: WARNING: unable to umount piratebox image
losetup: /dev/loop1: detach failed: No such device or address
...
this is weird. I'm wondering which command failed here... and what is already blocking /opt/piratebox.

Quote

losetup: /dev/loop1: detach failed: No such device or address
This is a problem, because the /mnt/ext is not mounted on the system, the opt/piratebox lo won't be loop1.
My fault, it is not configurable. You need to patch this before doing piratebox init.
sed -i 's|/dev/loop1|/dev/loop0|g' /usr/share/piratebox/piratebox.common


BTW: if you want to be fancy, this is the code to format the sd card with ext4 on the running openwrt:

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


What do you mean with "Disk usage does not work"?
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 28, 2016 08:55PM
Alright, im back home. Im going to do a full reset (even format my sd card as exFAT as most come shipped that way now) Test with the changes in the forum then update the wiki as I go. I'll report back. I did an 'opkg install minidlna' before and got those same errors. I'll try again. Also changed the wiki minidlna line. Disk usage was not showing a percentage for me. I'll check that on this run too.

Fancy ext formatting steps AFTER setting up internet but BEFORE mounting steps.
Without the additional lighttpd steps.
remove usr/local steps
add 'sed -i 's|/dev/loop1|/dev/loop0|g' /usr/share/piratebox/piratebox.common' before piratebox init.


PirateBox Installs:
2x Zsun's (both testing, one with serial interface)
A5-V11 (mostly for OpenWRT testing DIY)
2x RPi Zero's
(one active in car 24/7, gets a lot of hits at Walmart, movie theaters and the mall)
2x RPi3's (both home servers, one Ubuntu custom install along side a ton of other services)
1x RPi2 (currently work server)



Edited 1 time(s). Last edit at 04/28/2016 08:57PM by TheExpertNoob.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 28, 2016 09:32PM
Quote
Matthias
At least I'm interested in the additional lighttpd.

After the opkg install piratebox and reconnecting to the zsun, i do
Language: HTML
/etc/init.d/piratebox init /etc/init.d/piratebox start
The result is
Language: HTML
-------------- Initialize PirateBoxScripts ----------- Starting initialize PirateBox Part2.. Distribute HEADER.txt into /opt/piratebox/share/Shared Distribute README.txt into /opt/piratebox/share/Shared Starting script piratebox Generating hosts file .... Generating dnsmasq.conf ..... Generating Environment-config for lighttpd ..... Empty tmp folder rm: ';/opt/piratebox/tmp'; is a directory Copy over design files Starting dnsmasq... 0 Starting droopy... 0 Generated HTML-Shoutbox File. Generated HTML-DiskUsage File. Starting lighttpd... 2016-04-27 08:15:14: [b](network.c.410) can';t bind to port: 80 Address already in use[/b] 255
Since I can't control the dependence and install scripts I do the additional step on forehand. The piratebox install will solve this afterwards.

Quote
Matthias
BTW: if you want to be fancy, this is the code to format the sd card with ext4 on the running openwrt:
>grinning smiley< And all that time I was swapping the SD to my debian machine.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 28, 2016 09:35PM
I had issues with the -d ram switch installing e2fsprogs, so I omitted it and it seemed to work fine after that. Not sure if linking the libraries and paths would then need to be necessary. I understand why the -d ram switch because were only using this once to format the sd card. Ignore that. Probably a typo on my part. It worked this test go-around.

So MiniDLNA: It seems changing the loop didn't help so I'm omitting it from the wiki for now.

Language: HTML
Stopping uttpd and disable it Command failed: Not found /etc/init.d/piratebox: Creating piratebox loop image... umount: /opt/piratebox: target is busy (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1).) umount: /opt/piratebox: not mounted /etc/init.d/piratebox: WARNING: unable to umount piratebox image losetup: /dev/loop0: detach failed: No such device or address -------------- Initialize PirateBoxScripts ----------- Starting initialize PirateBox Part2.. Distribute HEADER.txt into /opt/piratebox/share/Shared Distribute README.txt into /opt/piratebox/share/Shared Starting script piratebox Generating hosts file .... Generating dnsmasq.conf ..... Generating Environment-config for lighttpd ..... Empty tmp folder rm: ';/opt/piratebox/tmp'; is a directory Copy over design files Starting dnsmasq... 0 Starting droopy... 0 Generated HTML-Shoutbox File. Generated HTML-DiskUsage File. Starting lighttpd... 0 Bringing PirateBox down again and leave image mounted for further installation Stopping script piratebox Stopping dnsmasq... 0 Stopping droopy... 0 Stopping lighttpd... 0 Done Configuring libffmpeg-mini. Configuring libid3tag. Configuring minidlna.

Suggestions?

Edit: I omitted the opk install lighttpd and just did a stop and then disable. That worked for me.
Edit2:
Language: PHP
wget -qO- http://127.0.0.1/board/kareha.pl &> /dev/null #Try wget http://127.0.0.1/board/kareha.pl >> /dev/null
at the end of the script is not working. so trying #Try next go around.
miniDLNA is recognized on my Client PC but is configured for the /mnt directory.
So Im adding this back to the wiki:
Language: HTML
cp /opt/piratebox/src/openwrt.example.minidlna /etc/config/minidlna


PirateBox Installs:
2x Zsun's (both testing, one with serial interface)
A5-V11 (mostly for OpenWRT testing DIY)
2x RPi Zero's
(one active in car 24/7, gets a lot of hits at Walmart, movie theaters and the mall)
2x RPi3's (both home servers, one Ubuntu custom install along side a ton of other services)
1x RPi2 (currently work server)



Edited 7 time(s). Last edit at 04/28/2016 10:28PM by TheExpertNoob.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 28, 2016 10:08PM
@TheExpertNoob
According to Matthias we don't need to do the timesave thing any more. source
Would you leave it out of the wiki?

Q: what's the reason doing:
Language: PHP
wget -qO- http://127.0.0.1/board/kareha.pl &> /dev/null #Try wget http://127.0.0.1/board/kareha.pl >> /dev/null
For me after install, password setting and reboot the board works just fine.

Quote
TheExpertNoob
So Im adding this back to the wiki:
Language: HTML
cp /opt/piratebox/src/openwrt.example.minidlna /etc/config/minidlna
Your right, is missed the part of the folder configuration thin the config.



Edited 3 time(s). Last edit at 04/28/2016 10:15PM by meduza.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 28, 2016 10:31PM
well i think wget was failing because I was doing the imageboard AFTER miniDLNA which would bring piratebox down. Which is why I swapped them in the wiki. Im testing it this way on this run.

Edit to Imageboard step: I got that same error that minidlna got when I installed the imageboard about piratebox being able to unmount. Ending with "failed to connect to [127.0.0.1] unable to create index page" because piratebox went down. The auto-config.sh script still won't generate the image board index file for me either. Maybe a reboot after installing the imageboard and before configuring it?


PirateBox Installs:
2x Zsun's (both testing, one with serial interface)
A5-V11 (mostly for OpenWRT testing DIY)
2x RPi Zero's
(one active in car 24/7, gets a lot of hits at Walmart, movie theaters and the mall)
2x RPi3's (both home servers, one Ubuntu custom install along side a ton of other services)
1x RPi2 (currently work server)



Edited 2 time(s). Last edit at 04/28/2016 10:56PM by TheExpertNoob.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 28, 2016 11:05PM
Oh. I think I got this. Reboot after enabling piratebox and before installing addons(imageboard & minidlna). installing minidlna went off without any errors AFTER I rebooted. Full reset last time for today.

Lighttpd theory:
opkg install piratebox;
piratebox starts(including lighttpd), but dies creating the loop because internet reloads from the network killing the connection getting the piratebox loop image.
so we have to kill lighttpd and re-init piratebox on reconnect.

Not sure why piratebox wants to re-create itself when something is installed.
Theory:
Language: PHP
DEPENDS:=piratebox
is in the piratebox-mod-imageboard makefile along with other packages as dependincies. Is opkg trying to reinstall it as a dependency maybe because the install initially fails when we do opkg install piratebox?

OR check for $PIRATEBOX/conf/init_done before installing anything. Gah :-/

Possibly the ln -s trying to link to itself since we are using root instead of /usr/local for installing piratebox ext?


PirateBox Installs:
2x Zsun's (both testing, one with serial interface)
A5-V11 (mostly for OpenWRT testing DIY)
2x RPi Zero's
(one active in car 24/7, gets a lot of hits at Walmart, movie theaters and the mall)
2x RPi3's (both home servers, one Ubuntu custom install along side a ton of other services)
1x RPi2 (currently work server)



Edited 6 time(s). Last edit at 04/29/2016 12:55AM by TheExpertNoob.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 29, 2016 12:51AM
Matthias Wrote:
-------------------------------------------------------
> What do you mean with "Disk usage does not work"?

Hehe, i figured that one out! did a df-h and Im using 0% of my 64Gb SDcard smileys with beer


Final Verdict: It works, but with errors.


PirateBox Installs:
2x Zsun's (both testing, one with serial interface)
A5-V11 (mostly for OpenWRT testing DIY)
2x RPi Zero's
(one active in car 24/7, gets a lot of hits at Walmart, movie theaters and the mall)
2x RPi3's (both home servers, one Ubuntu custom install along side a ton of other services)
1x RPi2 (currently work server)



Edited 1 time(s). Last edit at 04/29/2016 02:27AM by TheExpertNoob.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 29, 2016 12:18PM
@TheExpertNoob
In the Wiki I'm missing the 'sed -i 's|/dev/loop1|/dev/loop0|g' /usr/share/piratebox/piratebox.common' before piratebox init.

My mount looks like:
Language: HTML
root@piratebox:~# mount /dev/root on /rom type squashfs (ro,relatime) proc on /proc type proc (rw,noatime) sysfs on /sys type sysfs (rw,noatime) tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime) /dev/sda1 on /overlay type ext4 (rw,relatime,data=ordered) overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work) tmpfs on /dev type tmpfs (rw,relatime,size=512k,mode=755) devpts on /dev/pts type devpts (rw,relatime,mode=600) debugfs on /sys/kernel/debug type debugfs (rw,noatime) /dev/loop0 on /opt/piratebox type ext4 (rw,relatime,sync,data=ordered)
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 29, 2016 01:20PM
meduza Wrote:
-------------------------------------------------------
> @TheExpertNoob
> In the Wiki I'm missing the 'sed -i 's|/dev/loop1|/dev/loop0|g' /usr/share/piratebox/piratebox.common'
>before piratebox init.

Because changing the loop didn't make any difference. in the error I got.


PirateBox Installs:
2x Zsun's (both testing, one with serial interface)
A5-V11 (mostly for OpenWRT testing DIY)
2x RPi Zero's
(one active in car 24/7, gets a lot of hits at Walmart, movie theaters and the mall)
2x RPi3's (both home servers, one Ubuntu custom install along side a ton of other services)
1x RPi2 (currently work server)



Edited 1 time(s). Last edit at 04/29/2016 01:21PM by TheExpertNoob.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 29, 2016 01:36PM
Hmm.. I wonder if we need to do this around piratebox installation. After init, before start.
Language: PHP
#The following commands is that the upload-daemon is running with the lighttpd user sed -i ';s|DROOPY_USE_USER="no"|DROOPY_USE_USER="yes"|g'; /opt/piratebox/conf/piratebox.conf /opt/piratebox/bin/install_piratebox.sh /opt/piratebox/conf/piratebox.conf part2
It might be the reason for the lighttpd error using port 80 and why piratebox install gets kicked off again when we install the imageboard/minidlna because init_done never gets placed.
I'll test this in 8ish hours when I'm back home from work.


PirateBox Installs:
2x Zsun's (both testing, one with serial interface)
A5-V11 (mostly for OpenWRT testing DIY)
2x RPi Zero's
(one active in car 24/7, gets a lot of hits at Walmart, movie theaters and the mall)
2x RPi3's (both home servers, one Ubuntu custom install along side a ton of other services)
1x RPi2 (currently work server)



Edited 1 time(s). Last edit at 04/29/2016 01:39PM by TheExpertNoob.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 30, 2016 07:48PM
Quote
TheExpertNoob
meduza Wrote:
-------------------------------------------------------
> @TheExpertNoob
> In the Wiki I'm missing the 'sed -i 's|/dev/loop1|/dev/loop0|g' /usr/share/piratebox/piratebox.common'
>before piratebox init.

Because changing the loop didn't make any difference. in the error I got.

I think the message is false positive. I did the following:
Language: HTML
sed -i ';s|/dev/loop1|/dev/loop0|g'; /usr/share/piratebox/piratebox.common /etc/init.d/piratebox init /etc/init.d/piratebox start reboot

After this, first thing I did was:
Language: HTML
root@piratebox:~# df -h Filesystem Size Used Available Use% Mounted on rootfs 922.7M 96.8M 762.2M 11% / /dev/root 3.3M 3.3M 0 100% /rom tmpfs 29.8M 76.0K 29.8M 0% /tmp /dev/sda1 922.7M 96.8M 762.2M 11% /overlay overlayfs:/overlay 922.7M 96.8M 762.2M 11% / tmpfs 512.0K 0 512.0K 0% /dev /dev/loop0 47.4M 1.2M 42.7M 3% /opt/piratebox root@piratebox:~# /etc/init.d/piratebox stop Stopping script piratebox Stopping dnsmasq... 0 Stopping droopy... 0 Stopping lighttpd... 0 losetup: /dev/loop0: detach failed: No such device or address root@piratebox:~# df -h Filesystem Size Used Available Use% Mounted on rootfs 922.7M 96.8M 762.2M 11% / /dev/root 3.3M 3.3M 0 100% /rom tmpfs 29.8M 72.0K 29.8M 0% /tmp /dev/sda1 922.7M 96.8M 762.2M 11% /overlay overlayfs:/overlay 922.7M 96.8M 762.2M 11% / tmpfs 512.0K 0 512.0K 0% /dev root@piratebox:~#

I will try to find out how the umount part is coded in piratebox.common and how to resolve this.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
April 30, 2016 09:00PM
fresh install number >50 (lost count)

This is my raw install input log. No (serious) errors during install and after the last reboot i've check the piratebox webside. All functions working as supposed.
## Connect to openwrt
uci set uhttpd.main.listen_http=9080
uci set uhttpd.main.listen_https=9443
uci commit
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='test'
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='test'
uci set wireless.@wifi-iface[-1].disabled=0
uci commit
uci set network.wwan=interface
uci set network.wwan.proto=dhcp
uci commit
uci set firewall.@zone[1].network='wan wan6 wwan'
uci commit
/etc/init.d/network reload && /etc/init.d/firewall reload && wifi

# Reconnect to openwrt
ping google.com
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

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

# Reconnect to openwrt
echo "src/gz piratebox [stable.openwrt.piratebox.de]; >> /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

# Reconnect to PirateBox - Share Freely
/etc/init.d/lighttpd stop
/etc/init.d/lighttpd disable
sed -i 's|/dev/loop1|/dev/loop0|g' /usr/share/piratebox/piratebox.common
/etc/init.d/piratebox init
opkg install piratebox-mod-imageboard
/opt/piratebox/bin/board-autoconf.sh
/etc/init.d/piratebox start
chmod a+w /opt/piratebox/share/tmp

opkg install minidlna
cp /opt/piratebox/src/openwrt.example.minidlna /etc/config/minidlna

/etc/init.d/uhttpd start
/etc/init.d/uhttpd enable
uci set wireless.@wifi-iface[1].disabled=1
uci commit

reboot



Edited 1 time(s). Last edit at 05/01/2016 06:29AM by meduza.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
May 01, 2016 12:22AM
yea. and as luck would have it, my sdcard got corrupt at some point. The read-only bit got triggered on the microsd and it will not reformat for anything. gana try and get an RMA on it.


PirateBox Installs:
2x Zsun's (both testing, one with serial interface)
A5-V11 (mostly for OpenWRT testing DIY)
2x RPi Zero's
(one active in car 24/7, gets a lot of hits at Walmart, movie theaters and the mall)
2x RPi3's (both home servers, one Ubuntu custom install along side a ton of other services)
1x RPi2 (currently work server)
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
May 01, 2016 06:27AM
Quick Google search gave me, hoop it's working
Language: HTML
Start > Run > cmd type "diskpart" -> runs diskpart.exe from system folder type "list volume" -> now you see all your connected drives, see which one is the drive type "select volume #" -> # being the letter of your drive type "attributes disk clear readonly" -> removing the protection Then open your SD, you can now edit, delete, move files.



Edited 1 time(s). Last edit at 05/01/2016 06:30AM by meduza.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
May 01, 2016 07:27AM
I noted the fact about lighttpd in our github-Issue [github.com]
This is something we need to address in the piratebox install script.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
May 01, 2016 07:37AM
Oh, some questions spawend...

1. lighttpd was not started automatically on AA release of OpenWrt, this was changed. So you have to leave the lighttpd steps in there to make sure, that lighttpd is not started by the system.
2. The bind 80 is because of #1
3. The sed for Droopy is because you are now running under a ext3 filesystem, so droopy have to run as the lighttpd user, that uploaded files work
4. Piratebox Stops after initialization during installation. So please move the imageboard configuration after a reboot
5. Dependency from imageboard to PirateBox is, because you need to have PirateBox installed to install the imageboard winking smiley . Proper dependencies, you know. ImageBoard installation should not trigger PirateBox installation, when installing to the same installation destination.
6. The sed for loopback is a fix for running "/etc/init.d/piratebox stop". Without that loop1 fix, you won't unmount the opt/piratebox completely clean. Maybe there is a kernel & utility adjustment that the loopback device is automatically removed. Can you check if you

/opt/piratebox/init.d/piratebox_alt
cd /
umount /opt/piratebox
ls /dev/loop*
If you can see a loop0 device? If yes, that part of the piratebox-stop command can be removed for CC.

Did I forgot a question? confused smiley

Best regards
Matthias smoking smiley
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox
May 01, 2016 01:16PM
meduza Wrote:
-------------------------------------------------------
> Quick Google search gave me, hoop it's working
>
> Start > Run > cmd
> type "diskpart" -> runs diskpart.exe from system
> folder
> type "list volume" -> now you see all your
> connected drives, see which one is the drive
> type "select volume #" -> # being the letter of
> your drive
> type "attributes disk clear readonly" -> removing
> the protection
> Then open your SD, you can now edit, delete, move
> files.
>

I came across that too, tried it; didnt work.


PirateBox Installs:
2x Zsun's (both testing, one with serial interface)
A5-V11 (mostly for OpenWRT testing DIY)
2x RPi Zero's
(one active in car 24/7, gets a lot of hits at Walmart, movie theaters and the mall)
2x RPi3's (both home servers, one Ubuntu custom install along side a ton of other services)
1x RPi2 (currently work server)