2015-09-17, 16:02
If this helped you than you should hit the thank button
Post 1# Kodibuntu + Bluez 4
Post 2# Ubuntu 16 + Kodi 16.1 + Bluez 5
I made this new post cause i had to do several steps from several post. This is the solution that worked for me after trying several days I dont know what exactly happens in the code, but this few steps got my Logitech Harmony Ultimate working on Linux (KODIbuntu) I also got it finally to work on higher bluez version, which i explain in post #2.
I used IR first, but the response whas so sluggish, so i was desperate to try bluetooth, I do notice a much faster response.
If this guide works for you, you may wanne thank the posts.
[My hardware]
1. HTPC with KODIbuntu 14.04.1 LTS
2. Logitech Harmony Ultimate
3. Bus 008 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
[Step 1.]
First of all create a new Device (Sony Playstation 3) and a fresh activity in Logitech Harmony Remote Software.
Then comes the fun part
[Step 2.]
Get and install bluez + patch
[Additional step for: OSMC you need to install make & essential]
Continue
[Step 3.]
Inject the Logitech Harmony PS3 remote device in fakehid.c
Around line 343, you should find the following code:
These lines teach Bluez how to recognize Sonys official PlayStation 3 bluetooth remote. Modify this structure and make it look like the following:
[Step 4.]
Continue with bluez install code: cd to ~/bluez-4.94 folder
[Step 5.]
Pair the PS3 Remote
Activate the PS3 Activity on youre Harmony and follow the instructions
It Should now find the remote in the SSH
Select the device you wish to add
After this the Harmony said Unable to Pair, so i did the following:
And the harmony Ultimate is now Connected/Paired
[Step 5.]
Download keymap, cd to youre home/username folder:
After reboot it still works great!
[Check Connection]
[Tips]
In the ps3pair folder there is an ps3unpair.py script to repair the connection, may it ever fails.
Further customization of the Harmony Buttons, defined in:
Example: If we look at <F2> in keyboard.xml it runs the command Runaddon NetFlix, , KEY_F2 in input.conf = L2 button on the PS3 Device in Harmony, you will see on the left side of the picture L2 and that refers to NetFlix button. Thats how it works.
[/home/username/userdata/keymaps/keyboard.xml]
Putting old image back to verify all steps.
EDIT:
I changed some steps to make it noob proof, everyone with linux a supported bluetooth module and a harmony can follow this steps to get the job done.
Post 1# Kodibuntu + Bluez 4
Post 2# Ubuntu 16 + Kodi 16.1 + Bluez 5
I made this new post cause i had to do several steps from several post. This is the solution that worked for me after trying several days I dont know what exactly happens in the code, but this few steps got my Logitech Harmony Ultimate working on Linux (KODIbuntu) I also got it finally to work on higher bluez version, which i explain in post #2.
I used IR first, but the response whas so sluggish, so i was desperate to try bluetooth, I do notice a much faster response.
Thanks To All Users In This Post That Helped On This Project:
http://forum.kodi.tv/showthread.php?tid=50717
Special Thanks To:
CrazyCoder For harmony Injection
http://forum.kodi.tv/showthread.php?tid=50717
Special Thanks To:
CrazyCoder For harmony Injection
If this guide works for you, you may wanne thank the posts.
[My hardware]
1. HTPC with KODIbuntu 14.04.1 LTS
2. Logitech Harmony Ultimate
3. Bus 008 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
[Step 1.]
First of all create a new Device (Sony Playstation 3) and a fresh activity in Logitech Harmony Remote Software.
Then comes the fun part
[Step 2.]
Get and install bluez + patch
Code:
sudo apt-get update
sudo apt-get install bluez libdbus-1-dev libglib2.0-dev python-dbus python-gobject
[Additional step for: OSMC you need to install make & essential]
Code:
apt-get install make
apt-get install build-essential
reboot
Continue
Code:
sudo service bluetooth stop
cd ~
wget https://dl.dropboxusercontent.com/u/89032099/XBMC/bluez_ps3remote_4.91.diff
wget http://www.kernel.org/pub/linux/bluetooth/bluez-4.94.tar.gz
tar xvfz bluez-4.94.tar.gz
cd bluez-4.94
[Step 3.]
Inject the Logitech Harmony PS3 remote device in fakehid.c
Code:
cd input
nano ./fakehid.c
Around line 343, you should find the following code:
Code:
static struct fake_hid fake_hid_table[] = {
/* Sony PS3 remote device */
{
.vendor = 0x054c,
.product = 0x0306,
.connect = fake_hid_common_connect,
.disconnect = fake_hid_common_disconnect,
.event = ps3remote_event,
.setup_uinput = ps3remote_setup_uinput,
.devices = NULL,
}
{ },
};
These lines teach Bluez how to recognize Sonys official PlayStation 3 bluetooth remote. Modify this structure and make it look like the following:
Code:
static struct fake_hid fake_hid_table[] = {
/* Sony PS3 remote device */
{
.vendor = 0x054c,
.product = 0x0306,
.connect = fake_hid_common_connect,
.disconnect = fake_hid_common_disconnect,
.event = ps3remote_event,
.setup_uinput = ps3remote_setup_uinput,
.devices = NULL,
},
/* Logitech Harmony PS3 remote device */
{
.vendor = 0x046d,
.product = 0xc129,
.connect = ps3remote_connect,
.disconnect = ps3remote_disconnect,
.event = ps3remote_event,
.setup_uinput = ps3remote_setup_uinput,
.devices = NULL,
},
{ },
};
[Step 4.]
Continue with bluez install code: cd to ~/bluez-4.94 folder
Code:
cd ..
patch -p1 < ../bluez_ps3remote_4.91.diff
./configure --prefix=/usr && make
sudo make install
sudo ln -s /etc/bluetooth/input.conf /usr/etc/bluetooth/input.conf
sudo ln -s /etc/bluetooth/audio.conf /usr/etc/bluetooth/audio.conf
sudo ln -s /etc/bluetooth/serial.conf /usr/etc/bluetooth/serial.conf
sudo reboot
[Step 5.]
Pair the PS3 Remote
Code:
cd ~
wget https://dl.dropboxusercontent.com/u/89032099/XBMC/ps3pair.tar.gz
tar xvfz ps3pair.tar.gz
cd ps3pair
sudo python ps3_pair.py
Activate the PS3 Activity on youre Harmony and follow the instructions
It Should now find the remote in the SSH
Code:
Searching for devices, please wait...
Found:
1: 00:04:20:E7:2B:0A [Unknown]
Select the device you wish to add [1]:
Select the device you wish to add
After this the Harmony said Unable to Pair, so i did the following:
Code:
sudo bluez-test-input connect XX:XX:XX:XX:XX:XX (replace with own mac)
[Step 5.]
Download keymap, cd to youre home/username folder:
Code:
cd .kodi/userdata/keymaps/
wget https://dl.dropboxusercontent.com/u/89032099/XBMC/keyboard.xml
cd /etc/bluetooth
sudo mv input.conf input.conf.bak
sudo wget https://dl.dropboxusercontent.com/u/89032099/XBMC/input.conf
sudo reboot
After reboot it still works great!
[Check Connection]
Code:
root@kodi:~/ps3pair# /usr/share/doc/bluez/examples/list-devices
Code:
[ /org/bluez/1056/hci0 ]
Name = kodi-0
Powered = 1
Devices =
DiscoverableTimeout = 0
PairableTimeout = 0
Discoverable = 0
Address = 00:09:DD:50:8A:1F
Discovering = 0
Pairable = 1
Class = 4718848
UUIDs = 0x1000 0x1001 0x1112 0x111f 0x110a 0x110c 0x110e
[Tips]
In the ps3pair folder there is an ps3unpair.py script to repair the connection, may it ever fails.
Further customization of the Harmony Buttons, defined in:
Example: If we look at <F2> in keyboard.xml it runs the command Runaddon NetFlix, , KEY_F2 in input.conf = L2 button on the PS3 Device in Harmony, you will see on the left side of the picture L2 and that refers to NetFlix button. Thats how it works.
[/home/username/userdata/keymaps/keyboard.xml]
Code:
<keymap>
<global>
<keyboard>
<!-- Jixel Custom Keys -->
<f2>RunAddon(plugin.video.netflixbmc)</f2>
<f4>RunAddon(plugin.audio.tuneinradio)</f4>
<f5>ActivateWindow(Videos,TvShowTitles)</f5>
<f6>ActivateWindow(Videos,MovieTitles)</f6>
<f7>ActivateWindow(MusicLibrary,nfs://192.168.1.4/MediaLibrary/Music/,Return)</f7>
<f8>RunAddon(plugin.video.pulsar,Return)</f8>
<f9>RunScript("script.ipcam")</f9>
<f10>RunAddon(plugin.video.youtube,Return)</f10>
<f11>Quit</f11>
<pause>Pause</pause>
<!-- Unused keys: F1(L1), F2(L2), F3(L3), INSERT(Select) -->
</keyboard>
</global>
<FullscreenVideo>
<keyboard>
<g>showtime</g>
<f1>ActivateWindow(SubtitleSearch)</f1>
<f5>XBMC.ActivateWindow(osdvideosettings)</f5>
<f6>AudioNextLanguage</f6>
<f7>XBMC.ActivateWindow(osdaudiosettings)</f7>
</keyboard>
</FullscreenVideo>
</keymap>
Putting old image back to verify all steps.
EDIT:
I changed some steps to make it noob proof, everyone with linux a supported bluetooth module and a harmony can follow this steps to get the job done.