Bluefruit EZ-Key key remapping

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
jeffv
 
Posts: 11
Joined: Fri Feb 22, 2013 2:55 pm

Bluefruit EZ-Key key remapping

Post by jeffv »

Hi,

I'm having challenges remapping the keys in the Bluefruit EZ-Key (which is a fantastic product - sending keys via Bluetooth in about 10 minutes!)

Installed Processing 1.5.1 on a Windows 8.1 (Surface Pro) box and the ControlP5 library. I've tried both wireless methods and get errors, a null pointer exception. Looks like something in the loop looking for the HID "Bluefruit" or "EZ-Key" string breaks for some reason.

Moving along to the wired method, I do get the "Adafruit Bluefruit HID v1.2 11/04/2013, Remap ready!" message, but clicking the grey box yields no OK message from the module, and the keys do not change map. A println() inserted shows I'm getting the mouse click, just nothing back from the module. TX and RX LEDs flash on the FTDI friend. I did get the following warning, and resolved it, but still no answer back from the module.

From:
"WARNING: RXTX Version mismatch
Jar version = RXTX-2.2pre1
native lib Version = RXTX-2.2pre2"
To:
Found Serial ports:
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
[0] "COM3"

Anyone have any ideas on how I might proceed?

Thanks.
Jeff

Deqing
 
Posts: 37
Joined: Wed Nov 13, 2013 12:18 pm

Re: Bluefruit EZ-Key key remapping

Post by Deqing »

Could you upload a screenshot of wireless error? And also paste the error message?
Thanks

User avatar
jeffv
 
Posts: 11
Joined: Fri Feb 22, 2013 2:55 pm

Re: Bluefruit EZ-Key key remapping

Post by jeffv »

Sure. I figured the wired method was fail-safe and simpler, but got stymied there to.

For GUI_EZKey_remapper:
ControlP5 1.5.2 infos, comments, questions at http://www.sojamo.de/libraries/controlP5
Using library: hidapi-windows.dll
Native library loaded
Listing HID devices
SAM
SAM
SAM
SAM
MICROSOFT
null
java.lang.NullPointerException
at GUI_EZKey_remapper.start_HID_transfer(GUI_EZKey_remapper.java:755)
at GUI_EZKey_remapper.send_map(GUI_EZKey_remapper.java:376)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at controlP5.ControlBroadcaster.invokeMethod(Unknown Source)
at controlP5.ControlBroadcaster.callTarget(Unknown Source)
at controlP5.ControlBroadcaster.broadcast(Unknown Source)
at controlP5.Controller.broadcast(Unknown Source)
at controlP5.Button.setValue(Unknown Source)
at controlP5.Button.activate(Unknown Source)
at controlP5.Button.mouseReleased(Unknown Source)
at controlP5.Controller.setMousePressed(Unknown Source)
at controlP5.ControllerGroup.setMousePressed(Unknown Source)
at controlP5.ControlWindow.mouseReleasedEvent(Unknown Source)
at controlP5.ControlWindow.mouseEvent(Unknown Source)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at processing.core.PApplet$RegisteredMethods.handle(Unknown Source)
at processing.core.PApplet.handleMouseEvent(Unknown Source)
at processing.core.PApplet.dequeueMouseEvents(Unknown Source)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)

For HID_EZKey_emapper:
Using library: hidapi-windows.dll
Native library loaded
Listing HID devices
SAM
SAM
SAM
SAM
MICROSOFT
null
java.lang.NullPointerException
at HID_EZKey_remapper.start_HID_transfer(HID_EZKey_remapper.java:323)
at HID_EZKey_remapper.setup(HID_EZKey_remapper.java:70)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)

User avatar
jeffv
 
Posts: 11
Joined: Fri Feb 22, 2013 2:55 pm

Re: Bluefruit EZ-Key key remapping

Post by jeffv »

Also the screenshot:
Attachments
GUI_mapping.PNG
GUI_mapping.PNG (33.16 KiB) Viewed 1323 times

Deqing
 
Posts: 37
Joined: Wed Nov 13, 2013 12:18 pm

Re: Bluefruit EZ-Key key remapping

Post by Deqing »

Seems "info.getProduct_string()" returns a null object.
Would you mind try this?
Attachments
GUI_EZKey_remapper_null.zip
(229.51 KiB) Downloaded 72 times

User avatar
jeffv
 
Posts: 11
Joined: Fri Feb 22, 2013 2:55 pm

Re: Bluefruit EZ-Key key remapping

Post by jeffv »

Yep. Got the following results: Note that the the Bluefruit is in fact installed. I can use the default key assignments and I can see that Bluefruit is installed. I've attached some screen captures from the device manager. Thanks.


ControlP5 1.5.2 infos, comments, questions at http://www.sojamo.de/libraries/controlP5
Using library: hidapi-windows.dll
Native library loaded
Listing HID devices
SAM
SAM
SAM
SAM
MICROSOFT
null
SAM
SAM
Atmel maXTouch Digitizer
MICROSOFT
Microsoft Bluetooth Notebook Mouse 5000
Microsoft Bluetooth Notebook Mouse 5000
Microsoft Bluetooth Notebook Mouse 5000
MICROSOFT
Atmel maXTouch Control
MICROSOFT
Could not find Bluefruit
Attachments
Bluefruit.PNG
Bluefruit.PNG (10.83 KiB) Viewed 1311 times
HIDList.PNG
HIDList.PNG (72.61 KiB) Viewed 1311 times
devicemanager.PNG
devicemanager.PNG (65.1 KiB) Viewed 1311 times

User avatar
jeffv
 
Posts: 11
Joined: Fri Feb 22, 2013 2:55 pm

Re: Bluefruit EZ-Key key remapping

Post by jeffv »

Just an observation. If I don't put the Bluefruit module in the mapping mode, I get the following different message:

ControlP5 1.5.2 infos, comments, questions at http://www.sojamo.de/libraries/controlP5
Using library: hidapi-windows.dll
Native library loaded
Listing HID devices
SAM
SAM
SAM
SAM
MICROSOFT
null
SAM
SAM
Atmel maXTouch Digitizer
MICROSOFT
Microsoft Bluetooth Notebook Mouse 5000
Microsoft Bluetooth Notebook Mouse 5000
Microsoft Bluetooth Notebook Mouse 5000
MICROSOFT
Atmel maXTouch Control
MICROSOFT
Bluefruit EZ-Key
Bluefruit EZ-Key
Bluefruit EZ-Key
Bluefruit EZ-Key

Start Commnucation, Reset command transmitted
Module response: Raw RST OK
Module response: CS:A3 Ptr00
Checksum Match : )
Module response: CS:9F Ptr10
Checksum Match : )
Module response: CS:54 Ptr20
Checksum Match : )
Module response: CS:3D Ptr30
Checksum Match : )
Module response: CS:1E Ptr40
Checksum Match : )
Module response: CS:1D Ptr50
Checksum Match : )
Module response: CS:00 Ptr60
Checksum Match : )
Module response: CS:00 Ptr70
Checksum Match : )
Module response: CS:0E Ptr80 Over

Deqing
 
Posts: 37
Joined: Wed Nov 13, 2013 12:18 pm

Re: Bluefruit EZ-Key key remapping

Post by Deqing »

Right!
Remap mode is for UART remap only. And in remap mode it will not connect to computer so that wireless remap won't work.

User avatar
jeffv
 
Posts: 11
Joined: Fri Feb 22, 2013 2:55 pm

Re: Bluefruit EZ-Key key remapping

Post by jeffv »

An update. Moved the"wired" key remapping project to a Windows 7 box. I don't have Bluetooth on this machine (yet). Installed Processing 1.5.1. Resolved the RXTX mismatch issue (from here http://forum.processing.org/one/topic/r ... match.html). Fired up "processing_remap". Got the following after putting the module into remap mode;

s00000400000000000000050000000000000006000000000000000700000000000000080000000000000009000000000000000A000000000000000B000000000000000C000000000000000D000000000000000E000000000000000F0000000000000000000000000000000000000000000000000000000000000000000000000072
Found Serial ports:
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
[0] "COM3"

Adafruit Bluefruit HID v1.2 11/04/2013
Remap ready!

Pressed the grey rectangle and get nothing in return (same as Windows 8.1).

What now?

Thanks.
Jeff

Deqing
 
Posts: 37
Joined: Wed Nov 13, 2013 12:18 pm

Re: Bluefruit EZ-Key key remapping

Post by Deqing »

So you mentioned that RX TX LEDs blinks when you press the grey rectangle?
That means processing sketch sends some data. And you can see the "Remap ready" message means the RX on FTDI works. I suspect there is some lose connection between TX of FTDI friend and RX of Bluefruit. Please check if it is the problem?

User avatar
jeffv
 
Posts: 11
Joined: Fri Feb 22, 2013 2:55 pm

Re: Bluefruit EZ-Key key remapping

Post by jeffv »

Reheated the pins in case I had a cold solder joint. That didn't seem to help. Noticed that the serial waveform looked pretty noisey. Added a Ground wire from Bluefruit to FTDI. Problem fixed!

User avatar
jcarrera
 
Posts: 2
Joined: Tue Aug 20, 2013 5:11 pm

Re: Bluefruit EZ-Key key remapping

Post by jcarrera »

So, I see that the wired remapping problem was addressed with a ground wire to clean up the signal but I don't see that the original wireless remapping problem was fixed. I'm having the same issue and I'm curious to know if there's an update. I tried the "_null" version of the processing sketch (attached to a previous post) and got the same "Could not find Bluefruit" error. The device shows up in my bluetooth list and is fully functional otherwise so it would seem that there might be an error in the remapping sketch.

Any thoughts on this?

User avatar
jeffv
 
Posts: 11
Joined: Fri Feb 22, 2013 2:55 pm

Re: Bluefruit EZ-Key key remapping

Post by jeffv »

I got the wireless re-mapping to reliably work on the Windows 7 box. I had to add Bluetooth on that PC to do so. I didn't revisit the Windows 8.1 PC, but I suspect some underlying issue with possible changes under the hood of Windows 8.1.

User avatar
uchobby
 
Posts: 6
Joined: Wed Feb 12, 2014 6:59 pm

Re: Bluefruit EZ-Key key remapping

Post by uchobby »

I found two issues with the key remapping. In the non-GUI Processing application.
1) some of the devices on my system report "null" on the info.getProduct_string() call in module HID_stuff, this kills the program.
I inserted if(info.getProduct_string()==null) continue; just after the for loop start to fix this.

2) documentation indicates that you can program a sequence of up to 6 keys but I could not make more than 4 work. For example...
hid_keys.set_key_report(2, MODIFIER_NONE, KEY_S, KEY_T, KEY_A, KEY_RETURN, KEY_NONE, KEY_NONE); Generates "sta<return>" as expected.
hid_keys.set_key_report(2, MODIFIER_NONE, KEY_S, KEY_T, KEY_A, KEY_R, KEY_T, KEY_RETURN); Only sends "star"

(EDIT) issue 2 is resolved. The programming is not to setup a key sequence. Its to set which key codes are sent for a single key event. Even though you can put in a sequence of keys and see those key in sequence, the device is treating it like all the keys are pressed at the same time. Therefore you cant have the T key pressed at the same time twice...

I assume what happens above is that it presses down each key in sequence showing all of them down at the same time, when it gets to the T key it see's its already down and then aborts.

User avatar
uchobby
 
Posts: 6
Joined: Wed Feb 12, 2014 6:59 pm

Re: Bluefruit EZ-Key key remapping

Post by uchobby »

jeffv wrote:I got the wireless re-mapping to reliably work on the Windows 7 box. I had to add Bluetooth on that PC to do so. I didn't revisit the Windows 8.1 PC, but I suspect some underlying issue with possible changes under the hood of Windows 8.1.
I did successfully remap keys, wirelessly, on my Win 8.1 machine..

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”