OSMC and ps3 controller, how to install?

Hello all !

So i took lot of time to try to install a ps3 controller and use it .

First, i tried this link:
http://www.raspians.com/Knowledgebase/ps3-dualshock-controller-install-on-the-raspberry-pi/

It worked well. At the end, when i writed
sudo sixad --start
A process lauched and my controller was recognized. But that’s all, the process worked, i was stuck, i could only press ctrl+C to stop this proces. I tried to launch it at boot, but it was worse, i blocked my terminal at the launch of it.

Later, i found this :
http://kodi.wiki/view/HOW-TO:Set_up_PS3_BD_Remote

I started to type it, i purged, bluez, and at the fourth line :
wget http://kitlaan.twinaxis.com/projects/bluez-ps3remote/bluez_ps3remote_4.91.diff

I realized that the link was down.

So now i broke my first solution. Nothing is working.

Before trying anything else, i would like to have any idea to have some tools to help me to install that.

Sorry for my bad english and thank you in advance ! :smiley:

Before you did any of that, did you just try pairing it in the Bluetooth panel in Networking ? The PS3 remote should be supported out of the box in OSMC - just pair it.

Thnaks for the answer :smile:
No, when i start discovery, it doesn’t see it. I read that the SIXAXIS apparently does not support the standard Bluetooth pairing procedure.

I read this here :
http://www.pabr.org/sixlinux/sixlinux.en.html

If you plug in the ps3 controller and then have it set to discover it will see it. However, for me when trying to connect it fails.

For what you want to use it?

I only use it within RetrOSMC, because I use my tv remote through CEC for within Kodi.
I ask this because RetrOSMC has the complete auto install for this all :wink:

Sorry, my english is not perfect, but my PS3-Controller works in OSMC->Kodi perfectly. I’m a noob…

My way:

pair the controller in OSMC

add 1 line in \var\init.d\sixad:
sudo hciconfig hci0 pscan >>/var/log/sixad

bevore:
$DAEMON --start &>>/var/log/sixad &


edit the configfile for sixad \var\lib\sixad\profiles\default

# ##########################
# sixad configuration file #
########################## #

# Features
enable_leds 1
enable_joystick 0
enable_input 1
enable_rumble 0
enable_timeout 1

# LED
led_n_auto 1
led_n_number 1
led_anim 1

# Joystick
enable_buttons 1
enable_sbuttons 1
enable_axis 1
enable_accel 1
enable_accon 0
enable_speed 0
enable_pos 0

# Input - “(None)”
key_select 31 # s: shutdown menu
key_start 164 # playpause

key_up 103 #up
key_right 106 #right
key_down 108 #down
key_left 105 #left

key_l1 104 # PAGEUP
key_r1 109 # PAGEDOWN
key_l2 17 # w/z: aspect ratio
key_r2 24 # o: codec info
key_l3 39 # semicolon/m: player control
key_r3 113 # mute

key_tri 46 # C: context menu
key_cir 14 # BACKSPACE
key_cro 28 # ENTER
key_squ 23 # info
#key_squ 57 # SPACE

key_ps 15 # tab: fullscreen

axis_left_type 2
axis_left_up 107 # end: end page
axis_left_right 39 # semicolon/dot: next
axis_left_down 102 # home: first page or home window
axis_left_left 50 # m/comma: previous
axis_right_type 2
axis_right_up 74 # volumeup
axis_right_right 33 # f: fast forward
axis_right_down 78 # volumedown
axis_right_left 19 # r: rewind
axis_speed 6
use_lr3 0

# Rumble
old_rumble_mode 0

# Timeout
timeout_mins 10

HI “newbiecrd” can you help us ? wee need more info how to make the ps3 controller to work…
The OSMC forum have no direct answer… Thanks … sory for my perfect Eng. :disappointed:

WORKS !!! THINX werry much !!! :smile:

and

That works!
PS3 Controller gets connected and i can controll KODI.
But after reboot controller cant connect without typing “sudo hciconfig hci0 pscan” in terminal.

This should solve the Problem but i dont find the right file to add this line?!
I dont have this dir (/var/init.d/)
I have
/etc/init.d/sixad

Some other said i have to add this line in file rc.local?

Where should i add “hciconfig hci0 pscan” to solve the Problem?

greets

Solved :wink:

Some other users might be interested in how?

Sure! Got no time left yesterday.

Problem was Bluetooth is activ after reboot but not discoverable.
“hciconfig” shows Bluetooth “UP RUNNING” but without “PSCAN”

Adding “hciconfig hci0 pscan” to file rc.local" does NOT work for me.
I think the reason is the line in rc.local (hciconfig hci0 pscan) will be executed at booting
the system before bluetooth dongle is initialized.

My Solution is to use a little script in /etc/init.d/ which waits till bluetooth is initialized.


So for installing Bluetooth PS3 Controller on OSMC use:

pair the controller in OSMC

edit configfile for sixad or directly use this controller configs in the first toturial

then go to terminal and create a file i called “btstart” in /etc/init.d/
sudo nano /etc/init.d/btstart

add the following code, save/write and exit:

make script executable
sudo chmod 755 /etc/init.d/btstart

test the script and check hciconfig
sudo /etc/init.d/btstart start
hciconfig

should look like:

register script to be run on start-up:
sudo update-rc.d btstart defaults

reboot and try to connect

Service sixad is already registered in first toturial but after adding this script it wont work for me, so i added “sixad -start” to script.

This whole linux stuff is absolutely new for me, i just read alot and tried…it works and thats all i need :slight_smile:

greetz

Thanks, this helped a lot! Although, my script still wont run on start-up… Done all the steps you mentioned, including “sudo update-rc.d btstart defaults” but still it doesnt run. Note that everything works if I SSH into the pi and run the script manually. I also tried to create a service and do “systemctl enable” to run it, but this doesnt work either. Do you have any ideas?

Note: I have the raspberry pi 3, so I use the inbuilt bluetooth instead of a dongle.

I also have Pi3 and for me it did not work with inbuilt bluetooth.
I use a dongle and disabled inbuilt bt.

You could connect PS3 Controller and navigate in kodi?

Hmm okey. Yes I can connect the PS3 Controller and navigate. But only if I run the script “btstart” manually. I cannot reboot the pi and automatically connect the PS3 controller for some reason… So the problem is that “btstart” doesnt run after boot, I have written the command that you said “sudo update-rc.d btstart defaults”, but it doesnt work for me.

Does anyone have instructions for ps4 controller setup?

Thanks

I got my controller working following the above steps, however the controller isn’t working every time I reboot.

Adding “sudo hciconfig hci0 pscan >>/var/log/sixad” above “$DAEMON --start &>>/var/log/sixad &” didn’t do anything.

I also tried to add “sudo hciconfig hci0 pscan >>/var/log/sixad” to rc.local that also does nothing. Then the script you showed is a picture so I can’t copy paste it and when I type it gives me a "Syntax error: Bad for loop variable"

Any help would be appreciated!

This is now 6 months later. But I’ve spent my entire weekend trying to get this working with the newer versions of OMSC.

The init.d script posted by benno no longer works properly. It only works when you manually start it. Which isn’t very handy for me since my OSMC device does not have a mouse or keyboard.

For those still having issues, here’s what I did.

First follow the initial set up. This should get you to a point where your DS3 Controlls is connected and working.

Now set up the controller mappings shown in this post.

Now, once the initial set up is done, we need a way to auto connect the controller when booting the machine. Since the init script methods are being deprecated and the systemd process is more standard, do this:

sudo nano /usr/bin/scripts/bts.sh

Put the following code in the script. This is essentially the same thing as bennos, but slightly modified. Credit where credit is due.

#!/bin/bash


if [ "$1" != "background" ]; then
        $0 background &
else
        #Wait until BT is initialized
        for ((i=0; i<=100; i++)) do
                hciconfig hci0 && break
                usleep 100000
        done

        /usr/bin/hciconfig hci0 up
        /usr/bin/hciconfig hci0 pscan
        su osmc -c "/usr/bin/sixad -s &"

fi

Now create a service file

sudo nano /lib/systemd/system/bts.service

and put in the following (I’m sure there are errors here, I’m not an expert. I literally learned this stuff in the past 2 hours. but it works.)

[Unit]
Description = SIXAD Connection Daemon
Requires = bluetooth.target
[Service]
Type = forking
ExecStart = /usr/bin/scripts/bts.sh
RemainAfterExit=yes
[Install]
WantedBy = multi-user.target

Now, enable the service.

sudo systemctl enable bts.service

you should see something like this:

_Created symlink from /etc/systemd/system/multi-user.target.wants/bts.service to /lib/systemd/system/bts.service._

and reboot! When the system starts again, you should be able to press the PS button and it will connect, and do what I call ‘the wave’ to you (All Leds light up sequentially).

1 Like

sudo mkdir /usr/bin/scripts

Before writing a file to a non existant folder.

1 Like

I get some error’s at bootup and PSCAN is not showing after rebooting.

I have to type this to make the controler work after reboot.

sudo hciconfig hci0 piscan

EDIT: It is working now! Thank you very very much!!!
I removed the previous scripts and redid every step from the beginning.

I’m still getting one of the two error’s on bootup though:

[FAILED] Failed to start SIXAD Connection Daemon.
See ‘systemctl status bts.service’ for details.