Avatar for tom.gidden

tom.gidden

Member since Jan 2014 • Last active Apr 2017
  • 8 conversations
  • 47 comments

Most recent activity

  • in Puck.js
    Avatar for tom.gidden

    It looks to me like ble_hid_keyboard and ble_hid_controls might be mutually-exclusive. Is it feasible to send commands in both "mechanisms" without a rewrite of those modules?

    In the Adafruit Bluefruit LE services AT command API, I seem to remember it's possible to send both AT+BLEHIDCONTROLKEY and AT+BLEKEYBOARDCODE in the same "session" (so to speak). And, a typical Bluetooth keyboard with media keys can obviously do both media controls and keyboard presses simultaneously.

    I want to be able to send:

    • ble_hid_keyboard.KEY.RIGHT on single click;
    • ble_hid_keyboard.KEY.LEFT on double click;
    • and a control key (specifically control 0xb8 of the 0x0c Consumer Page, described on pg.77 of the HID Usage Tables PDF) on triple click.

    0xb8 is the "Show Keyboard / Eject" key, which should reveal the keyboard on iOS; if you connect even a one-button keyboard in iOS, it assumes you don't want the on-screen keyboard. I don't know of a way to tell iOS that it's a limited "auxiliary" keyboard, so without that, offering the Eject key is a workaround.

    I assume this is part of the HID report definition -- writing a comprehensive definition encompassing both -- but it's a bit beyond me. I'm wondering if @Gordon might know how to create a unified report definition capable of both, having written the two existing HID modules.

  • in Puck.js
    Avatar for tom.gidden

    Okay, that did the trick: I DFU'ed to 1.91, did the lines above, and then DFU'ed to 1.91.715. It now pairs more successfully.

    However, it hasn't been entirely successful. It took about three goes of code tweaking, re-upload, resets, unpair/pair before the iPad would actually do the "page right" function. It's working okay now, even after an NRF.disconnect(). I'll keep an eye on it and see if it stops working again.

    FYI: at least with this firmware, onInit() doesn't seem to work. Once reconnected, dump() yields garbage.

  • in Puck.js
    Avatar for tom.gidden

    Nope.. this build seems to just do a full reset (RGB LEDs all to full for about a second, then off, then a short red blink) when I try to connect to it via Web IDE, or pair it with the iPad.

    I'm going to DFU it again to make sure it's not my code, but I doubt it.

  • in Puck.js
    Avatar for tom.gidden

    It's actually rigid: Thermomorph / Polymorph, ie. polyester plastic that melts in hot water.

    It's so that when I'm relaxing and recovering from back pain, lying down, I can just turn page on iBooks on iPad by sending a "right" keypress. That way I don't have to hold the iPad or reach up to turn page, thus saving my shoulder and upper back muscles from unnecessary tension.

    Incidentally, I haven't managed to get the new firmware talking yet. In fact, it's having trouble connecting to the Web IDE. I think my Mac needs a reboot. Still trying.

  • in Puck.js
    Avatar for tom.gidden

    Ah, okay... I'm DFU'ing that build now, thanks.

    I was thinking exactly of that Pico pass-through code before I wondered if I could use a second puck. I see what you mean about the Catch-22.

    Anyway, I'll try this out. FYI, this is how it's being used:

  • in Puck.js
    Avatar for tom.gidden

    Hey,

    I'm using the HID Keyboard example - espruino.com/Puck.js+Keyboar­d plus simple LED on/off with button press/release - to try to send a single keypress to an iPad.

    While it sometimes works, once it's cut off it does nothing: the LED still lights when pressed so the code's still working, but there's no effect on the iPad. The Puck is still paired and connected with the iPad.

    Now, I've noticed github.com/espruino/Espruino/iss­ues/1101 and some other ideas, but what's really tricky is the limitation that the Puck must be disconnected from the IDE to pair it with the iPad: only one connection at a time. It means I have no error messages visible to debug the problem.

    My NoName™ FT232 USB-to-serial board is not working for some reason - probably lack of flow control - and the wiring is unwieldy, so I was thinking the other Puck I got from Kickstarter might be an easy way to do it. Failing that, I might rope a spare Pico in to act as a dumb serial converter.

    So, I guess my question is, what's a straightforward way to cross-connect the serials of one Puck with another Puck, so the IDE (or at least the command-line errors) can be viewed while still connected as a HID device? Or, any other approaches to try?

    Thanks,
    Tom

  • in Puck.js
    Avatar for tom.gidden

    +2

Actions