RPi2: Support for Fire TV Stick remote (Bluetooth)

No those alternative keymaps are not working for me either - as you say they load but don’t work.

I think the issue is that on the Fire TV the remote must present itself as a “keyboard” device, thus the keyboard tags in the xml file, however on OSMC it probably presents itself as a “remote” device since the keystrokes are passed to Kodi over a lirc socket. So in theory the tags would need changing to remote instead of keyboard, however when I tried that it still didn’t work! So a bit more investigation is needed…

Ok the Fire TV Stick remote is definitely detected as a remote (not a keyboard) in Kodi in OSMC:

10:14:25 1630.323608 T:1957511168   DEBUG: LIRC: Update - NEW at 621554:67 0 KEY_UP linux-input-layer (KEY_UP)
10:14:25 1630.323975 T:1957511168   DEBUG: OnKey: 166 (0xa6) pressed, action is Up
10:14:26 1630.746216 T:1957511168   DEBUG: LIRC: Update - NEW at 621977:67 0 KEY_UP_UP linux-input-layer (KEY_UP_UP)
10:14:28 1633.378906 T:1957511168   DEBUG: LIRC: Update - NEW at 624610:67 0 KEY_UP linux-input-layer (KEY_UP)
10:14:28 1633.379150 T:1957511168   DEBUG: OnKey: 166 (0xa6) pressed, action is Up
10:14:28 1633.565186 T:1957511168   DEBUG: LIRC: Update - NEW at 624796:67 0 KEY_UP_UP linux-input-layer (KEY_UP_UP)

The first button press is the UP button on the Fire TV Stick remote, the second button press is the UP button on my OSMC (Vero) remote connected via a GPIO IR receiver, and they are identical scan codes, so whatever works for the osmc remote and other IR remotes (in terms of key mappings) should work for the Fire TV stick remote too. I’ll see if I can work out what’s missing.

This is independent of the commit to add Fire TV stick remote support though - the key mappings there should be fine, customising the actions of the key mappings in a remote.xml / keyboard.xml is a separate issue.

Ok figured it out. I’ve had to rewrite it quite a bit due to it being detected as a remote instead of a keyboard, in particular as well as changing all the keyboard tags to remote tags I had to make these changes:

menu -> title
rewind -> reverse
fastforward -> forward
browser_home -> start
backspace -> back
browser_back -> back
play_pause -> play

I also deleted a few spurious duplicates. Here is a version of the FireTV profile 4 (the one I like) to work under OSMC:

<?xml version="1.0" encoding="UTF-8"?>
<keymap>
  <Global>
    <remote>
      <reverse>PageUp</reverse>
      <forward>PageDown</forward>
      <start>ActivateWindow(Home)</start>
      <title>ContextMenu</title>
    </remote>
  </Global>
  <Home>
    <remote>
      <title>ActivateWindow(Favourites)</title>
    </remote>
  </Home>
  <FullscreenVideo>
    <remote>
      <title>smallstepback</title>
      <back>Stop</back>
      <reverse>Rewind</reverse>
      <forward>FastForward</forward>
    </remote>
  </FullscreenVideo>
  <VideoOSD>
    <remote>
      <title>CodecInfo</title>
    </remote>
  </VideoOSD>
  <FullscreenLiveTV>
    <remote>
      <title>ActivateWindow(pvrosdchannels)</title>
    </remote>
  </FullscreenLiveTV>
  <pvrosdchannels>
    <remote>
      <title>back</title>
    </remote>
  </pvrosdchannels>
  <MyFiles>
    <remote>
      <play>Highlight</play>
    </remote>
  </MyFiles>
  <virtualkeyboard>
    <remote>
      <title>shift</title>
      <play>enter</play>
      <reverse>backspace</reverse>
      <forward>number0</forward>
      <back>PreviousMenu</back>
    </remote>
  </virtualkeyboard>
  <Visualisation>
    <remote>
      <back>Fullscreen</back>
    </remote>
  </Visualisation>
  <Favourites>
    <remote>
      <back>Close</back>
    </remote>
  </Favourites>
  <NumericInput>
    <remote>
      <back>Close</back>
    </remote>
  </NumericInput>
  <PVROSDChannels>
    <remote>
      <back>Close</back>
    </remote>
  </PVROSDChannels>
  <PVROSDGuide>
    <remote>
      <back>Close</back>
    </remote>
  </PVROSDGuide>
  <PVROSDDirector>
    <remote>
      <back>Close</back>
    </remote>
  </PVROSDDirector>
  <PVROSDCutter>
    <remote>
      <back>Close</back>
    </remote>
  </PVROSDCutter>
  <MyTVSettings>
    <remote>
      <back>PreviousMenu</back>
    </remote>
  </MyTVSettings>
</keymap>

Just download it to an xml file and drop it in your keymaps folder. I’ve tested it and it seems to perform functionally identically to the original version of the script on a Fire TV stick, except you also have the use of the home button (that is reserved on a Fire TV to go to the Fire TV home) which acts as a Kodi home button here.

The addition of this remote.xml makes the Fire TV remote quite a nice remote to use with OSMC. The only thing I miss is the lack of a dedicated info button, although info can be obtained through the context menu on lists or the OSD during video playback.

That keymap works perfect - many thanks!

I am assuming this requires a Bluetooth USB adapter?

Yes. Also the support for the Fire TV Stick remote discussed in this thread hasn’t been pushed out to users yet - so you could either make the changes described above yourself, (the udev and evmap files) or wait for the next monthly update.

Just want to say thanks, this worked brilliantly. Very easy to setup too!

What update has this been added?
thanks

This was added to the July update which landed a couple of days late (in August)

Sam

Fire Stick Remote works great but I have to go into MyOSMC/Network/Bluetooth and reconnect the remote every time I reboot the RPi2. Is there any way that it reconnects by itself? If I remember correctly OpenELEC did this as soon as I clicked a remote button.

Thanks

It automatically reconnects for me just fine.

After OSMC reboots you will need to press any button on the remote to tell the remote to attempt to reconnect - this can take 5-10 seconds from the time you press a button until Kodi starts responding to it.

Can’t think of any reason off hand why this would not work for you unless your Bluetooth dongle is not properly supported on OSMC.

Can you run ‘bluetoothctl’ from the command line in ssh, you should see the MAC address of the fire tv remote - type ‘info mac’ where mac is the mac address you just found, then paste the results here.

For the remote to be able to reconnect by itself you must see Trusted: yes.

After Reboot (doesn’t work)

    Name: Amazon Fire TV Remote
    Alias: Amazon Fire TV Remote
    Class: 0x00050c
    Paired: no
    Trusted: yes
    Blocked: no
    Connected: no
    LegacyPairing: no
    UUID: Service Discovery Serve.. (00001000-0000-1000-8000-00805f9b34fb)
    UUID: Human Interface Device... (00001124-0000-1000-8000-00805f9b34fb)
    UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
    Modalias: usb:v1949p0404d011B

After manual reconnecting

Name: Amazon Fire TV Remote
Alias: Amazon Fire TV Remote
Class: 0x00050c
Paired: yes
Trusted: yes
Blocked: no
Connected: yes
LegacyPairing: no
UUID: Service Discovery Serve… (00001000-0000-1000-8000-00805f9b34fb)
UUID: Human Interface Device… (00001124-0000-1000-8000-00805f9b34fb)
UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb)
Modalias: usb:v1949p0404d011B

This is really odd, the device seems even not be paired. I am not sure if remotes act differently but for my speaker when it is not connected (switched off) it is shown as:

Device 08:DF:1F:21:CB:03
Name: Bose Mini SoundLink
Alias: Bose Mini SoundLink
Class: 0x240428
Icon: audio-card
Paired: yes
Trusted: yes
Blocked: no
Connected: no
LegacyPairing: no
UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
UUID: Advanced Audio Distribu… (0000110d-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)

The remote is not paired. This will prevent it automatically connecting.

Choose disconnect and Forget, then make sure you use the Pair with Pin option not the Connect without PIN option when pairing. (Make sure you are on the latest version of OSMC first)

You have probably used the latter option which does not pair with the device.

I had it paired without the PIN, yes. Does anyone know what the PIN is for the Fire TV Stick remote? (it’s not 0000)

You don’t need to enter a pin. Just choose to pair with pin however it will not ask for a PIN.

Well, it did ask for a PIN though… :confused:
Latest OSMC build.

Try 0000 or 1234 then.

I have never had to enter a pin when pairing mine however.

1 Like

where do i find the the udev and evmap files??

Why are you asking this question in a 1.5 year old thread? You’d probably get a better response by actually asking a detailed question.