{"id":213,"date":"2017-07-13T21:33:13","date_gmt":"2017-07-13T21:33:13","guid":{"rendered":"http:\/\/simon.aldrich.eu\/blog\/?p=213"},"modified":"2017-07-13T21:34:42","modified_gmt":"2017-07-13T21:34:42","slug":"linux-bluetooth-gamepad","status":"publish","type":"post","link":"https:\/\/simon.aldrich.cc\/blog\/2017\/07\/linux-bluetooth-gamepad\/","title":{"rendered":"Pairing a bluetooth Intsun\/Terios T3 gamepad on Linux"},"content":{"rendered":"<p>These instructions are mostly for my later convenience but if you have an Intsun or Terios T3 bluetooth gamepad that you want to pair with Linux via the command line they might help you out.<\/p>\n<p>These instructions assume you have a bluetooth dongle that is recognised by your kernel. I&#8217;ve had success with <a href=\"https:\/\/www.amazon.co.uk\/Racksoy-Professional-Bluetooth-Adapter-Compatible\/dp\/B00KNPTHS8\/ref=sr_1_1?ie=UTF8&amp;qid=1499974263&amp;sr=8-1&amp;\" target=\"_blank\" rel=\"noopener\">this one<\/a>. These steps worked for me on Ubuntu 16.04 LTS.<\/p>\n<ol>\n<li>Install the following packages:<br \/>\n<code>$ sudo apt-get install bluez joystick<\/code><\/li>\n<li>Put the gamepad in bluetooth pairing mode by holding down the X and Home buttons simultaneously. The LED ring around the home button should now start blinking rapidly.<\/li>\n<li>Start the interactive command-line interface to the bluetooth stack bluetoothctl<br \/>\n<code>$ sudo bluetoothctl<br \/>\n[NEW] Controller XX:XX:XX:XX:XX:XX live-0 [default]<\/code><br \/>\nFor readability I&#8217;ll put the typed commands in <span style=\"color: #0000ff;\">blue<\/span> from here on.<\/li>\n<li>Next power on your bluetooth interface and make it discoverable (maybe not strictly necessary):<br \/>\n<code>[bluetooth]# <span style=\"color: #0000ff;\">power on<\/span><br \/>\nChanging power on succeeded<br \/>\n[bluetooth]# <span style=\"color: #0000ff;\">discoverable on<\/span><br \/>\nChanging discoverable on succeeded<br \/>\n[CHG] Controller XX:XX:XX:XX:XX:XX Discoverable: yes<\/code><\/li>\n<li>Register as the default agent:<br \/>\n<code>[bluetooth]# <span style=\"color: #0000ff;\">agent on<\/span><br \/>\nAgent registered<br \/>\n[bluetooth]# <span style=\"color: #0000ff;\">default-agent<\/span><br \/>\nDefault agent request successful<\/code><\/li>\n<li>Start scanning to look for discoverable devices:<br \/>\n<code>[bluetooth]# <span style=\"color: #0000ff;\">scan on<\/span><br \/>\nDiscovery started<br \/>\n[CHG] Controller XX:XX:XX:XX:XX:XX Discovering: yes<\/code><\/li>\n<li>After a few seconds the devices command should list your gamepad:<br \/>\n<code>[bluetooth]# <span style=\"color: #0000ff;\">devices<\/span><br \/>\n[NEW] Device YY:YY:YY:YY:YY:YY Bluetooth Gamepad<\/code><\/li>\n<li>It seems that PIN-less pairing requires that the device be trusted first:<br \/>\n<code>[bluetooth]# <span style=\"color: #0000ff;\">trust YY:YY:YY:YY:YY:YY<\/span><br \/>\n[CHG] Device YY:YY:YY:YY:YY:YY Trusted: yes<br \/>\nChanging YY:YY:YY:YY:YY:YY trust succeeded<\/code><\/li>\n<li>Try to pair with the gamepad:<br \/>\n<code>[bluetooth]# <span style=\"color: #0000ff;\">pair YY:YY:YY:YY:YY:YY<\/span><br \/>\nAttempting to pair with YY:YY:YY:YY:YY:YY<br \/>\n[CHG] Device YY:YY:YY:YY:YY:YY Connected: yes<br \/>\n[CHG] Device YY:YY:YY:YY:YY:YY Modalias: usb:v1949p0402d011B<br \/>\n[CHG] Device YY:YY:YY:YY:YY:YY UUIDs: 00001124-0000-1000-8000-00805f9b34fb<br \/>\n[CHG] Device YY:YY:YY:YY:YY:YY UUIDs: 00001200-0000-1000-8000-00805f9b34fb<br \/>\n[CHG] Device YY:YY:YY:YY:YY:YY Paired: yes<br \/>\nPairing successful<\/code><\/li>\n<li>Connect to the gamepad:<br \/>\n<code>[bluetooth]# <span style=\"color: #0000ff;\">connect YY:YY:YY:YY:YY:YY<\/span><br \/>\nAttempting to connect to YY:YY:YY:YY:YY:YY<\/code><\/li>\n<li>Quit bluetoolctl:<br \/>\n<code>[bluetooth]# <span style=\"color: #0000ff;\">quit<\/span><br \/>\nAgent unregistered<br \/>\n[DEL] Controller XX:XX:XX:XX:XX:XX live-0 [default]<\/code><\/li>\n<\/ol>\n<p>All being well the gamepad LEDs will now stop flashing and a single one will be illuminated.<\/p>\n<p>You can test the gamepad using the jstest command:<br \/>\n<code>jstest \/dev\/input\/js0<\/code><br \/>\n(your device name may vary)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>These instructions are mostly for my later convenience but if you have an Intsun or Terios T3 bluetooth gamepad that you want to pair with Linux via the command line they might help you out. These instructions assume you have a bluetooth dongle that is recognised by your kernel. I&#8217;ve had success with this one. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":215,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5],"tags":[62,64,65,63,17,32],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/simon.aldrich.cc\/blog\/wp-content\/uploads\/2017\/07\/TeriosT3.jpg?fit=1570%2C860&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p2Rw4E-3r","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/simon.aldrich.cc\/blog\/wp-json\/wp\/v2\/posts\/213"}],"collection":[{"href":"https:\/\/simon.aldrich.cc\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/simon.aldrich.cc\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/simon.aldrich.cc\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/simon.aldrich.cc\/blog\/wp-json\/wp\/v2\/comments?post=213"}],"version-history":[{"count":5,"href":"https:\/\/simon.aldrich.cc\/blog\/wp-json\/wp\/v2\/posts\/213\/revisions"}],"predecessor-version":[{"id":219,"href":"https:\/\/simon.aldrich.cc\/blog\/wp-json\/wp\/v2\/posts\/213\/revisions\/219"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/simon.aldrich.cc\/blog\/wp-json\/wp\/v2\/media\/215"}],"wp:attachment":[{"href":"https:\/\/simon.aldrich.cc\/blog\/wp-json\/wp\/v2\/media?parent=213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/simon.aldrich.cc\/blog\/wp-json\/wp\/v2\/categories?post=213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/simon.aldrich.cc\/blog\/wp-json\/wp\/v2\/tags?post=213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}