PirateBox v0.3-4 (with Shoutbox) (Updated 02-18-12)

Posted by darts 
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
PirateBox v0.3-4 (with Shoutbox) (Updated 02-18-12)
March 07, 2011 03:31AM
02/18/2012

Hi Everyone,

I've uploaded a slightly modified disk image (0.3-4) of PirateBox with Chat to github. In this version, I've commented out all of the lines in the /etc/udev/rules.d/70-persistent-net.rules file as this was causing trouble for some folks. Everything else stays the same - I've updated the instructions below and on the wiki to reflect the new version.

----

03/06/2011

Hey Everyone,

I have just uploaded yet another new and improved disk image (0.3-3) of PirateBox with a shoutbox (chatroom) for the Dockstar or Pogoplug (v2 gray/pink - no support for Pogoplug Pro).

This version includes the avahi-daemon package which now provides Linux and Mac OS X support for non DD-WRT routers. This means you can connect your plug computer directly to any router (e.g. your home network router) and access the PirateBox web interface from any Linux or Mac OS X client computer connected to the network. Simply navigate to piratebox or piratebox.local and begin chatting and/or uploading/downloading files.

Three important notes:

1. If the IP address of your router is not 192.168.1.1 you will need to update the PirateBox's nameserver at /etc/resolv.conf to match your router's IP.

2. This version of PirateBox with Chat does not include support for Windows clients UNLESS you are using the HTTP Redirect method with a DD-WRT enabled router. Please see this section on the wiki for instructions on how to change the URLs from piratebox.local to the IP address assigned by your non DD-WRT router.

3. I have updated two files on my server .BACK.TO.MENU.html and .READ.ME.htm to reflect the new piratebox.local links. If you are using older versions of these two files, you will need to update the URLS from the older pirate.box.

More PirateBox (with Shoutbox) Info:

1. PirateBox DIY Plug Computer tutorial on the wiki

2. README file on GitHub

3. Short video demo of PirateBox with Chat

Overview
Following the instructions below, you should be able to install this version of PirateBox on a plug computer device in about 10 minutes. This version of PirateBox with chat can handle simultaneous downloads from multiple clients thanks to the addition of Pierre Duquesne's better minimal web server.

Stuff You'll Need
1. Computer running Linux (Mac & Windows users can run the Ubuntu Live CD)
2. Dockstar or Pogoplug (v2 gray/pink - no support for Pogoplug Pros)
3. USB drive
4. Ethernet cable

Pre-Installation (Only Needed for "Fresh" Dockstars or Pogoplugs)
If you are you using a brand new Dockstar or Pogoplug, you must first update the locked uBoot boot loader with a new ulocked version that provides support for booting from USB drives. Jeff Doozan has created an easy to use script for this. This step only takes a couple of minutes - see instructions below.

As an alternative, you may instead use Jeff Doozan's script to install Debian on a USB drive connected to the Dockstar. This method takes a little longer but will also install the unlocked uBoot boot loader on your device. See my Debian on the Seagate Dockstar wiki page for more info.

Install unlocked uBoot Boot Loader
1. Connect your Dockstar or Pogoplug to your gateway router with an ethernet cable and plug it in. Visit your router's main administration page (e.g. 192.168.1.1) with a web browser to determine the IP address your router has assigned the Dockstar.

2. Open a terminal (Ubuntu users: Applications > Accessories > Terminal) and SSH into your plug computer:
Language: PHP
ssh root@IP_Address_Provided_By_Your_Router

The default password is: stxadmin (ceadmin for Pogoplugs)

3. Install the unlocked uBoot using Jeff Doozan's script:
Language: PHP
cd /tmp wget http://jeff.doozan.com/debian/uboot/install_uboot_mtd0.sh chmod +x install_uboot_mtd0.sh ./install_uboot_mtd0.sh

Once Jeff's script has successfully completed, you can unplug the Dockstar from power and begin the installation instructions below.

Installation Instructions:

1. Format your USB Drive with GParted. On Ubuntu, you can install with:
sudo apt-get install gparted

Note: If you are using an Ubuntu Live CD, GParted comes pre-installed (System > Admin > GParted).

Create the following three partitions:
ext2 (500Mcool smiley (label: piratebox)

swap (256Mcool smiley (no label)

FAT32 (big as you like) (label: share)

Note: After you finish formatting, mount the partitions by unplugging the USB Drive and plugging it back in to your computer.

2. Open a terminal on your computer and download and extract the PirateBox image into the piratebox (ext2) partition on your freshly formatted USB drive:

Language: PHP
sudo su wget --no-check-certificate https://github.com/downloads/daviddarts/PirateBox/piratebox_0.3-4.tar.gz

3. Now uncompress the file into the ext2 partition on the USB drive:

tar xvpfz piratebox_0.3-4.tar.gz --strip-components 1 -C /media/piratebox

4. Exit super user and create "piratebox" directory on the /media/share (FAT32) partition:
exit
mkdir /media/share/piratebox

5. Navigate to piratebox directory and add the following five files to the piratebox directory
Language: PHP
cd /media/share/piratebox   wget http://daviddarts.com/piratebox/.READ.ME.htm   wget http://daviddarts.com/piratebox/.BACK.TO.MENU.htm   wget http://daviddarts.com/piratebox/piratebox-logo-small.png   wget http://daviddarts.com/piratebox/piratebox-logo.png   wget http://daviddarts.com/piratebox/favicon.ico   wget http://daviddarts.com/dropbox/webserver.py

6. Unmount USB Drive using your file manager - Important: allow the system to "write" any extra data to the drive first before unplugging (be patient!)

7. Connect USB Drive to the back port of the Dockstar (beside the ethernet port) and connect the Dockstart to your DD-WRT router - see the DIY Tutorial on the wiki for more info. Note: If you would like to use your PirateBox with a non DD-WRT router, see this section on the wiki for instructions.

8. Start testing!

Recovery System (Optional)
Once you have your PirateBox up and running, you may wish to add Jeff Doozan's Recovery system to your plug device. This replaces the original Pogoplug kernel on mtd1 and the Pogoplug system on mtd2 with a more sophisticated system.

Note: Before proceeding, you may need to change your PirateBox's nameserver address to match the IP address of your gateway router (the router you use to connect to the Internet). By default, the PirateBox's nameserver address is 192.168.1.1 which matches the default IP address for DD-WRT. If your gateway IP differs from this, you can change the PirateBox's nameserver address by navigating to the /etc/resolv.conf file and updating the address. Be sure to return it to 192.168.1.1 when you're done installing the Recovery System.

1. Connect your Dockstar or Pogoplug to your gateway router with an ethernet cable and power up the device.

2. Once it is up and running, SSH into the Dockstar and issue the following commands:

Language: PHP
cd /tmp wget http://jeff.doozan.com/debian/rescue/install_rescue.sh chmod +x install_rescue.sh ./install_rescue.sh

3. After the script has finished installing (should only take 1-2 minutes), you can shutdown the device (halt). Note: If you changed the nameserver as described above, be sure to change it back to 192.168.1.1

You can now visit the Recovery partition by unplugging your USB drive and rebooting your plug computer device (while still connected to your gateway router). Visit your router's main administration page (e.g. 192.168.1.1) with a web browser to determine the IP address your router has assigned the Recovery Partition and SSH into it:

ssh root@IP_Address_of_Your_Recovery_Partition

The default password is: root

You can find more info about the Recovery System on Jeff Doozan's forum.

Additional Info About PirateBox with Chat

1. The shoutbox is based on JCW's PyShoutOut and is powered by a Python web server that runs on port 8002. It is embedded into /bin/droopy (port 80) as an iframe. See the changelog file at the top of the /bin/droopy script for more details. The server script and shoutbox files can be found in the /opt/piratebox/chat directory.

2. The shoutbox web interface is currently set to refresh every 8 seconds which means there can be a short delay between posting a message and having it read by other chat clients on the PirateBox network. The refresh rate can be adjusted in the /opt/piratebox/chat/index.html file (see the exact line below) though keep in mind that setting a faster refresh rate will place additional stress on the server. At this point I'm not entirely sure how much refreshing or how many clients the server will support.

interval = window.setInterval( 'refresh()', 8000 );

3. The chat logs are erased at each reboot by the echo command in the /etc/init.d/piratebox_start file (Note: this file used to be called droopy_start). This is mostly a political/philisophical decision. There are some other changes to piratebox_start file as well - see below for details:

Language: PHP
#! /bin/sh # /etc/init.d/piratebox_start ### BEGIN INIT INFO # Provides: scriptname # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start daemon at boot time # Description: Enable service provided by daemon. ### END INIT INFO #Run droopy on port 80 python /bin/droopy -m "<b>1.</b> Learn more about the project <a href="http://piratebox.local:8001/.READ.ME.htm" target="_parent" ><b>here</b></a>."\ "<p><b>2.</b> Click button below to begin sharing.</p>"\ "<b>3.</b> Browse and download files <a href="http://piratebox.local:8001" target="_parent"><b>here</b></a>.<br>"\ -p /mnt/share/piratebox/piratebox-logo-small.png -d /mnt/share/piratebox &   #Serve up piratebox chat on port 8002 cd /opt/piratebox/chat; python pirateboxchat_start.py &   #Serve up the shared directory on port 8001 cd /mnt/share/piratebox; python webserver.py 8001 &   #Remove any tmp files left behind from past uploads rm /mnt/share/piratebox/tmp*   #Delete chat logs and add welcome message echo "<date>00:00:00</date>&nbsp;&nbsp;<name>PirateBox:</name>&nbsp;&nbsp;&nbsp;<data class=';def';>Chat and share files anonymously!</data><br>" > /opt/piratebox/chat/cgi-bin/data.pso &&   exit 0

4. The default password for the system is: root

Keep in mind that the Dockstar does not have a clock - therefor the default date reverts back to 1969 whenever the Dockstar is not connected to the Internet. In order to change the password, you should first change the date to something more current or otherwise the system will perpetually remind you to update your password each time you reboot and SSH into the box. To change the date, use:

date --set 2011-02-20

Then, to change your password, use:
passwd



Edited 8 time(s). Last edit at 02/18/2012 06:03PM by darts.
Re: PirateBox v0.3-3 (with Shoutbox)
March 07, 2011 05:25AM
Do you think the Pogoplug Pro will be supported in the future? This would be great since I bought one not knowing it would not work. Thanks
Re: PirateBox v0.3-3 (with Shoutbox)
March 07, 2011 05:30AM
Hey Darts any news on buffalo wzr-hp-g300nh support?

Wish i could help with code but not so good in that area. im helping in other ways though.
Im working on a concept i thought of il post my findings if i can get it to work.

Oh random question do you have a donation area?
I don't have much but i wouldn't mind making this projects pockets a bit heavier.
______________________________________________________________________
project + no sleep x few pots of coffee = interesting day spinning smiley sticking its tongue out
Re: PirateBox v0.3-3 (with Shoutbox)
March 07, 2011 08:14PM
Hi David,
good work with the multi-version image.

Is there a particular reason why not using my configuration and init.d file?

Which things did you changes you make?
> Changes in the droopy script for the hastname
> Changes on the start-script
> The new dns-server on the Dockstart

Did I miss something?

best regards
Matthias
Re: PirateBox v0.3-3 (with Shoutbox)
March 08, 2011 06:42PM
Hey Matthias,

Check out my response here to your other post.

David



Edited 1 time(s). Last edit at 03/09/2011 03:32AM by darts.
Re: PirateBox v0.3-3 (with Shoutbox)
March 10, 2011 09:27PM
Hey David,

I had a look at the modified droopy script from 0.3-1.

I changed the template style with one var for the iframe, so you are able to change it easily.
And I created one var the hostname with this its easier to change the hostname of the piratebox.

Please have a look: Download

smiling smiley
Matthias
Re: PirateBox v0.3-3 (with Shoutbox)
March 10, 2011 09:51PM
This looks good Matthias - I'm away from my Dockstar today but will test it when I get home.
Thanks!
David
I thought you guys might like this screenshot from Amazon:




Thanks for this project!
Re: PirateBox v0.3-3 (with Shoutbox)
March 14, 2011 04:07AM
awesome ray-ning i wanted one i could add an antenna to and i heard that one has that option.

i was going to hook up a cb radio antenna to see what would happen. im experimenting with these to get more range because im using mine for pirate news/radio i call it the propaganda box(hope you dont mind darts). iv got the box built in to my car and a dish along with an antenna mounted to my car all i need is to figure out how to broadcast radio from it (dont know if this is possible) but worth looking into.it has been a fun project with lots of sleepless nights.
Re: PirateBox v0.3-3 (with Shoutbox)
March 14, 2011 05:26AM
@ray-ning YEAH! hot smiley

@Jfang I think you'll need two antennas for CB radio and cassical radio, because radio and wireless lan have different wavelength
Re: PirateBox v0.3-3 (with Shoutbox)
March 14, 2011 06:03AM
@ray-ning That's hillarious that's exactly the button I pressed when I purchased my supplies to build mine! (search for the lunchbox and the rest show up smiling smiley )

@Jfang agreed you'll need different antenna's for different wavelengths. try a yagi antenna or the likes if your looking for major range. As for broadcasting actual radio from your computer, you can but it's not cheap. I've done it with sam broadcaster and a PCI Max Ultra card. I like yourself just wanted to do it as a project. I'm just that kind of nerd. Which is also why I jumpped into this PirateBox project!

However I'm having an issue with getting my dockstar to boot into the debian-squeeze with piratebox image.

I've followed the tutorial above (including a nice asus 9db antenna mod which I'll be posting about later) however the dockstar just won't get an ip from the router. I've re-flashed the dockstar and it works fine without the usb attached, but doesn't seem to want to work after putting it in the usb slot next to the rj-45 jack.

I've deleted the partitions on my SanDisk 16gb thumbdrive and recreated them once setting the "boot" flag on the first partition and several times without, but still no love. any ideas? I even purchased the thumbdrive because it looks the same as the one's in the photo's of the diy 2 post so that I wouldn't run into these types of errors.

Looking forward to getting this up and working! and Thanks for the fun project/idea!

*edit*
Forgot to add some info. The dockstar without the usb start's and works fine (ip and ssh both work) with the blinking green light but once I add the usb stick and start it up, it start's flashing green, goes flashing orange, stops and then just stay's off. No ip no ssh (obviously)

*edit 2*
So I've tried it with multiple thumbdrives to no avail. I'm working on trying an external usb powered hd but I'm not getting my hopes up with that reading elsewhere that thumbdrives are better suited to the task.

*edit 3*
Alright! Success (sortof) I have debian-squeeze running on my dockstar via the usb using a combination of posts.
I formatted the usb using fdisk and the instructions found here.

Then I ran the info found at Jeff's site here. and after it was all said and done, it's working great.

So I'm not sure if the problem is in the install script for piratebox, or if gparted just wasn't formatting something the same way? Either way I'd be more then happy to help with any info you would need.

Now that I have debian running, should I follow the other diy post for installing it on a laptop?

*------*
|YEA!|
*------*



Edited 3 time(s). Last edit at 03/14/2011 09:25PM by DanielS.
Re: PirateBox v0.3-3 (with Shoutbox)
March 14, 2011 08:46PM
Hi David,

I just updated my script package. I added a new version of droopy, which now accepts the hostname using option -H smiling smiley (which is used by my init.d script)
I used .lan as domain.

I tried the combination piratebox.lan and the hostname-script-changes with linux(local) , android and windows remote.

Have a look smiling smiley

Best regards
Matthias
Re: PirateBox v0.3-3 (with Shoutbox)
March 15, 2011 01:07AM
Hey Matthias,

This looks great - I definitely plan to integrate your droopy mods into the next disk image for the Dockstar/plug computer. I'm out of town this week but will try to put something together by next week.

David
Re: PirateBox v0.3-3 (with Shoutbox)
March 15, 2011 03:45AM
ray-ning Wrote:
-------------------------------------------------------
> I thought you guys might like this screenshot from
> Amazon:
>
> [piczasso.com]
>
>
> Thanks for this project!

Hey ray-ning - thanks for sharing the screenshot
psywiped
Re: PirateBox v0.3-3 (with Shoutbox)
April 03, 2011 11:48PM
Having the same issue can't access the pogoplug with the piratebox 0.3-3 usb key but the same key works with Debian Squeeze so I'm wondering how to set the rest of it up manually.
Followed lthe v1 instructions and got the piratebox working for file sharing no how do i add the shoutbox to it thru the command line as the tar version never shows with an ip address.
Re: PirateBox v0.3-3 (with Shoutbox)
April 09, 2011 06:17AM
For the shoutbox, you have to use another set of scripts :/
I am working on an IceCast + FM Transmitter mod for the PBox ... using this for the FM [www.fmuser.com] ... have you made any progress with radio experiments FM or Streaming?
Quote

For the shoutbox, you have to use another set of scripts

Figured as much but where are the set of scripts that I need?
Re: PirateBox v0.3-3 (with Shoutbox)
April 11, 2011 03:47PM
For 0.3-3, The shoutbox files are located in: /opt/piratebox/chat

Check out the /etc/init.d/piratebox_start file (listed in the first post above) as it provides details about where everything is located.
Hello you all.
I would like to help but I'm not really good at programming =/
I know a fex HTML and PHP, enough to write an automatic language selection script.
Thus, if you want the HTML pages to be available in French and Spanish just tell me!
Re: PirateBox v0.3-3 (with Shoutbox)
May 09, 2011 06:27PM
Hi,
thanks for your offer.
The droopy-script already provides severall languages with automatic selection smiling smiley
Rash
Re: PirateBox v0.3-3 (with Shoutbox)
July 07, 2011 03:05PM
What about the chatbox?
Re: PirateBox v0.3-3 (with Shoutbox)
July 07, 2011 06:57PM
What do you want to ask?
Re: PirateBox v0.3-3 (with Shoutbox)
January 27, 2012 04:58AM
Will the shoutbox be available on open wrt routers that do not have a dockstar??
Re: PirateBox v0.3-4 (with Shoutbox) (Updated 02-18-12)
March 04, 2012 05:36PM
Does it work on TP-WR1043ND?
Hi everyone,

How can I install the mkpiratebox (for openwrt) with chat???

Thanks,

???
Okay, Step 1 = fail.

I have a PogoPlug pink and a TopLink DD-WRT router.

I have connected the PogoPlug to the router and hit the router's admin page (192.168.1.1). It gives me the IP address for the Pogoplug at 192.168.1.113.

When I pull up Terminal (I'm using Mac OSX 10.5.8) and put in "ssh root@192.168.1.113" I get "ssh: connect to host 192.168.1.113 port 22: Connection refused"

Any ideas?
Hey,

I am having some of the same problems, I'm using a pogoplug tho... I can boot using debian/linux/etc usb sticks and with no usb stick, just not the piratebox one. What did you do to get yours to work? Is there another version you would recommend to try? I know my pogo plug is v2.... the exact model number is POGO-E02. I have a feeling its something to do with gparted aswell. I've tried to reformat/reload/re-download many times; still no avail.

Any help would be much appreciated!
-Robert
Hello everyone,

Sorry about the double post, I thought my last post would be embedded in one of the above posts(and therefore make some sense in the context of one of the above posts) Anyway, If someone could help me out with some of the issues I'm having it would be greatly appreciated!

First, My Goal:
1) Have a functioning piratebox; smiling smiley

My Setup:
1) A d-wrt capable router (its a linksys, not sure of the exact model) - I have successfully installed d-wrt on it.
2) A pogo plug ; model POGO-E02

- I have successfully ran the script per this tutorial to unlock the uBoot - no problems
- I formatted a usb with the partitions per this tutorial (v0.3-4) and extracted the tar to the piratebox partition (500MB ext2) and set up the share folder on the share partition; I left the swap partition (256Mcool smiley alone per this tutorial.

When I insert the usb stick into the pogo plug and power it on:
1) The pogo sits for a few minutes.
2) The light on the front of the pogo lights up with an amber color and just sits.
- I cant ssh, telnet, etc.
- My router does not assign the pogo an IP address.

When I power the pogo on with no usb stick it boots up fine. I can ssh into the device.

When I power the pogo on with a usb stick loaded with debian It works fine. I can ssh into debian.

I noticed that the debian usb drive I am able to boot is formatted with an ext3 partition, would formatting the piratebox partition with an ext3 partition make things work?

The instructions I used to create the debian usb stick are here (I used the debian rootfs provided by varkey):
[forum.doozan.com]

ive tried different usb sticks to see if that was the problem; same issue.
one of the above posts mentioned that gparted may be formatting the partitions incorrectly; has anyone had this same issue? If so what did you use to format the stick to get this to work? (I don't have a partition type just named "swap", is "linux-swap" okay?

Any help on this would be greatly appreciated,
-Robert