Menu

Home

Pokey

NabaztagLives has been tested on the Raspberry Pi "Wheezy" (NOOBS) distribution, the Jessie distribution, and has the following dependencies:

  • Apache
  • PHP
  • MySQL
  • Lame
  • Mp3Wrap

The first release used the following versions:

  • Apache/2.2.22 (Debian)
  • PHP 5.4.4-14+deb7u3 (cli) (built: Jul 18 2013 01:01:56)
  • mysql Ver 14.14 Distrib 5.5.31, for debian-linux-gnu (armv7l)
  • LAME 32bits version 3.99.5 (http://lame.sf.net)
  • Mp3Wrap Version 0.5 (2003/Jan/16)

Installation

The easiest way to install NabaztagLives on your Raspberry Pi is to use the installer from a Terminal window:

git clone git://git.code.sf.net/p/nabaztaglives/code NabaztagLives
cd NabaztagLives/install
sudo ./install.sh

Updating

If you want to update your installation to the latest version, you can use the -nodb switch to preserve your rabbit's settings:

sudo rm -R NabaztagLives
git clone git://git.code.sf.net/p/nabaztaglives/code NabaztagLives
cd NabaztagLives/install
sudo ./install.sh -nodb

Below are legacy instructions.

You can install them on your Raspberry Pi by running the commands below. When you install MySql, it will prompt you for a root password. You'll need that to setup the database.

sudo apt-get update
sudo apt-get upgrade

sudo apt-get install apache2 php5 php5-curl libapache2-mod-php5

sudo apt-get install mysql-server mysql-client php5-mysql

sudo apt-get install lame

sudo apt-get install mp3wrap

When you install Apache, it may kick out an error that says Could not reliably determine the server's fully qualified domain name. You can fix this by setting the server's name to localhost:

sudo vi /etc/apache2/apache2.conf

Scroll to the end of the file and insert:

ServerName localhost

If you have a V1 rabbit, you'll need to set the override. For Pi 3, see note below.

sudo vi /etc/apache2/sites-enabled/000-default

Change the AllowOverride to All so it looks like this:

<Directory /var/www/>            
    Options -Indexes FollowSymLinks MultiViews            
    AllowOverride All            
    Order allow,deny            
    allow from all   
</Directory>

On Raspberry Pi3, and quite possibly the newer distros for Pi2, the apache config has changed:

sudo vi /etc/apache2/sites-enabled/000-default.conf

Change the AllowOverride to All so it looks like this:

<Directory /var/www/>            
    Options -Indexes +FollowSymLinks +MultiViews            
    AllowOverride All            
    Order allow,deny            
    allow from all   
</Directory>

Save the file and exit.

Then do:

sudo apachectl restart

Installing the application

The easiest way to get setup is to use git to get the latest code:

git clone git://git.code.sf.net/p/nabaztaglives/code NabaztagLives

This will create a folder named NabaztagLives on your Pi. Navigate to that folder:

cd NabaztagLives

The solution is designed to run from a dedicated Pi and is installed to the root folder of the website. If you install it to another location, the relative paths will be broken and it will not work. Copy the contents of the www directory to the root of your Pi's web server which is /var/www. Note the instructions below were made before the apache www dir was moved to /var/www/html in more recent releases of Debian which is what Raspbian is based on, so you'll want to verify first that you have a /var/www/html on your Pi, and if so copy the www content there. If you just have /var/www then you can run the command below:

sudo cp -R www /var

Otherwise:

cd www
sudo cp -R * /var/www/html

Next open the db folder on your Pi and build the database. Enter your MySql root password when prompted:

cd db

sudo ./db_setup.sh

Next we need to move the db info file to the right place. This is also where the logging occurs. Go back up one folder to the root folder where you placed the code (where etc exists) and execute the following:

cd ..
sudo cp -R ./etc /var

Next we need to set some ownership properties or our rabbit will be very quiet:

sudo chown www-data:www-data /var/www/vl/hutch

Or depending on distro:

sudo chown www-data:www-data /var/www/html/vl/hutch

sudo chown www-data:www-data /var/etc

Now we need to remove the default "It Works!" index page from apache:

sudo rm /var/www/index.html

Or depending on distro:

sudo rm /var/www/html/index.html

Almost done! Get your IP address:

ifconfig | grep addr

You should get an IP that starts with 192. Open a browser and browse to that address. If you are on your Pi you can also type in localhost for the address. The site should be displayed. If you didn't get an IP that means your wifi is hosed and I don't know how you got this far. If you just see a folder called www then you need to set your AllowOverride (see above).

For later distros, we need to fix the now broken relative paths (until future code update):

cd /var/www/html

sudo find . -name '*.php' -type f -exec sed -i 's/..\/etc\//\/var\/etc\//g' {} +

sudo find . -name '*.php' -type f -exec sed -i 's/..\/\/var\/etc/\/var\/etc/g' {} +

Next update the locator records

If you see this on the home page then you need to change the IP addresses in /var/www/locate.jsp or /var/www/html/locate.jsp (depending on the distro) to your server's IP address (the one displayed at the bottom of the page).

You're finished! All you need to do now is setup your rabbit. If you need help with that, click on the Setup Info button on the NabaztagLives website that's now running on your Pi. When you're done, be sure and click the "Update Rabbit" button to see all the features.

My rabbit doesn't work

That's what I said! Check the error log, there's a button for it on the site. Click "reset" to reset it. Make sure you have setup your rabbit to do things! Set the idle behavior to PacMan Lights so you don't have to wait to see if it works.

Another good thing to check is the PHP log:

 cat /var/log/apache2/error.log

You can always post to the forum at https://sourceforge.net/p/nabaztaglives/discussion/brokenrabbit/.

New to Raspberry?

If you are setting up your Raspberry Pi for the first time, you can get instructions from http://www.raspberrypi.org/wp-content/uploads/2012/04/quick-start-guide-v2_1.pdf.

I used the NOOBS image and deleted all but the "Wheezy" files before copying it to the SD card. That saves room and speeds the installation assuming you don't intend to run the other distros.

I recommend a 4 GB class 10 SD card from a name brand like Sandisk. The Model B has a 25 MB/s max write speed so you want something that can write that fast. Always check to see if your equipment is supported by checking to see if it works first by going to http://elinux.org/RPi_VerifiedPeripherals.

Just remember that if you want to make a backup of the SD card, you will need whatever size card you have available on your machine. So if you have a 16 GB card, you will need 16 GB free space on your drive. NabaztagLives consumes less than 100 MB.

Start the X11 UI

startx

Set the locale and straighten out the keyboard

sudo raspi-config

List all USB devices

lsusb

Setup hidden wifi

wpa_passphrase Your-Wifi-SSID Your-Password
sudo vi /etc/network/interfaces

Make it look like this:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
   wpa-scan-ssid 1
   wpa-ap-scan 1
   wpa-key-mgmt WPA-PSK
   wpa-proto RSN WPA
   wpa-pairwise CCMP TKIP
   wpa-group CCMP TKIP
   wpa-ssid "Your Wifi SSID"
   wpa-psk Your-PSK-Value-that-you-got-from-running-wpa_passphrase

iface default inet dhcp

Time is wrong

sudo dpkg-reconfigure tzdata

Reboot

sudo reboot

Shutdown

sudo shutdown -h now

Set automatic login

sudo vi /etc/inittab

Find the following line:

1:2345:respawn:/sbin/getty 115200 tty1

And change to:

1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1

Get current temperature

vcgencmd measure_temp

Open MySql

mysql rabbit -u root -p