Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #100569
    qrayg
    Participant

    Is there a modern tutorial on how to get the DS4 controller set up wirelessly with RetroPie version 3+?

    I see a lot of references to the ds4drv project, but everyone says it lags too much. I tried following a bunch of tutorials but they are all from RetroPie 2.3-ish and it seems that the new 3+ version do not have the same dependencies. The instructions fail every time from a fresh install of RP. When I launch bluetoothctrl I cannot type the commands from the tutorials. I’ve also tried in vain to replace Bluez 4.99 with the latest 5+ version (5+ has full support for DS4 natively)… nothing works.

    I love the ease of pairing a DS3 controller, I’d like the same ease with pairing a DS4 controller.

    On that same line, will we ever get Bluez 5+ in RP or is 4.99 the best we can get?

    #100815
    qrayg
    Participant

    I think I figured it out myself… I’m not sure if this is the correct way, but it is the only way I could get it to connect and reconnect after turning off the controller. Also, if a PS3 controller was already paired this method did not work (not sure why)… this only works on a fresh RP image and was tested on v3.0 B4:

    # SSH or go the command line:

    # Install/Launch PiAssist

    $ wget https://raw.githubusercontent.com/Death259/PiAssist/master/PiAssist.sh
    $ chmod +x PiAssist.sh
    $ sudo ./PiAssist.sh

    # Pair Controller via Bluetooth menu, very simple

    # Edit rc.local

    $ sudo nano /etc/rc.local

    # Paste the following after “this file does nothing…”

    #!/bin/bash
    hciconfig device up
    hciconfig set name raspberrypi-0
    hciconfig set class 0x420100
    hciconfig enable iscan
    hciconfig enable pscan

    # Change class to value from /var/lib/bluetooth/xxx/config
    # This whole bit allows reconnection later without having to re-pair

    # Save/Exit
    CTRL + X, Y, Return

    # Reboot
    $ sudo reboot

    #101949
    pgardella
    Participant

    You said we should use the xxx from /var/lib/bluetooth/xxx/config for the set class line. But the value from that directory is six hex pairs. Which ones do we use?

    #101970
    qrayg
    Participant

    You need to open the config file from within your MAC address folder and use the value from the class line. I just used xxx as the folder name since everyone’s MAC address is different. I guess the more accurate folder name example would be xx:xx:xx:xx:xx:xx. The folder name is irrelevant though, you want the class value from the config file.

    #103544
    robertus
    Participant

    [quote=101970]You need to open the config file from within your MAC address folder and use the value from the class line. I just used xxx as the folder name since everyone’s MAC address is different. I guess the more accurate folder name example would be xx:xx:xx:xx:xx:xx. The folder name is irrelevant though, you want the class value from the config file.

    [/quote]

    Hi man, im goign to crazy, i can’t connect my DualShock4 original on my raspberry pi 2 and retropie.

    sudo ./PiAssist.sh
    then 2 Bluetooth, 2 connect bluetooth device, scanning… i press and hold ps button, but doesn’ recognize….

    i tried to put bluetooth on my Phone (nexus 5) and is recognize, so dongle seems work fine.

    Please can you help me ? :(

    i have also another controller, shanwan controller ps3 fake controller and also not work.

    i hope in your support

    thanks a lot

    #103546
    qrayg
    Participant

    To put a Dual Shock 4 controller into pair mode you need to press PS + Share button.

    #103607
    robertus
    Participant

    that’s right, my fault

    anyway now i can see the device but when i tried to pair it, i have this error:

    ERROR:dbus.proxies:Introspect error on :1.3:/: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
    Traceback (most recent call last):
      File "/usr/bin/bluez-simple-agent", line 102, in <module>
        path = manager.FindAdapter(args[0])
      File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in __call__
        return self._proxy_method(*args, **keywords)
      File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
        **keywords)
      File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
        message, timeout)
    dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
    ERROR:dbus.proxies:Introspect error on :1.3:/: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
    Traceback (most recent call last):
      File "/usr/bin/bluez-test-device", line 28, in <module>
        adapter_path = manager.DefaultAdapter()
      File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in __call__
        return self._proxy_method(*args, **keywords)
      File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
        **keywords)
      File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
        message, timeout)
    dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
    

    after these errors i have this message:
    Bluetooth device has been connected

    but i started retropie and i press ps button but device flash and doesn’t connect via bluetooth and i must connected via usb :(

    i waste my days without success :/

    #103610
    qrayg
    Participant

    As stated in my original post “this only works on a fresh RP image and was tested on v3.0 B4”. If you tried to pair a different controller then it probably won’t work. Also, if you are not using B4 then it might not work. This is just a post to help point people in the right direction. If it doesn’t work for you, then it doesn’t work. That’s the nature of Linux. I ended up getting mine to work on a FRESH image with nothing else installed or paired so I tried to help others so maybe someone can find a better method. This is not a definitive set of instructions.

    #103611
    robertus
    Participant

    Oh i see

    i tried infact in a fresh retropie image, 3.0 RC1, last version

    the message is that the controller connected but there are some error and infact controller doesn’t work

    Creating device failed: org.bluez.Error.AlreadyExists: Already Exists
    Traceback (most recent call last):
      File "/usr/bin/bluez-test-input", line 40, in <module>
        input.Connect()
      File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in __call__
        return self._proxy_method(*args, **keywords)
      File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
        **keywords)
      File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
        message, timeout)
    dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "Connect" with signature "" on interface "org.bluez.Input" doesn't exist
    

    I’m so sorry for the disturb, i only find a way to set up my retropie in bluetooth and i see that is impossible, very frustrating, i don’t know how…

    thanks anyway for reading

    #105609
    oscar-caballero
    Participant

    Hi man, I have two issues

    The first one my controller is a liiiiiiitle bit lag.

    And second how on earth do I configure the second controller??

    #112640
    qrayg
    Participant

    Here’s a more detailed setup process. I’ve successfully paired my DS4 controller from a fresh RP install many times using this process:

    # Launch RetroPie Setup

    # Pair Controller via Bluetooth menu in Retropie Setup, very simple
    # Press Ps + Share button on controller to put into pair mode

    # Edit file, x = your MAC address, which is different for every controller
    sudo nano /var/lib/bluetooth/xx:xx:xx:xx:xx:xx/config

    # Copy "class" value from config file
    # In my case, my controller class value was "0x420100"

    # Edit file
    sudo nano /etc/rc.local

    # Paste after "this file does nothing…"
    # Make sure class value = class value from previous step

    #!/bin/bash
    hciconfig device up
    hciconfig set name raspberrypi-0
    hciconfig set class 0x420100
    hciconfig enable iscan
    hciconfig enable pscan

    # Save/Exit
    CTRL + X, Y, Return

    # Reboot
    sudo reboot

    # Run through the normal controller configurations
    # edit /opt/retropie/configs/all/retroarch.cfg
    # find this area and set the values
    input_player1_left_btn = "h0left"
    input_player1_right_btn = "h0right"
    input_player1_up_btn = "h0up"
    input_player1_down_btn = "h0down"

    #112898
    infinitr
    Participant

    Hello,

    Trying to follow this. After I paired the DS4 controller in RetroPie Setup, I got the MAC address, but I do not see a folder in /var/lib/bluetooth with that MAC address. The only one I see is for the bluetooth dongle. Do you mean the dongle MAC?

    If so I set everything up, DS4 pairs, but is not responsive in RetroPie.

    #114961
    nonsense
    Participant

    Hi there,

    I am also having trouble using Dual Shock 4 controller with RetroPie.

    Running bluetoothctl shows that the BT dongle and the joystick controller as paired:

    
    pi@retropie:/dev/input $ bluetoothctl
    [NEW] Controller 5C:F3:70:70:4B:F3 raspberrypi-0 [default]
    [NEW] Device AC:FD:93:BC:9F:6D Wireless Controller
    

    The device appears in /dev/input , but it is not working when trying to test it with jstest

    
    pi@retropie:/dev/input $ ls -la
    total 0
    drwxr-xr-x   2 root root     100 Jan 24 18:03 .
    drwxr-xr-x  14 root root    3260 Jan 24 18:03 ..
    crw-rw----+  1 root input 13, 64 Jan 24 18:03 event0
    crw-rw----+  1 root input 13,  0 Jan 24 18:03 js0
    crw-rw----   1 root input 13, 63 Jan 24 18:00 mice
    

    It appears to be configured at /var/lib/bluetooth:

    
    root@retropie:/var/lib/bluetooth/5C:F3:70:70:4B:F3/AC:FD:93:BC:9F:6D# cat info
    [LinkKey]
    Key=EA60FC62A17B3BBD89485F181C64F63E
    Type=4
    PINLength=0
    
    [General]
    Name=Wireless Controller
    Class=0x002508
    SupportedTechnologies=BR/EDR;
    Trusted=true
    Blocked=false
    Services=00001124-0000-1000-8000-00805f9b34fb;00001200-0000-1000-8000-00805f9b34fb;
    
    [DeviceID]
    Source=2
    Vendor=1356
    Product=1476
    Version=256
    

    Emulation Station shows that “1 gamepad detected”, but clicking any button doesn’t do anything, so ES is stuck on that screen.

    Last but not least, I had to remove sixad, because it was conflicting with the bluetoothd.

    Any ideas how to fix this?

    #114972
    nonsense
    Participant

    Actually I had forgotten to install the “ds4drv” drivers for Dual Shock 4. It works like a charm now. This tutorial explains how to install the drivers: https://www.petrockblock.com/forums/topic/tutorial-retropie-with-dualshock-4-and-bluetooth/

Viewing 14 posts - 1 through 14 (of 14 total)
  • The forum ‘Controller Configuration in RetroPie’ is closed to new topics and replies.