Freeze the Cold Callers with IceBl0ck

Buying a 32GB SD card with IceBl0ck configured from our ebay listings is the easiest way to get up and running but if you want to use your own Pi then below are the instructions to install and configure all the different packages required by IceBl0ck...

Pi packages may change at any time, therefore some minor differences to the following steps may be required.

Plug in your Bluetooth and WiFI (or network cable) USB dongles if using Android App or Bluetooth speakers 

Login to your raspberry Pi (e.g.):

Username :pi
Password: raspberry

Start the desktop using the command:

$ startx

If your using WiFi then select Menu->WiFI->scan->double click netword ssid->enter password->Add and configure your WiFi dongle
Run the Terminal by clicking on the screen icon
type the following commands:

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install git-core
$ git clone git://git.drogon.net/wiringPi
$ cd wiringPi
$ ./build

Install Text To Speech: 

$ sudo apt-get install mplayer
$ sudo mkdir /etc/mplayer
$ sudo nano /etc/mplayer/mplayer.conf


-- add this line and save the file: 
nolirc=yes

-- uncomment source line at end of file
$ sudo nano /etc/apt/sources.list


-- install pico2wave:
$ sudo apt-get install fakeroot debhelper automake autoconf libtool help2man libpopt-dev hardening-wrapper
$ sudo apt-get build-dep libttspico-utils
$ cd
$ mkdir pico_build/
$cd pico_build
$ sudo apt-get source libttspico-utils
$ cd svox-1.0-<your version>
$ dpkg-buildpackage -rfakeroot -us -uc
-- this may take about 20 minutes

$ cd
$ cd pico_build
$ls

-- You should see the following packages: libttspico0....deb, libttspico-data....all.deb, libttspico-utils.....deb
--Install in THIS ORDER the three packages:
$ sudo dpkg -i libttspico-data_1.0+git20110131-2_all.deb
$ sudo dpkg -i libttspico0_1.0+git20110131-2_armhf.deb
$ sudo dpkg -i libttspico-utils_1.0+git20110131-2_armhf.deb

-- setting the volume to 100%:
$ amixer cset numid=1 -- 100%

If the date is wrong and IceBl0ck will always be connected to the internet then edit this config file:

$ sudo nano /etc/ntp.conf

-- comment out these lines if they are present:
server 0.debian.pool.ntp.org iburst
server 1.debian.pool.ntp.org iburst
server 2.debian.pool.ntp.org iburst
server 3.debian.pool.ntp.org iburst

-- and add these and save the file:
server 0.uk.pool.ntp.org
server 1.uk.pool.ntp.org
server 2.uk.pool.ntp.org
server 3.uk.pool.ntp.org

-- set the time manually to the correct date and the approximate time:
$ sudo date -s "13 APR 2015 14:48:00"
-- then restart ntpd:
$ sudo /etc/init.d/ntp restart

install RDP so you can use remote desktop to login to IceBl0ck (optional):

$ sudo apt-get install xrdp 
The RDP guide is here:
http://www.raspberrypiblog.com/2012/10/how-to-setup-remote-desktop-from.html

install espeak which has more user configurable features than pico2wave for TTS:

$ sudo apt-get install espeak

install the Apache web server (optional):

$ sudo apt-get install apache2 -y
-- test it, in a web browser by typing:
http://localhost
or on another computer use Pi IP address (hostname -I).

install php (optional):

$ sudo apt-get install php5 libapache2-mod-php5 -y
-- the root of web server is in /var/www, index.html is the default page loaded

Install the bluez Bluetooth stack so IceBl0ck can talk to a bluetooth speaker:

$ sudo apt-get install bluetooth bluez-utils blueman
$ sudo apt-get install bluez pulseaudio-module-bluetooth python-gobject python-gobject-2
$ sudo usermod -a -G lp pi
$ sudo nano /etc/bluetooth/audio.conf
-- Type this in the General section, then save the file:
Enable=Source,Sink,Media,Socket
Master=true
SCORouting=PCM

-- this shouldn't be needed, didn't use pulse-audi (I dont think):

$ sudo nano /etc/pulse/daemon.conf

-- add the following line after commented example:

resample-method = trivial

Then reboot your pi:

$ sudo reboot

For the first time connecting to a Bluetooth speaker you must pair and trust it so IceBl0ck can automatically connect. E.g. On a Sony SRS-1 portable Bluetooth speaker, keep power button pressed for a few seconds to put it into discovery mode.
In the pi desktop, use bluetooth manager->devices to search for Speaker then add and trust it.

Edit the /etc/asound.conf file, enter the following lines and then save the file:

pcm.bluetooth {
type bluetooth
device 8C:DE:52:A2:1C:ED
profile auto
}

ctl.bluetooth {
type bluetooth
}

To play a .wav file (try a 22050Hz, pcm 16bit Low Endien):

$ aplay -Dplug:bluetooth testespeak.wav

To automatically load IceBl0ck when the pi boots:

$ sudo nano /etc/rc.local

-- add the following line before the 'exit 0'
(sleep 1; su - pi -c "/usr/bin/sudo /home/pi/Projects/BTBlocker/src/ccc 2>/home/
pi/Projects/BTBlocker/src/error.log >/home/pi/Projects/BTBlocker/src/stdout.log"
) &

To install the pi's hardware random number generator (RNG) device:

$ sudo modprobe bcm2708-rng
$ sudo nano /etc/modules
-- add the following line then save the file:
bcm2708-rng

-- At the command line, install the RNG tools:

$ sudo apt-get install rng-tools

/dev/hwrng should be available, check it by typing:

$ ls /dev/hwrng

To install the ftp server:

$ sudo apt-get update
$ sudo apt-get install vsftpd
$ sudo nano /etc/vsftpd.conf
; enabled local user and added local_root=/home/pi/Projects/src
; Allowed anonymous and local write access, allowed change of owner to pi user
$ sudo service vsftpd restart