• I have an NVidia Shield TV which supports bluetooth controllers. I also have a universal remote which comes with a hardwired box with HDMI connection, LAN connection and IR and Bluetooth radio's on board. At first, they promised supporting the NVidia Shield TV, but they never got around on implementing that. Recently they've added control over HDMI-CEC, but my setup doesn't cater for it and not all customers have HDMI-CEC capabilities at home.

    So i've set my mind on writing my own custom driver (which is supported) and i've already implemented my first custom driver for my set top box. These drivers are written in NodeJS. So i've searched the web for a BLE HID implementation in NodeJS (i ended up with Noble) but i never found a working example. What i did find are various implementations for the espressif chip, which eventually led me to here.

    Since your javascript counterpart can interface with Noble, i was hoping that i can use Puck.js, with Noble in my own NodeJS application to advertise as HID device, pair with my Shield TV and then use any external input, e.g. MQTT, Website etc. to send keystrokes or button presses to the Shield TV.

    Long story short; can this be done with Puck.js + Noble, running on Linux hardware with a USB BLE dongle setup correctly?

    Ideally, if not yet paired to an NVidia Shield, the solution needs to start in 'advertising' mode, so i can pair it from my NVidia shield, then after seen as 'ble_hid_controls' device from the Shield, i think i can work from there...

  • The Puck itself will be a HID device just fine, but I guess your issue is then controlling it, because it'll already be connected to the NVidia shield (and it can only have one incoming connection at a time).

    The Puck itself can still make an outgoing BLE connection though (or could just scan for advertisements over Bluetooth), so you could put bleno on your box and work that way, but that will really hurt the power consumption - you could just use a (cheaper) MDBT42 Breakout and wire it up to get power from USB or something.

    Of course you've got a Raspberry Pi so you could just wire the MDBT42 breakout to the Pi's UART pins and control it that way.

    One more thing you could consider is to solder a Infrared receiver to Puck.js. It could then receive IR commands from your box, and then transfer those into Bluetooth HID commands for the shield.

  • Thanx for the reply @Gordon actually i don't own any pucks, so i was wondering if it could be done by software alone.. E.g. in this example http://www.espruino.com/BLE+Keyboard there is this snippet;

    var controls = require("ble_hid_controls");
    NRF.setServices(undefined, { hid : controls.report });

    What services does it create? What characteristics does it expose? which code does it call in NRF or Noble eventually?

  • Oh right - the report descriptors and stuff are here: http://www.espruino.com/modules/ble_hid_­keyboard.js

    But honestly I'm not 100% sure on the services it exposes - there are a whole bunch of them. You may be able to reverse engineer them from https://github.com/espruino/Espruino/blo­b/e06b3e24de42adb1de6e2cc6046e525880760e­7d/targetlibs/nrf5x_12/components/ble/bl­e_services/ble_hids/ble_hids.c I guess

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

HID with Puck.js + BLENO on RPI + pair, can my idea be realized?

Posted by Avatar for Gilles0181 @Gilles0181