LibraryBox Basics

To use your LibraryBox, you can power it up by simply plugging it into any USB power source. It will take a minute or so to boot up, and will project a wifi signal called "LibraryBox - Free Content!". If you connect to that SSID, and then launch a browser and try to visit any website, the LibraryBox will show you its webpage via a redirect. You can then chat, download any of the media on the LibraryBox, and view the statistics for your LibraryBox.

If you would like to add your own content to be shared, you can power down your LibraryBox, remove the USB drive, and insert it into any computer. The content to be shared is in the folder /LibraryBox/Shared, and you can see that there are folders for a variety of types of media. You can add media you'd like to share to those folders, or just directly in the /Shared folder where it will be available if someone clicks "all content" in the menu of the Librarybox page.

The v2.0 code adds a ton of features to LibraryBox, one of which is statistics. If you'd like to rest the statistics on your LibraryBox, follow these directions:

  1. Power down your LibraryBox and plug the USB drive from it into any computer
  2. In the LibraryBox folder on the USB drive there are two files:
  3. dl_statistics.sqlite 
    vc_statistics.sqlite
  4. Simply delete these files, and your stats will be reset, new files will be created when you reboot!

Next Steps

While your LibraryBox will work fine without setting a password, I highly recommend that you go through the next setup in order to secure your LibraryBox against unauthorized changes by users.

As shipped, your LibraryBox doesn't have a password to protect it from someone who knows the IP address (which is anyone that connects to it) from simply logging in and changing things. In order to secure your LibraryBox, you need to set a password.

  1. Plug your LibraryBox into power and let it boot up.
  2. Connect to the LibraryBox SSID with your computer, and telnet into it:

  3. telnet 192.168.1.1
    
  4. Run the LibraryBox advance setup script by typing:
    box_init_setup.sh
    
    Then hit Enter. That will launch a script that has many Advanced options listed.
  5. Choose 1 for Setting Password and Enable SSH.
  6. Choose a strong password and enter it.
  7. You've now got a secure LibraryBox!
  8. At any point after you set the password, if you would like to login to your LibraryBox via the command line, you will log into the LibraryBox via SSH like this:
    ssh root@192.168.1.1
    

FTP Setup

Setting up your LibraryBox for FTP will allow you to upload, download, and delete files from the "Shared" directory from a computer connected to the wifi signal, without having to physically interact with the LibraryBox or the USB drive. Once you have it setup, you will be able to use any FTP software to login and change the Shared files. Follow the steps below to enable FTP access on your LibraryBox.

  1. Connect to the LibraryBox SSID with your computer, and SSH into it:

  2. ssh root@192.168.1.1
    
  3. Run the LibraryBox advance setup script:
    box_init_setup.sh
    
    which will give you the following menu:
     
    1 - Setting password and enable SSH
    2 - Set date & time (enable timesave)
    3 - Start FTP configuration 
    
    This time, we are looking for option 3 on that menu, Start FTP Configuration.

  4. Selecting 3 will give you one more menu, this one a bit more complicated. First, I'll walk you through setting up just FTP access, and then below we'll worry about Sync and other options. The second menu looks like this:
     Choose an option: 3
    ------------------------------------------------------
       Current configuration:
    ------------------------------------------------------
       FTP enabled                : yes 
       Admin access               : yes 
       Special SYNC access        : yes 
       SYNC Port                  : 54321 
       Anonymous login possible   : no 
     -- 
       FTP Synchronisation active : no 
       FTP Sync hostname          : empty 
       FTP Sync password          : empty 
     
    ------------------------------------------------------
      1 -  Enable / Disable FTP 
      2 -  Enable / Disable Admin Access 
      3 -  Enable / Disable Sync Master 
      4 -  Enable / Disable Anonymous Access 
      5 -  Set password for Sync Master 
      6 -  Set password for Admin Access 
     
      7 -  Enable Sync Client 
      8 -     Client host  
      9 -     Client password  
     
     Enter h and a number for help about the topic. For example, h8 for Client host help
     Every other button is a clean exit. 

    The list above the selections show you the current status of the settings, and choosing any selection will cause the menu to re-draw to show you the new current settings. They are not applied, however, until you exit the menu and reboot your LibraryBox.
  5. To enable FTP, choose Option 1.
  6. You must also set a password for your FTP access, done by selecting Option 6 - Set password for Admin Access. Choose a secure password for your FTP access!
  7. After you have set the password, exit the menu by pressing any key. Then, reboot your LibraryBox by unplugging and plugging it back in.
  8. At this point, you should be able to connect to the LibraryBox SSID, and use any popular FTP program to connect using your password and the username "nobody".

Sync Setup

A brief word about Mesh/Sync: due to technical limitations and an effort to ensure good user experience in regards to battery life, we've implemented this first Sync protocol to be Master/Client oriented rather that true peer-to-peer mesh. We are going to continue to look at more robust sync services for LibraryBox, but for this release, the Sync works like this:

You will designate one LibraryBox to be the Master box, and any number you wish as the Clients. The Client Boxen will search for a Master every 7 minutes, just looking to see if there is one in range. If a Client sees a Master that has the appropriate login credentials, it will start a comparison and sync with the Master in question. The Client will mirror the Master in content, both in deletions and additions. In order to automagically change the Shared folder on remote LibraryBoxen, you can set up a single Master that stays with you, and you can wander into range of your installed LibraryBoxen, hang out for a few minutes, and move on.

To set up Sync, follow these direction:

  1. Connect to the LibraryBox SSID with your computer, and SSH into it:

  2. ssh root@192.168.1.1
    
  3. Run the LibraryBox advanced setup script:
    box_init_setup.sh
    
    which will give you the following menu:
     
    1 - Setting password and enable SSH
    2 - Set date & time (enable timesave)
    3 - Start FTP configuration 
    
    Choose option 3 on that menu, Start FTP Configuration.

  4. Selecting 3 will give you one more menu, this one a bit more complicated.
     Choose an option: 3
    ------------------------------------------------------
       Current configuration:
    ------------------------------------------------------
       FTP enabled                : yes 
       Admin access               : yes 
       Special SYNC access        : yes 
       SYNC Port                  : 54321 
       Anonymous login possible   : no 
     -- 
       FTP Synchronisation active : no 
       FTP Sync hostname          : empty 
       FTP Sync password          : empty 
     
    ------------------------------------------------------
      1 -  Enable / Disable FTP 
      2 -  Enable / Disable Admin Access 
      3 -  Enable / Disable Sync Master 
      4 -  Enable / Disable Anonymous Access 
      5 -  Set password for Sync Master 
      6 -  Set password for Admin Access 
     
      7 -  Enable Sync Client 
      8 -     Client host  
      9 -     Client password  
     
     Enter h and a number for help about the topic. For example, h8 for Client host help
     Every other button is a clean exit. 

    The list above the selections show you the current status of the settings, and choosing any selection will cause the menu to re-draw to show you the new current settings. They are not applied, however, until you exit the menu and reboot your LibraryBox.

Set Up a Master LibraryBox

  1. Disable FTP
  2. Set Password for Sync Master
  3. Enable Sync Master
  4. Exit the menu by choosing any other key.
  5. Run the command:
    /etc/init.d/mesh enable
    
  6. Run the command:
    /etc/init.d/piratebox avahi
    
  7. Reboot your LibraryBox, and now you have a Master, ready for connections to Client Boxen.

Set Up a Client LibraryBox

  1. Disable FTP
  2. Enable Sync Client
  3. Under "Client Host" you will need the full hostname of the Master that you wish to sync to.
  4. Client Password - you want to enter the Password you set for the Master here. The Client will use the Hostname and this Password to log in to the Master to begin the sync
  5. Exit the menu by choosing any other key.
  6. Run the command:
    /etc/init.d/mesh enable
    
  7. Run the command:
    /etc/init.d/piratebox avahi
    
  8. Reboot your LibraryBox, and now you have a Client, ready for connections to its corresponding Master LibraryBox.

Config Options

On the USB drive under the LibraryBox folder, there is a folder named "Config" that is full of text files. This includes:

  • channel.txt
  • hostname.txt
  • librarybox_ftp.txt
  • librarybox_ftpadmin.txt
  • librarybox_ftpanon.txt
  • librarybox_ftpsync.txt
  • librarybox_ftpsyncport.txt
  • librarybox_shoutbox.txt
  • ssid.txt
  • system_hostname.txt
  • txpower.txt

Some of these are controlled by the menus mentioned above in the FTP setup, but several of them allow you to customize your LibraryBox. You can change the value of:

  • channel.txt to reflect the wifi channel that you want the LibraryBox to use
  • system_hostname.txt if you'd like a custom hostname when setting up Sync Clients
  • ssid.txt if you want to have a custom wifi ssid to be broadcast
  • txpower.txt if you'd like to make your LibraryBox have just a bit more (or a bit less) oomph when it comes to wifi coverage. The default is 25, but ranges between 20-30 should be safe (although raising the TX power will result in significantly higher power consumption and heat generation by the MR3020.
  • If you make any changes to these files, they will take effect the next time you boot your LibraryBox. I would recommend NOT changing the various FTP settings in this way, stick to the config files mentioned above.

Upgrading your LibraryBox software


Have a problem along the way?

Website Content - Creative Commons Licensed NC-BY Jason Griffey 2012, where not otherwise licensed.
Software Licensed under GPLv2, see http://www.gnu.org/licenses/gpl-2.0.html Back to Top