OSMC and ps3 controller, how to install?

How to start PS3 controller on boot RP3vB+OSMC+Kodi v16:

Waddup y’all. This is my first post so bare with me. After doing:

and

I got the controller connected through bluethooth and I can control Kodi. It’s wonky as hell but it works. By typing the ‘who -r’ command I can see that the system is in runlevel 5. So everything works fine on runlevel 5. It still won’t start on boot though. So I tried the script from Si2rp and it didn’t work for me. Then I tried to edit the rc.local file like Davidmval and rc.local.service failed to start due to “Compatibility” when any code is added to /etc/rc.local. Long story short my guess is that hciconfig and sixad are trying to start before their dependancies are up and running (bluetooth module…etc). So I made a simple script that makes simple script and sets the second simple script to be ran at the end of runlevel 5. Y’all follow me? Good. So check it:

touch /etc/init.d/PS3Pi.sh
echo ‘#! /bin/sh’ > /etc/init.d/PS3Pi.sh
echo ‘’ > /etc/init.d/PS3Pi.sh
echo ‘hciconfig hci0 up’ > /etc/init.d/PS3Pi.sh
echo ‘hciconfig hci0 pscan’ > /etc/init.d/PS3Pi.sh
echo ‘sixad -s &’ > /etc/init.d/PS3Pi.sh
chmod +x /etc/init.d/PS3Pi.sh
sudo ln -s /etc/init.d/PS3Pi.sh /etc/rc5.d/S04PS3Pi.sh

S04 is the last script to be ran in runlevel 5 on my system, change yours if you must.

reboot

after reboot press the PS button on your controller and watch the LEDs do the “Night Rider”. You should be good to go from there.

to double check your work:
sudo systemctl | less
scroll around and look for:
red) * bluetooth.service loaded failed failed Bluetooth service
green) brcm43xx.service loaded active running Broadcom 43xx bluetooth HCI
and:
green) PS3Pi.service loaded active running (null)

Bigups to Si2rp Davidmval Theetjuh newbiecrd.
If I F’D up anywhere in this post please call me out on it. And be brutal about it too :imp:
I hope this helped some poor bastard get some sleep. Laterz yall. Peace out. -HacKR10T:sunglasses: