Difference between revisions of "Joggler"

From LinuxMCE
Jump to: navigation, search
m (New startOrbiter.sh)
(added startSqueezeSlave.sh)
Line 147: Line 147:
 
If you want to playback audio files on your joggler via Logitech Media Server you can add the squeezeslave package:
 
If you want to playback audio files on your joggler via Logitech Media Server you can add the squeezeslave package:
 
  apt-get install squeezeslave
 
  apt-get install squeezeslave
 +
Create /home/joggler/startSqueezeSlave.sh
 +
#!/bin/bash
 +
 +
. /usr/pluto/bin/Config_Ops.sh 2>/dev/null
 +
. /usr/pluto/bin/SQL_Ops.sh
 +
 +
ConfGet "DCERouter"
 +
MAC=$(ifconfig eth0 | grep "HWaddr" | sed 's/.*HWaddr \([:[:xdigit:]]*\).*$/\1/g')
 +
 +
while [ "1" = "1" ]; do
 +
        /usr/bin/squeezeslave -m $MAC $DCERouter
 +
done
 +
Change mode
 +
chmod 755 /home/joggler/startSqueezeSlave.sh
  
 
==TODO==
 
==TODO==

Revision as of 16:52, 3 February 2013


Transforming O2 Joggler to LinuxMCE orbiter

Creating device in LinuxMCE

Login to your webadmin. Go to "Orbiter" and add a new device of type "Orbiter". Set the Size to "Nokia770". Choose whatever skin and language you like. Quick reload your core and let it create the Orbiter. Anyway; you have a lot of work to do meanwhile :-) Check your new orbiter's device ID. You will need it below during pluto.conf creation.

Installing base system

Download and install SqueezeOS

Get SqueezePlay OS for Joggler. I suggest using the version "for internal memory". You may use the USB version and work on with an external USB stick on your joggler. However i tested this whole process using the joggler's internal flash.

Using linux

Unzip the download (filename may of course change if new version is released):

gunzip sqpos109mmc.img.gz

Plug in a 2GB (min) USB stick. Find the device name of your USB stick:

sudo fdisk -l

Write the image to your USB stick. ATTENTION: ALL FILES ON YOUR USB STICK WILL BE OVERWRITTEN !!!

sudo umount /dev/sdX*
sudo dd if=sqpos109mmc.img of=/dev/sdX bs=1M

Where sdX is your USB device.

Using OSX

Unzip the download (filename may of course change if new version is released):

gunzip sqpos109mmc.img.gz

Open a Terminal window. Plug in a 2GB (min) USB stick. Find the device name of your USB stick:

sudo diskutil list

Write the image to your USB stick. ATTENTION: ALL FILES ON YOUR USB STICK WILL BE OVERWRITTEN !!!

sudo umount -f /dev/diskX*
sudo dd if=sqpos109mmc.img of=/dev/rdiskX bs=1m

Where rdiskX is your USB device.

Flash it to your joggler's internal memory

Power off your joggler. Insert your newly prepared USB stick to your joggler's external USB port. Power on your joggler and let it flash the SqueezeOS to the internal flash memory. Read instructions on screen. When done remove the externel USB stick and let the joggler boot into your newly installed SqueezeOS.

Setup WLAN

If you plan to use WLAN then you better configure it using the SqueezeOS GUI before we disable it in the next steps. Otherwise it will be tricky to set it up later.

Activating SSH server

Once booted into SqueezeOS go to "Settings > Advanced > Additional Features > OpenSSH server" and activate it. Give it some minutes to install and then try to ssh to your joggler:

ssh joggler@<your joggler's ip>

password is: joggler

Transform it to Orbiter

Adapt sources.list

SSH to core, "sudo su" to root and replace /etc/apt/sources.list with following content:

###### Ubuntu Main Repos
deb http://uk.archive.ubuntu.com/ubuntu/ lucid main restricted universe multiverse 
deb-src http://uk.archive.ubuntu.com/ubuntu/ lucid main restricted universe multiverse 

###### Ubuntu Update Repos
deb http://uk.archive.ubuntu.com/ubuntu/ lucid-security main restricted universe multiverse  
deb http://uk.archive.ubuntu.com/ubuntu/ lucid-updates main restricted universe multiverse 
deb http://uk.archive.ubuntu.com/ubuntu/ lucid-backports main restricted universe multiverse  
deb-src http://uk.archive.ubuntu.com/ubuntu/ lucid-security main restricted universe multiverse
deb-src http://uk.archive.ubuntu.com/ubuntu/ lucid-updates main restricted universe multiverse 
deb-src http://uk.archive.ubuntu.com/ubuntu/ lucid-backports main restricted universe multiverse 

###### Ubuntu Partner Repo
deb http://archive.canonical.com/ubuntu lucid partner
deb-src http://archive.canonical.com/ubuntu lucid partner

##### Joggler PPA
deb http://ppa.launchpad.net/jools/joggler/ubuntu lucid main
deb-src http://ppa.launchpad.net/jools/joggler/ubuntu lucid main

##### Intel EMGD binaries PPA
deb http://ppa.launchpad.net/jools/emgd-xorg1.9/ubuntu lucid main
deb-src http://ppa.launchpad.net/jools/emgd-xorg1.9/ubuntu lucid main

#### LinuxMCE repo
deb http://deb.linuxmce.org/ubuntu/ lucid beta2

Update installation to latest packages

apt-get update
apt-get upgrade

Install pre requirements for Orbiter

apt-get install mysql-client libsdl-ttf2.0-0 libsdl-sge libsdl-gfx1.2-4 libsdl-image1.2 libhid0 icewm liblinphone3 libxcursor1 msttcorefonts

Create directory structure

mkdir -p /usr/pluto/bin
mkdir -p /usr/pluto/lib
mkdir -p /usr/pluto/locks
mkdir -p /var/log/pluto

chown -R joggler:joggler /usr/pluto
chown -R joggler:joggler /var/log/pluto

Copy needed files from your core to your joggler

SSH to joggler if not yet done. You don't need to become root.
Copy the Orbiter binary:

cd /usr/pluto/bin
scp root@dcerouter:/usr/pluto/bin/Orbiter .
scp root@dcerouter:/usr/pluto/bin/Config_Ops.sh .
scp root@dcerouter:/usr/pluto/bin/SQL_Ops.sh .
scp root@dcerouter:/usr/pluto/bin/LockUtils.sh .

Copy the needed libraries:

cd /usr/pluto/lib
scp root@dcerouter:/usr/pluto/lib/* .

Note: you may need to change "dcerouter" to your core's full FQDN or to your core's IP address, depending your local environment.

Modify config files

Tell your system where to find LinuxMCE libraries needed by Orbiter:

sudo echo /usr/pluto/lib > /etc/ld.so.conf.d/LinuxMCE.conf

Create /home/joggler/startOrbiter.sh file with following content:

#!/bin/bash

. /usr/pluto/bin/Config_Ops.sh 2>/dev/null
. /usr/pluto/bin/SQL_Ops.sh

ConfGet "MyOrbiterID"
ConfGet "DCERouter"

Q="SELECT IK_DeviceData FROM Device_DeviceData WHERE FK_Device=$MyOrbiterID AND FK_DeviceData=56"
timeOut=$(RunSQL "$Q" | cut -d',' -f2)

export DISPLAY=:0.0
xset dpms $timeOut $timeOut $timeOut

while [ "1" == "1" ] ; do 
	cd /usr/pluto/bin
	/usr/pluto/bin/Orbiter -r $DCERouter  -d $MyOrbiterID
	sleep 15
done

Replace /home/joggler/.xinitrc file with the following content:

export DISPLAY=:0.0
xset +dpms

if [ -f /home/joggler/startSqueezeSlave.sh ]; then
	/home/joggler/startSqueezeSlave.sh&
fi

if [ -f /home/joggler/startOrbiter.sh ]; then
	/home/joggler/startOrbiter.sh
else
	xterm
fi

Create LinuxMCE configuration

"sudo su" to root and create /etc/pluto.conf with the following content:

MySqlHost = 192.168.80.1
MySqlUser = root
MySqlPassword =
MySqlDBName = pluto_main
DCERouter = 192.168.80.1
MySqlPort = 3306
DCERouterPort = 3450
Display = 0
MyOrbiterID = <ID>

Replace <ID> with the device ID of the orbiter you created above.

Optional: Squeezeslave

If you want to playback audio files on your joggler via Logitech Media Server you can add the squeezeslave package:

apt-get install squeezeslave

Create /home/joggler/startSqueezeSlave.sh

#!/bin/bash

. /usr/pluto/bin/Config_Ops.sh 2>/dev/null
. /usr/pluto/bin/SQL_Ops.sh

ConfGet "DCERouter"
MAC=$(ifconfig eth0 | grep "HWaddr" | sed 's/.*HWaddr \([:[:xdigit:]]*\).*$/\1/g')

while [ "1" = "1" ]; do
        /usr/bin/squeezeslave -m $MAC $DCERouter
done

Change mode

chmod 755 /home/joggler/startSqueezeSlave.sh

TODO

On my whishlist:

  • Get mouse cursor hidden. All tries with unclutter or xsetroot to emptycursor failed miserably in the past.
  • Make it possible to switch from Orbiter to SqueezePlay and back
  • Make mediaplay work on joggler via LMCE. At least audio. Video would be a bonus.
  • Make it auto create a new orbiter after first install

Future playground:

  • Play with NFS boot of maybe +/- full MD ?