TonidoPlug running Squeezecenter 

One of the best gadgets I bought recently is a TonidoPlug, the TonidoPlug is based upon the well known SheevaPlug. The SheevaPlug is a 1000 MHz Marvell CPU combined with 512 MB flash, and 512 MB internal RAM. At the size of roughly two cigarette boxes it makes it an ideal home server using just 5 watt. These great hardware specs are combined with a great software package running on top of it. The package is based on Ubuntu 9.04 and lets you choose to use a variety of services (Torrent Client, Photo Gallery, Jukebox, WebsharePro (remote access to your files), Workspace, Thots, Search, Backup and Explorer). It’s really easy to setup and you can easily expand its capabilities.

Being a music lover I use Squeezecenter (also known as Squeezebox Server) for listening to my mp3 collection or internet radio. Before I bought the TonidoPlug, I used an old pc as a Squeezecenter server. The old server was using 300 Watt, made a lot of noise and was never up and runinng when I wanted to listen to my music. It resulted me ending up waiting 5 minutes each time while starting up the old cow. Now things have changed after reading several articles I managed to install Squeezecenter server on my TonidoPlug. In this article I’ll try to walk you through.

Prerequisites (what you need to get it working):

When you first receive you TonidoPlug, read the manual and configure the TonidoPlug as described (which means you need to create an account, change your basic admin password (nosoup4u)). Make sure your TonidoPlug is working properly, logon to it and update if necesarry.

The next thing you need to do is Repartition and Format your External USB drive (or don’t)

1 – Swap partition (1 GB)
2 – EXT3 filesystem (8 GB and make sure it’s flagged bootable)
3 – NTFS data (mp3) storage (rest)

Now you’ve repartitioned and formatted your External USB drive you can hook it up to your TonidoPlug.

Start up Putty and connect to your TonidoPlug.

mount /dev/sda1 /media/usb0

 

Download the root and modules tar ball from TonidoPlug site and place in the newly created partition:

cd /media/usb0
wget http://www.tonido.com/downloads/plug/rootfs.tar.gz
wget http://www.tonido.com/downloads/plug/modules.tar.gz

 

Untar the downloaded tar file onto the ext3 partition:

tar zxvf rootfs.tar.gz
tar zxvf modules.tar.gz

 

Now stop tonido and copy the tonido directory from your existing internal flash disk:

initctl emit tstop
cp -dpr /root/app/ /media/usb0/root/

 

Now everything is ready. You can unmount the drive and reboot the plug. Leave the USB harddisk on the plug itself. When the plug reboots, it should reboot off the USB drive:

cd /root
umount /media/usb0
reboot

 

You can ensure that the plug has booted on the external HDD by using the following command:

df -h /

Filesystem                            Size  Used Avail Use%
Mounted on rootfs                8G  669M  2.9G  10% /

You can see that we have booted the plug of the 8GB External USB drive. If you see 512MB then probably you are still booting of the internal flash.

 

The DHCP client is configured to ignore any DNS servers returned by the DHCP server and use 127.0.0.1 instead, while there is no local DNS server. Consequently, you won’t be able to connect to any hosts by name until you fix this. In order to fix it:

Edit /etc/dhcp3/dhclient.conf and comment out or delete the line “supersede domain-name-servers 127.0.0.1;”.

Run “dhclient eth0”:

dhclient eth0

 

Try “ping kernel.org” – it should work:

ping.kernel.org

 

The directory /var/cache/apt/archives/partial which the APT package management system uses lives on a RAM disk, so it gets wiped on every boot. Marvell helpfully included a boot script to recreate the directory, but they not so helpfully failed to make the boot script actually work. Additionally, /tmp and /var/tmp have invalid permissions. To fix these problems: Edit /etc/rc.local. The two insmod commands fail, and because the shell is invoked with the -e flag (see first line of the file), a failing command causes the whole script to exit. Delete or comment out all lines except “mkdir -p /var/cache/apt/archives/partial” and add “chmod 1777 /tmp /var/tmp” before the mkdir. You might also want to add, after the mkdir, a line “/usr/sbin/ntpdate-debian” to automatically sync your clock over the network.

After editing, run “/etc/rc.local” from the command line:

/etc/rc.local

 

The TimeZone is not set.
To fix it, just execute the following command as root and select the appropriate timezone for you:

dpkg-reconfigure tzdata

 

Update your OS:

apt-get update
apt-get dist-upgrade
apt-get autoremove

 

Now check your partitions by typing:

fdisk -l

 

initialize the swap:

mkswap /dev/sda3

 

enable swap:

swapon /dev/sda3

 

If you’ve done everything correctly, swap will be working. You can check by:

cat /proc/meminfo

 

The next thing to do is to put the swap information in /etc/fstab so that it will enable the swap at boot. Edit /etc/fstab and add the line:

/dev/sda3      none  swap  sw  0  0

 

Next we’ll install Squeezecenter server:

wget http://downloads.slimdevices.com/SqueezeboxServer_v7.5.1/squeezeboxserver_7.5.1_all.deb
dpkg -i squeezeboxserver_7.5.1_all.deb apt-get -f install

 

Suggestions for improving this article are welcome, please let me know and drop me a line !

Installing Squeezelite player on a Raspberry Pi

After running Squeezelite for some time, I thought it was time to update my Raspberry Pi to Jessie and start with a clean installation. So I downloaded the Jessie Lite image from the Raspberry Pi project site into my Downloads folder on my Ubuntu machine.

Time to open up a Terminal window and get to work…

In short we will do the following:

  • Write Raspbian image to SD card
  • Logon to the Raspbian Operating System
  • Setup a Wireless connection to your AccessPoint
  • Finalize the Raspberry Configuration
  • Install rpi-update and update the Raspberry Pi firmware
  • Install the Squeezelite player
  • Edit the Squeezelite config file to prevent crackles from sound
  • Adjust the sound volume of your Raspberry Pi

 

Write raspbian image to SD card
There is an excellent description on how to install Raspbian, have a look here. I used gparted to remove the old partitions from my SD card. After that I was ready to install a fresh copy Raspbian Jessie Lite.

cd Downloads/Raspbian
dd bs=4M if=./2016-05-27-raspbian-jessie.img of=/dev/sde

 

When ready you can connect the Raspberry Pi with the UTP cable to your network and power it up. I used Zenmap to figure out the IP -address of the Raspberry Pi.

Logon to the Rasbian Operating System
$ ssh pi@ip-address
password: raspberry

Setup Wireless a connection to your AccessPoint
I’ve been using the TL-WN725N Wireless-N USB adapter from TP-LINK on all my Raspberry Pi projects. If you want to use WiFi, you need to configure your WPA settings (assuming you use WPA2 on your Access Point).

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

add following lines:

network={
ssid=”The_ESSID_from_your_AccesPoint”
psk=”Your_WiFi_password”
}

 

Finalize the Raspberry Configuration
By using the raspi-config script it is easy to configure several things on your Raspberry Pi without digging too much into the OS.

sudo raspi-config

– expand filesystem
– change hostname
– change password

 

You need to reboot the Raspberry Pi to complete the configuration. You can now disconnect the your Pi from the UTP cable. It’s quite likely that your IP address changed during the reboot, so you might need to figure out the new IP address (see above). Logon to the Raspberry Pi again using ssh (also, see above).

 

Install rpi-update and update the Raspberry Pi firmware
You might want to update the Raspberry Pi firmware, to be able to do that you need to install rpi-update.

sudo apt-get install rpi-update
sudo rpi-update

 

Install Squeezelite player
Next thing up, is installing the Squeezelite player and some extra codecs…

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install squeezelite
sudo apt-get install libflac-dev

 

Edit the squeezelite config file to prevent crackles from sound
The Raspberry Pi is not the fastest computer around, so you need to help it a bit. You can help your Pi by increasing the ALSA buffer size.

sudo nano /etc/default/squeezelite

Edit following line:

# SB_EXTRA_ARGS=””

and change it into (be aware of losing the hashtag!):

SB_EXTRA_ARGS=”-a 180″

 

Adjust the sound volume of your Raspberry Pi
Make sure you have the right audio volume level on your Raspberry Pi. Ensure that the playback level has zero gain => PCM [db gain: 0.00]. Tweak the gain-level by using the arrow keys up and down, in the end you will reach the zero db gain 🙂

alsamixer

 

You can now reboot your Raspberry Pi and enjoy your music!

 

Suggestions for improving this article are welcome, please let me know and drop me a line .

Upgrading your SqueezeCenter server on Ubuntu

In a previous article I tried to explain the installation of the Squeezebox Server on the Tonido Plug. In this article I’ll try to explain how to perform an upgrade of your existing Squeezecenter Server on Tonido (or Ubuntu as the Tonido Plug is based on Ubuntu 9.04).

What you’re going to do is actually remove the old installation of the Squuezecenter server and install a new copy of the Squuezecenter server.

Prerequisites (what you need to get it working):

  • Hardware
    • Computer
    • TonidoPlug (optionally)
    • Internet connection
  • Software
    • Windows users might need Putty

 

The first thing you need to do is remove the ‘old’ installation of the Squuezecenter server, by SSH-ing (Windows user might want to use Putty) the following command:

apt-get purge –yes squeezeboxserver

 

Next thing is cleaning up your Ubuntu installation by entering:

apt-get autoclean

 

You might want to update your Ubuntu installation by using the following commands:

apt-get update
apt-get upgrade

Now you are ready to install the latest version of Squuezecenter server (Check the Squeezebox server version and location, by locating the latest version using your internet browser).

wget http://downloads.slimdevices.com/SqueezeboxServer_v7.5.3/squeezeboxserver_7.5.3_all.deb
dpkg -i squeezeboxserver_7.5.3_all.deb
apt-get -f install

 

Now your Squeezebox Server should be upgraded, you can check it by locating it in your internet browser
http://YourSqueezeboxServerName:9000/
or
http://YourSqueezeboxServerIpAddress:9000/

 

If needed you can manually stop or start your Squeezebox Server

/etc/init.d/squeezeboxserver stop
/etc/init.d/squeezeboxserver start

 

Suggestions for improving this article are welcome, please let me know and drop me a line !

How to install SoftSqueeze on Ubuntu

Softsqueeze is a software music player developed in Java (allowing it to work on most operating systems) that works with the Squeezebox Server software. Softsqueeze emulates most of the Boom, Duet, Transporter, Squeezebox and Slimp3 hardware music players. It uses a TCP based protocol, allowing it to use across the Internet and through firewalls/NAT routers using ssh tunneling. The software music player supports synchronization with hardware players.

Prerequisites (what you need to get it working):

  • Hardware
    • Computer running Ubuntu
    • SqueezeCenter Server
    • Network connection
  • Software
    • SoftSqueeze

 

Let’s get started:

Download the java version of SoftSqueeze (the .zip file) from your favourite browser.

Create a folder called SoftSqueeze in your home folder by opening a terminal window (Applications \ Accessories \ Terminal).

mkdir SoftSqueeze
cd SoftSqueeze

 

Now unzip the zip file:

unzip ~/Downloads/softsqueeze_3.8.zip

 

Make the JAR file executable:

sudo chmod +x SoftSqueeze.jar

 

Install Sun Java 6 Runtime:

sudo add-apt-repository “deb http://archive.canonical.com/ lucid partner”
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-fonts

 

Make JAR file open with Java:

java -jar ~/SoftSqueeze/SoftSqueeze.jar

 

The only thing left to do in Softsqueeze is to point it to the SqueezeCenter Server and redirect the audio output to “Java Sound Audio Engine”.

 

Suggestions for improving this article are welcome, please let me know and drop me a line.

Updating Squeezelite on your Raspberry Pi

After running Squeezelite on my Raspberry Pi for a while, I thought it would be time to update Squeezelite to it’s latest version. And this is how I did it…

First you’ll have to login to your Raspberry Pi, you might want to open a terminal and use SSH…

If you don’t have a squeezelite folder, then create one! You can do this by using mkdir in your terminal:

mkdir squeezelite

 

Now go to your squeezelite folder:

cd squeezelite

 

Remove an older version, if it’s there:

rm ./squeezelite-armv6hf

 

Next download the latest version:

wget http://squeezelite-downloads.googlecode.com/git/squeezelite-armv6hf

 

Remove the old version:

sudo rm /usr/bin/squeezelite-armv6hf

 

Copy the latest version to the folder /usr/bin:

sudo cp squeezelite-armv6hf /usr/bin

 

Setting the permissions right:

sudo chmod a+x /usr/bin/squeezelite-armv6hf

 

Reboot If you want, else stop start the service:

sudo shutdown -r now

 

Now you are ready to rock and roll (again) !!!

 

Suggestions for improving this article are welcome, please let me know and drop me a line .