Raspbian Jessie Lite Piratebox

Posted by OnesnZeroes 
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
Raspbian Jessie Lite Piratebox
September 17, 2016 09:45AM
Following the steps at : https://piratebox.cc/raspberry_pi:diy:manual I setup and installed the piratebox software. Everything seemed to work but if I try to connect to the AP my phone just sits on 'connecting' (not getting an ip address?) .
If I write the prebulit arch linux image onto the sd card it runs fine but i'd prefer to have it running on raspbian.



I'm trying to setup a piratebox on raspbian jessie lite but am having no luck following the guides and everything else I can find online.

    [*] Doing the step by step manual guide (which uses wheezy) the piratebox looks like its working but won't let anyone connect to the access point.

    [*]Download the piratebox.tar, extracting it, and installing through ./install.sh looked like it worked but doesnt show any access point.

    [*]The premade, arch linux based, image works, but it lacks features and im not familiar with arch linux.



Edited 3 time(s). Last edit at 09/17/2016 11:09PM by OnesnZeroes.
M0rn1ng5t@r
Re: Unable to connect to piratebox AP
September 17, 2016 01:38PM
you need to be connected to the piratebox wifi AP in order to ssh in @ 192.168.77.1
Re: Unable to connect to piratebox AP
September 17, 2016 09:24PM
I can't connect to the AP so I can't ssh in like that. this issue is related to using Raspbian Jessie Lite instead of Weezy.
Re: Unable to connect to piratebox AP
September 20, 2016 04:40PM
On Debian, the most packages enable&start themself during startup. Especially the dnsmasq is causing issues then.
Can you try to

/etc/init.d/dnsmasq stop

And then to restart the piratebox scripts. that might help with the connection problem.
If not, we need more data to figure out what is wrong.

Matthias
Re: Unable to connect to piratebox AP
September 24, 2016 09:47AM
I'll try again stopping dnsmasq and see if that works. if it doesnt how do I narrow it down? I figured there would be guides on how to build a raspbian jessie piratebox but couldnt find much.
Re: Raspbian Jessie Lite Piratebox
September 24, 2016 11:33AM
I was able to connect after running

sudo /etc/init.d/dnsmasq stop
sudo /etc/init.d/piratebox stop
sudo /etc/init.d/piratebox start

When I tried to reset the piratebox I got an error near the end

pi@raspberrypi:~ $ sudo /etc/init.d/piratebox start
[....] Starting script piratebox :
Generating hosts file ....
Generating dnsmasq.conf .....
Generating Environment-config for lighttpd .....
Empty tmp folder
rm: cannot remove ‘/opt/piratebox/tmp/’: Is a directory
Copy over design files
Generating json configuration file: /opt/piratebox/www/piratebox_config.json
[ ok ] Starting hostap... :.
[....]   Setting up wlan:Bringing up wifi interface wlan0
Setting up wlan0
[ ok ] Starting dnsmasq... :.
[ ok ] Setting up firewall rules...:.
[ ok ] Starting droopy...:.
Generated HTML-Shoutbox File.
CRITICAL: /opt/piratebox/share/Shared modified 2 minutes ago. Threshold set to 5 minutes. Cannot update.
Generated HTML-DiskUsage File.
[....] Starting lighttpd...:2016-09-24 11:32:43: (network.c.409) can't bind to port:  80 Address already in use
 (warning).
pi@raspberrypi:~ $

I was able to connect to the piratebox, but the webserver doesnt seem to work right. browse files goes to a 404. and after uploading a file through piratebox.lan that domain now redirects to a lighttpd place holder.


*addition :
after running

sudo /etc/init.d/lighttpd stop

I was able to stop / start the piratebox without the address error. I'll have to reimage and update the sd card again as the web server half broke somehow.



Edited 1 time(s). Last edit at 09/24/2016 11:41AM by OnesnZeroes.
Re: Raspbian Jessie Lite Piratebox
September 25, 2016 06:02AM
The piratebox half works now. after stopping dnsmasq and lighttpd then using stop/start to restart the scripts I can connect and connect to the webserver. if i try to browse the uploaded files it gives me a 404. and piratebox.lan leads to a dead page.
Re: Raspbian Jessie Lite Piratebox
September 26, 2016 06:14PM
Hi,
did you use the RPI DIY manual howto. It contains exactly the steps you missed winking smiley

About the 404:

Can you please post the output of the following commands please:

cat /opt/piratebox/version
ls -lR /opt/piratebox/www
ls -lR /opt/piratebox/share

Best regards
Matthias
Re: Raspbian Jessie Lite Piratebox
September 27, 2016 10:49PM
Yes, I followed the RPI DIY manual several times, step-by-step.(other than using jessie instead of weezy)
Everytime I reboot the Raspberry Pi I have to run this before my phone will be able to connect to the Piratebox AP.

sudo /etc/init.d/dnsmasq stop
sudo /etc/init.d/lighttpd stop
sudo /etc/init.d/piratebox stop
sudo /etc/init.d/piratebox start


cat /opt/piratebox/version
piratebox-ws_1.1.0
## development...origin/development
79cbb14 Merge pull request #153 from TheExpertNoob/development

and the other two commands:
ls -lR /opt/piratebox/www
ls -lR /opt/piratebox/share

just show all the directorys as "nobody / no group" so I need to use chmod. but im unsure which command/rights to use.
Re: Raspbian Jessie Lite Piratebox
September 28, 2016 09:40AM
but then you propably missed that part highlighted

sudo update-rc.d lighttpd remove
sudo apt-get -y install dnsmasq
sudo /etc/init.d/dnsmasq stop
sudo update-rc.d dnsmasq remove
sudo apt-get -y install hostapd
sudo /etc/init.d/hostapd stop
sudo update-rc.d hostapd remove

Rerun those commandos, they should disable these services from bootup...
Re: Raspbian Jessie Lite Piratebox
September 28, 2016 10:01AM
I copy/pasted the guide into putty line by line.
I'll try again.

Which chmod commands to I need to run to fix the permissions?
Re: Raspbian Jessie Lite Piratebox
October 11, 2016 06:34PM
I ran into this same thing... on Jessie you have run:

sudo systemctl disable lighttpd
sudo systemctl disable dnsmasq

They should no longer start at boot.