Difference between revisions of "Joggler"

From LinuxMCE
Jump to: navigation, search
(Added squeezeslave)
(Create directory structure)
 
(33 intermediate revisions by 4 users not shown)
Line 2: Line 2:
  
 
=Transforming O2 Joggler to LinuxMCE orbiter=
 
=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==
 
==Installing base system==
 
===Download and install SqueezeOS===
 
===Download and install SqueezeOS===
Get [http://birdslikewires.co.uk/articles/squeezeplay-os 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.
+
Get [http://birdslikewires.co.uk/articles/squeezeplay-os SqueezePlay OS]  for Joggler. You can use either the internal or an external usb stick, however to install additional options you may require running on an external USB stick to have the space.
 
====Using linux====
 
====Using linux====
 
Unzip the download (filename may of course change if new version is released):
 
Unzip the download (filename may of course change if new version is released):
  gunzip sqpos109mmc.img.gz
+
  gunzip sqpos303_ext.img.gz
 
Plug in a 2GB (min) USB stick. Find the device name of your USB stick:
 
Plug in a 2GB (min) USB stick. Find the device name of your USB stick:
 
  sudo fdisk -l
 
  sudo fdisk -l
 
Write the image to your USB stick. '''ATTENTION: ALL FILES ON YOUR USB STICK WILL BE OVERWRITTEN !!!'''
 
Write the image to your USB stick. '''ATTENTION: ALL FILES ON YOUR USB STICK WILL BE OVERWRITTEN !!!'''
 
  sudo umount /dev/sdX*
 
  sudo umount /dev/sdX*
  sudo dd if=sqpos109mmc.img of=/dev/sdX bs=1M
+
  sudo dd if=sqpos303_ext.img of=/dev/sdX bs=1M
 
Where sdX is your USB device.
 
Where sdX is your USB device.
 
====Using OSX====
 
====Using OSX====
 
Unzip the download (filename may of course change if new version is released):
 
Unzip the download (filename may of course change if new version is released):
  gunzip sqpos109mmc.img.gz
+
  gunzip sqpos303_ext.img.gz
 
Open a Terminal window. Plug in a 2GB (min) USB stick. Find the device name of your USB stick:
 
Open a Terminal window. Plug in a 2GB (min) USB stick. Find the device name of your USB stick:
 
  sudo diskutil list
 
  sudo diskutil list
 
Write the image to your USB stick. '''ATTENTION: ALL FILES ON YOUR USB STICK WILL BE OVERWRITTEN !!!'''
 
Write the image to your USB stick. '''ATTENTION: ALL FILES ON YOUR USB STICK WILL BE OVERWRITTEN !!!'''
 
  sudo umount -f /dev/diskX*
 
  sudo umount -f /dev/diskX*
  sudo dd if=sqpos109mmc.img of=/dev/rdiskX bs=1m
+
  sudo dd if=sqpos303_ext.img of=/dev/rdiskX bs=1m
 
Where rdiskX is your USB device.
 
Where rdiskX is your USB device.
===Flash it to your joggler's internal memory===
+
===Booting/Flashing===
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.
+
Power off your joggler. Insert your newly prepared USB stick to your joggler's external USB port. Depending on the method you choose this will either boot into the SqueezeOS or it will flash the OS to the internal flash memory. If you're flashing the internal memory then read the instructions on screen. When done remove the externel USB stick and let the joggler boot into your newly installed SqueezeOS.
Read instructions on screen. When done remove the externel USB stick and let the joggler boot into your newly installed SqueezeOS.
+
 
===Setup WLAN===
 
===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.
 
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===
+
===SSH===
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>
 
  ssh joggler@<your joggler's ip>
 
password is: joggler
 
password is: joggler
Line 40: Line 33:
 
==Transform it to Orbiter==
 
==Transform it to Orbiter==
 
===Adapt sources.list===
 
===Adapt sources.list===
SSH to core, "sudo su" to root and replace /etc/apt/sources.list with following content:
+
SSH to joggler, "sudo su" to root and replace /etc/apt/sources.list with following content:
 
  ###### Ubuntu Main Repos
 
  ###### Ubuntu Main Repos
  deb http://uk.archive.ubuntu.com/ubuntu/ lucid main restricted universe multiverse
+
  deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse  
deb-src http://uk.archive.ubuntu.com/ubuntu/ lucid main restricted universe multiverse  
+
 
   
 
   
 
  ###### Ubuntu Update Repos
 
  ###### Ubuntu Update Repos
  deb http://uk.archive.ubuntu.com/ubuntu/ lucid-security main restricted universe multiverse   
+
  deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse   
  deb http://uk.archive.ubuntu.com/ubuntu/ lucid-updates main restricted universe multiverse  
+
  deb http://archive.ubuntu.com/ubuntu/ trusty-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
 
  ##### Joggler PPA
  deb http://ppa.launchpad.net/jools/joggler/ubuntu lucid main
+
  deb http://ppa.launchpad.net/jools/joggler/ubuntu trusty main
deb-src http://ppa.launchpad.net/jools/joggler/ubuntu lucid main
+
 
   
 
   
  ##### Intel EMGD binaries PPA
+
  #### LinuxMCE repo - main repo and shadow repo
deb http://ppa.launchpad.net/jools/emgd-xorg1.9/ubuntu lucid main
+
  deb http://deb.linuxmce.org/ubuntu/ trusty main
  deb-src http://ppa.launchpad.net/jools/emgd-xorg1.9/ubuntu lucid main
+
  deb http://deb.linuxmce.org/ trusty main
+
 
#### LinuxMCE repo
+
  deb http://deb.linuxmce.org/ubuntu/ lucid beta2
+
 
===Update installation to latest packages===
 
===Update installation to latest packages===
 
  apt-get update
 
  apt-get update
  apt-get upgrade
+
 
 +
==Install LinuxMCE - Full Stack==
 +
 
 +
===Install LinuxMCE===
 +
  DEBIAN_FRONTEND=noninteractive apt-get install lmce-disked-mid-joggler -y --allow-unauthenticated --no-install-recommends
 +
reboot
 +
 
 +
===squeezelite===
 +
A squeezeslave/lite device will be created automatically with the lmce install.  The associate squeezebox player should also be created automatically.  In the webadmin you will need to set the appropriate entertainment area for the player/slave.  Also choose the appropriate output device, default it the 'default' device on which the slave(lite) is installed.
 +
 
 +
==Install LinuxMCE - Minimal 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.  If you wish to have the Clock displayed during downtimes then you will need to add a Child Device to this orbiter and choose the "Clock Screen Saver".
 +
 
 +
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.
 +
 
 
===Install pre requirements for Orbiter===
 
===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
+
  apt-get install mysql-client libsdl-ttf2.0-0 libsdl-sge libsdl-gfx1.2-4 libsdl-image1.2 xfwm4 screen  liblinphone5 libxcursor1 lmce-clock-screen-saver
 +
 
 
===Create directory structure===
 
===Create directory structure===
  mkdir -p /usr/pluto/bin
+
  sudo mkdir -p /usr/pluto/bin
  mkdir -p /usr/pluto/lib
+
  sudo mkdir -p /usr/pluto/lib
  mkdir -p /usr/pluto/locks
+
  sudo mkdir -p /usr/pluto/locks
  mkdir -p /var/log/pluto
+
  sudo mkdir -p /var/log/pluto
 
   
 
   
  chown -R joggler:joggler /usr/pluto
+
  sudo chown -R joggler:joggler /usr/pluto
  chown -R joggler:joggler /var/log/pluto
+
  sudo chown -R joggler:joggler /var/log/pluto
  
 
===Copy needed files from your core to your joggler===
 
===Copy needed files from your core to your joggler===
SSH to joggler if not yet done. You don't need to become root.<br>Copy the Orbiter binary:
+
'''This step can only be successful IF you run 1404 on your core. Otherwise the binaries and libs must be sourced elsewhere'''  Ask in IRC if you need them.
 +
 
 +
SSH to joggler if not yet done so. You don't need to become root.<br>Copy the Orbiter binary and helpers:
 
  cd /usr/pluto/bin
 
  cd /usr/pluto/bin
 
  scp root@dcerouter:/usr/pluto/bin/Orbiter .
 
  scp root@dcerouter:/usr/pluto/bin/Orbiter .
Line 88: Line 88:
 
  scp root@dcerouter:/usr/pluto/bin/SQL_Ops.sh .
 
  scp root@dcerouter:/usr/pluto/bin/SQL_Ops.sh .
 
  scp root@dcerouter:/usr/pluto/bin/LockUtils.sh .
 
  scp root@dcerouter:/usr/pluto/bin/LockUtils.sh .
 +
scp root@dcerouter:/usr/pluto/bin/Utils.sh .
 +
scp root@dcerouter:/usr/pluto/bin/pluto.func .
 +
scp root@dcerouter:/usr/pluto/bin/Spawn_Device.sh .
 +
scp root@dcerouter:/usr/pluto/bin/Spawn_Wrapper.sh .
  
 
Copy the needed libraries:
 
Copy the needed libraries:
Line 99: Line 103:
 
Create '''/home/joggler/startOrbiter.sh''' file with following content:
 
Create '''/home/joggler/startOrbiter.sh''' file with following content:
 
  #!/bin/bash
 
  #!/bin/bash
. /usr/pluto/bin/Config_Ops.sh
 
. /usr/pluto/bin/SQL_Ops.sh
 
 
   
 
   
  export DISPLAY=:0.0
+
  . /usr/pluto/bin/Config_Ops.sh 2>/dev/null
 
   
 
   
 
  ConfGet "MyOrbiterID"
 
  ConfGet "MyOrbiterID"
 
  ConfGet "DCERouter"
 
  ConfGet "DCERouter"
 
Q="SELECT IK_DeviceData FROM Device_DeviceData WHERE FK_Device=$MyOrbiterID AND FK_DeviceData=56"
 
timeOut=$(RunSQL "$Q")
 
 
xset +dpms
 
xset dpms $timeOut $timeOut $timeOut
 
 
   
 
   
 
  while [ "1" == "1" ] ; do  
 
  while [ "1" == "1" ] ; do  
Line 118: Line 114:
 
  sleep 15
 
  sleep 15
 
  done
 
  done
 
+
Change mode:
 +
chmod 755 /home/joggler/startOrbiter.sh
 
Replace '''/home/joggler/.xinitrc''' file with the following content:
 
Replace '''/home/joggler/.xinitrc''' file with the following content:
 
  export DISPLAY=:0.0
 
  export DISPLAY=:0.0
 +
xset +dpms
 +
xset dpms 300 300 300
 +
 +
xfwm4 &
 +
 +
if [ -f /home/joggler/startSqueezeSlave.sh ]; then
 +
/home/joggler/startSqueezeSlave.sh&
 +
fi
 +
 
  if [ -f /home/joggler/startOrbiter.sh ]; then
 
  if [ -f /home/joggler/startOrbiter.sh ]; then
  exec /home/joggler/startOrbiter.sh
+
  /home/joggler/startOrbiter.sh
 
  else
 
  else
 
  xterm
 
  xterm
 
  fi
 
  fi
 +
The "xset dpms 300 300 300" line sets the timeout in seconds for your joggler's screen to switch off. Feel free to change to your needs.
  
 
===Create LinuxMCE configuration===
 
===Create LinuxMCE configuration===
Line 140: Line 147:
 
Replace <ID> with the device ID of the orbiter you created above.
 
Replace <ID> with the device ID of the orbiter you created above.
  
===Optional: Squeezeslave===
+
===Optional Squeezeslave===
 
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
+
  sudo apt-get install squeezeslave
 +
Create '''/home/joggler/startSqueezeSlave.sh'''
 +
#!/bin/bash
 +
 +
. /usr/pluto/bin/Config_Ops.sh 2>/dev/null
 +
 +
ConfGet "DCERouter"
 +
MAC=$(ifconfig eth0 | grep "HWaddr" | sed 's/.*HWaddr \([:[:xdigit:]]*\).*$/\1/g')
 +
 +
while [ "1" = "1" ]; do
 +
        /usr/bin/squeezeslave -m $MAC $DCERouter
 +
done
 +
NOTE: If you are using your Joggler with WiFi, replace "eth0" with "wlan0".
  
==TODO==
+
Change mode
On my whishlist:
+
chmod 755 /home/joggler/startSqueezeSlave.sh
* Get mouse cursor hidden. All tries with unclutter or xsetroot to emptycursor failed miserably in the past.
+
If you want your squeezeslave to be a DCE device, meaning that it can be controlled by an Orbiter or my events:
* Make it possible to switch from Orbiter to SqueezePlay and back
+
#Go to LinuxMCE webadmin
* Make mediaplay work on joggler via LMCE. At least audio. Video would be a bonus.
+
#Click on "Show device tree"
* Make it auto create a new orbiter after first install
+
#Expand CORE
Future playground:
+
#Click on "Slim Server Streamer"
* Play with NFS boot of maybe +/- full MD ?
+
#Click on "Create child device"
 +
#Enter a description like "Joggler" and enter jogglers IP address and MAC address
 +
#Click on "Pick device template" and choose DT #58
 +
After having finished device installation you need to assign it to a room which does not yet have an MD.
 +
#Click on the LinuxMCE logo in Webadmin (top left)
 +
#Click on "A/V Equipment"
 +
#Search for your new joggler squeezeslave, modify it's room and click the update butom on page bottom.
 +
Quick reload DCERouter, let your orbiters rebuild and enjoy LinuxMCE playing audio on your joggler.

Latest revision as of 20:50, 4 March 2017


Transforming O2 Joggler to LinuxMCE orbiter

Installing base system

Download and install SqueezeOS

Get SqueezePlay OS for Joggler. You can use either the internal or an external usb stick, however to install additional options you may require running on an external USB stick to have the space.

Using linux

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

gunzip sqpos303_ext.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=sqpos303_ext.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 sqpos303_ext.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=sqpos303_ext.img of=/dev/rdiskX bs=1m

Where rdiskX is your USB device.

Booting/Flashing

Power off your joggler. Insert your newly prepared USB stick to your joggler's external USB port. Depending on the method you choose this will either boot into the SqueezeOS or it will flash the OS to the internal flash memory. If you're flashing the internal memory then read the 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.

SSH

ssh joggler@<your joggler's ip>

password is: joggler

Transform it to Orbiter

Adapt sources.list

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

###### Ubuntu Main Repos
deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse 

###### Ubuntu Update Repos
deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse  
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse 

##### Joggler PPA
deb http://ppa.launchpad.net/jools/joggler/ubuntu trusty main

#### LinuxMCE repo - main repo and shadow repo
deb http://deb.linuxmce.org/ubuntu/ trusty main
deb http://deb.linuxmce.org/ trusty main

Update installation to latest packages

apt-get update

Install LinuxMCE - Full Stack

Install LinuxMCE

DEBIAN_FRONTEND=noninteractive apt-get install lmce-disked-mid-joggler -y --allow-unauthenticated --no-install-recommends
reboot

squeezelite

A squeezeslave/lite device will be created automatically with the lmce install. The associate squeezebox player should also be created automatically. In the webadmin you will need to set the appropriate entertainment area for the player/slave. Also choose the appropriate output device, default it the 'default' device on which the slave(lite) is installed.

Install LinuxMCE - Minimal 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. If you wish to have the Clock displayed during downtimes then you will need to add a Child Device to this orbiter and choose the "Clock Screen Saver".

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.

Install pre requirements for Orbiter

apt-get install mysql-client libsdl-ttf2.0-0 libsdl-sge libsdl-gfx1.2-4 libsdl-image1.2 xfwm4 screen  liblinphone5 libxcursor1 lmce-clock-screen-saver

Create directory structure

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

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

Copy needed files from your core to your joggler

This step can only be successful IF you run 1404 on your core. Otherwise the binaries and libs must be sourced elsewhere Ask in IRC if you need them.

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

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 .
scp root@dcerouter:/usr/pluto/bin/Utils.sh .
scp root@dcerouter:/usr/pluto/bin/pluto.func .
scp root@dcerouter:/usr/pluto/bin/Spawn_Device.sh .
scp root@dcerouter:/usr/pluto/bin/Spawn_Wrapper.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

ConfGet "MyOrbiterID"
ConfGet "DCERouter"

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

Change mode:

chmod 755 /home/joggler/startOrbiter.sh

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

export DISPLAY=:0.0
xset +dpms
xset dpms 300 300 300

xfwm4 &

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

The "xset dpms 300 300 300" line sets the timeout in seconds for your joggler's screen to switch off. Feel free to change to your needs.

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:

sudo apt-get install squeezeslave

Create /home/joggler/startSqueezeSlave.sh

#!/bin/bash

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

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

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

NOTE: If you are using your Joggler with WiFi, replace "eth0" with "wlan0".

Change mode

chmod 755 /home/joggler/startSqueezeSlave.sh

If you want your squeezeslave to be a DCE device, meaning that it can be controlled by an Orbiter or my events:

  1. Go to LinuxMCE webadmin
  2. Click on "Show device tree"
  3. Expand CORE
  4. Click on "Slim Server Streamer"
  5. Click on "Create child device"
  6. Enter a description like "Joggler" and enter jogglers IP address and MAC address
  7. Click on "Pick device template" and choose DT #58

After having finished device installation you need to assign it to a room which does not yet have an MD.

  1. Click on the LinuxMCE logo in Webadmin (top left)
  2. Click on "A/V Equipment"
  3. Search for your new joggler squeezeslave, modify it's room and click the update butom on page bottom.

Quick reload DCERouter, let your orbiters rebuild and enjoy LinuxMCE playing audio on your joggler.