Wednesday, 3 July 2019

Connecting your Echo Dot to Kodi



It is possible to stream music from your Amazon echo dot to your kodi box !!!

Kodi HTPC is basically an output device but you can set it to receive bluetooth audio and play it to your sound system, it requires a bit of fiddling but once done that's it, you can also adapt this method to connect any device that outputs music (phone, tablet etc) and play that through your kodi box


You will need a crontab entry (something which executes every minute) and some basic linux commands to achieve this.

by placing the simple file in your crontab file (obviously alter your bluetooth mac source
to reflect what yours is (more on this later)

copy the following into a text file and call it connect.sh (minus the brackets) you'll be editing this later on with your actual details......

(

#!/bin/bash
pactl load-module module-udev-detect /dev/null
# pactl list short sinks
# pactl list short sources
pactl set-default-sink alsa_output.pci-0000_00_1b.0.analog-stereo
pactl set-default-source bluez_source.68_8A_87_9B_B7_14.a2dp_source    )

the #'s comment out what would normally be taken as commands as an aide memoire in this case
for the commands you need to discover your actual details 


you need to enable bluetooth on your kodi box if it isn't already enabled 

drop to a terminal prompt and ssh shell into your kodi box
 (you can use putty in Windoze to achieve this)

you will have to find out the root password for your kodi installation to gain access and that depends on what flavour of Kodi you have (libreelec, coreelec or stand alone)

once in type

bluetoothctl

then turn on advertising and discoverable (you can show all commands simply by typing
help in the CLI of bluetoothctl)

it's straightforward you just type discoverable on and advertise on 

this starts your kodi box broadcasting bluetooth invitations, without it you won't be able
to connect to your kodi box from your Alexa app 


then connect to your kodi box FROM your echo dot via the Alexa app on your phone/tablet 
it's important you connect FROM your echo dot and not from kodi, you are setting up an input
to kodi not an output.

Once connected and paired make sure your normal output on your kodi box remains as it was to whatever sink it was connected to originally (speakers or whatever)

your bluetooth echo dot source can be found out by

pactl list short source

and your normal sink can be found out by typing the following

pactl list short sinks

take a note of the output of these commands

bluez_source.68_8A_84_9B_B3_14.a2dp_source

the same applies to the short sink name 

alsa_output.pci-0000_00_1b.0.analog-stereo 


a sink in pulseaudio is an output  (music drains into it)

a source is like a tap above the sink (an input, geddit ?)


copy the sinks and sources into the appropriate  lines and paste it into the file called
connect.sh (don't confuse your sinks and sources)

save the connect.sh in your kodi .config directory or anywhere it's accessible  

then create a crontab file by typing 

crontab -e

cut and paste the following into it 

* * * * * /storage/.config/connect.sh

then save the crontab file

make the file connect.sh executable by typing

chmod +x /storage/.config/connect.sh   <--- connect.sh="" crontab="" entry="" file="" just="" location="" make="" nbsp="" of="" or="" p="" points="" saved="" sure="" the="" to="" wherever="" you="">

Job done !!!


this config should survive reboots (hence the crontab) 

if you ever get trouble or alexa complaining she can't connect or find the speaker it will be because
bluetoothctl has stopped broadcasting and isn't discoverable, because the rest is hardwired in.


once you've paired you can connect to your kodi box simply by saying to your echo dot

"alexa connect speaker"

and it should report back it's done it 

check the time with Alexa "Alexa what time is it" and if all has been done properly she should announce the time from your kodi box 


then enjoy considerably louder and higher quality music from Amazon music 

(you cannot control the volume with the kodi box volume is controlled by the echo dot, either manually or via voice control, although be warned if you turn up the music too high Alexa goes deaf because she can't hear you properly)


make sure your kodi box is turned on and settled before you try and connect to echo dot to your kodi box 


Enjoy !!! 

Wednesday, 17 April 2019

Easy way to get EPG into Tvheadend Server

One of the headaches of TVheadend is providing an easy method of keeping the EPG updated, I maintain a large tvheadend server for a large secondary school giving them the ability to record and play live terrestrial tv into classrooms.

This "how-to" is noddy or noob format it assumes you know nothing about anything. 

I used to use the built in epg but found xmltv.co.uk to provide excellent epg data without subscription and is free to use here in the UK.

First off disable all other methods of EPG grabber modules in tvheadend, and enable External XMLTV grabber, make sure you install xmltv package on your tvheadend server and that .xmltv directory appears in tvheadend directory



ls -al /home/hts/.xmltv 

and that the unix socket works and is available

ls /home/hts/.hts/tvheadend/epggrab/xmltv.sock
/home/hts/.hts/tvheadend/epggrab/xmltv.sock  (good it exists!!!)

there are many how-to's available on installing the xmltv package and are beyond the scope of this "how to", in most cases just installing the xmltv package will be enough

ie/ apt-get install xmltv 

should suffice 


then simply create this bash script shown below (I've called it get-epg.sh) and edit it to get the appropriate xml file you require, the type of xml file is in the hashed comments/description
I selected 6715 which is 3 days and all data, simply change it to what you require by changing the number on the end of the wget statement

ie/ nano get-epg.sh



#!/bin/bash
# Feeds available
# Select which one you require and attach it to
# end of wget command
#6721   All 24 Hour All data
#6145   All 24 Hour Entertainment
#6128   All 24 Hour Movies All data
#6187   All 24 Hour Sports All data
#6729   All 48 Hour All data
#6715   All 72 Hour All data
#6793   Limited 5 Days Limited data
#1897   Limited 7 Days  Limited data
clear
echo Removing old xmltv file
rm -rf /home/hts/xmltv.xml
echo Get new xmltv file
wget --output-document /home/hts/xmltv.xml http://www.xmltv.co.uk/feed/1897
echo Touch new file with date downloaded
touch /home/hts/xmltv.xml
echo Copy new file to locations
cp /home/hts/xmltv.xml /home/hts/.xmltv/xmltv.xml
echo Update Completed

you may have to chown (change ownership) the new script to the hts user in my case

chown hts:video get-epg.sh

then su to the hts user (become the hts user) by entering

su hts

then create a new cron job

crontab -e

then copy/paste the line below, it will execute it at 6am every day and in my case get 3 days worth of
epg at a time

0 6 * * *  hts /home/hts/get-epg.sh

followed by Ctrl o (that's o for orange if using nano) to write out the new crontab 


it's pretty self explanatory, remove old file get the new xml file and rename it on save as xmltv.xml and put it in the /home/hts directory, touch it to change the date downloaded (more of a belts and braces touch to make sure the date is updated so you can easily check if the file is current) 

Then copy it to the .xmltv directory, you could of course just copy it to the xmltv directory directly or create a symlink either would work, but it's such a small file 30MB tops that it takes less than a second to copy it. 

it's a very simple bash script and no doubt it can be improved upon, but I like simple you can easily follow it.

voila a simple and automated way to get UK EPG data into your tvheadend server, restart your tvheadend server and you should see your EPG data populate and have 3 days worth.

There is no point in getting the epg data more than once every 24 hours because it's not updated any sooner than once every 24 hours in each day.

xmltv.co.uk sometimes change the feed names so you need to check those first and amend the script accordingly, I've also noticed sometimes the website goes offline with no explanation


so make sure you can actually browse the website before debugging the script

Latest xmltv feeds


Tuesday, 5 March 2019

This appeared on the Bruges Group website and was quickly removed for unknown reasons so I have hosted it here, I make no claims as to it's truthfulness or accuracy.

John Petley

There is no doubt about the veracity of this account since documents have been seen.
On Monday July 9th 2018, several leading French, German and Dutch senior managers were called by EU officials to an urgent meeting.
The meeting was said to be private and those present were informed that Prime Minister May and Chancellor Merkel had reached an Agreement over Brexit. Knowledge of this was attained from the actual transcript of the meeting between May and Merkel.
1) The Agreement was couched in a way to 'appease' the Brexit voters.
2) The Agreement would enable May to get rid of those people in her party who were against progress and unity in the EU.
3) Both Merkel and May agreed that the likely course of events would be that UK would re-join the EU in full at some time after the next general election.
4) May agreed to keep as many EU laws and institutions as she could despite the current groundswell of 'anti-EU hysteria' in Britain (May's own words, apparently.)
5) Merkel and May agreed that the only realistic future for the UK was within the EU.
The original Agreement draft was completed in May 2018 in Berlin and then sent to the UK Government Cabinet Office marked 'Secret'.
NB This Agreement draft was authored in the German Chancellor's private office.
The Cabinet returned the Agreement draft with suggestions, and there was some to-ing and fro-ing during June 5th 2018.
Private calls between the Prime Minister and Chancellor were made.
The Agreement's final draft came out late in June 2018. The German Chancellor told Prime Minister May that this was a deal she would support, though there would need to be some more small concessions by the UK to keep the EU happy.
The Chancellor and Prime Minister met in Germany. Merkel had this meeting recorded as a 'private meeting' though the Prime Minister was probably unaware of that.
The Chancellor had the transcript of that meeting circulated secretly to EU and key German embassies.
Conclusions
Documents make it quite clear that Prime Minister May was negotiating with Germany, not the EU.
The transcript also makes it clear that the Prime Minister intended to keep all this secret from minsters, especially the Brexit group.
She wants to keep as many EU institutions in UK as intact as possible in order to facilitate an easy return to the EU after 2020.
Chancellor Merkel briefed May on tactics to force Cabinet approval.
The Prime Minister and senior civil servants were working with Germany to stop Brexit or water it down to prevent free trade and the ending of freedom of movement, but to keep cash flowing to the EU.
David Davis was kept in the dark while key EU premiers in France, Holland and Ireland were briefed in full.
Key EU heads were actually briefed in full the day before the Cabinet meeting at Chequers.