Reading HID Feature Reports on Windows

113 views
Skip to first unread message

Alexander Nitsch

unread,
Sep 13, 2014, 3:09:49 PM9/13/14
to psm...@googlegroups.com
I am currently integrating my Windows pairing routine [1] into PS Move
API's psmovepair utility. Since I had to set up a Windows test machine
for testing and development, I could finally look into other parts of
the API's behaviour on Windows more thoroughly.

One thing (among others) I noticed is a difference between Linux's Bluez
and Windows when it comes to reading HID Feature Reports. For example,
on Windows XP SP3, I cannot read Feature Report 0xF9 which contains the
Move's firmware info.

The PS Move API contains the psmove_get_firmware_info utility for
reading Feature Report 0xF9. It would be great if some of the Windows
users reading this mail could run a few tests using this utility and
report their results. I would be interested in the following:

1. Which version of Windows are you running?
2. Can the firmware info be read using a USB connection?
3. Can the firmware info be read using a Bluetooth connection?

Bonus question (for the hackers):

4. Does it make a difference when switching to hidapi's alternative
implementation of hid_get_feature_report()?

To enable said alternative implementation, just clone a special fork of
the project that I set up:

git clone --branch alt-read-feature --recursive
https://github.com/nitsch/psmoveapi.git psmoveapi_for_hackers

Compile this PS Move API project as you would normally do and then run
the psmove_get_firmware_info utility, again testing with USB and with
Bluetooth connection.


Thanks,

Alex


[1] https://github.com/nitsch/psmove-pair-win

gilc

unread,
Sep 22, 2014, 1:20:34 PM9/22/14
to psm...@googlegroups.com, nit...@ht.tu-berlin.de
Alex,

I have tested this on my Windows 7 x64 PC and was unable to get the firmware info via USB nor Bluetooth using your modified hacker's version or the unmodified version of psmove_get_firmware_info.exe

Gil

Alexander Nitsch

unread,
Sep 22, 2014, 1:52:23 PM9/22/14
to psm...@googlegroups.com
> I have tested this on my Windows 7 x64 PC and was unable to get the
> firmware info via USB nor Bluetooth using your modified hacker's
> version or the unmodified version of psmove_get_firmware_info.exe

Thanks a lot for testing! It would also be interesting to know if
Windows 8 behaves differently (which I doubt)? Could you test that as well?

Linux's BlueZ seems to be the Bluetooth implementation that works best
with the Move. On Windows a few features are not working, and OS X seems
to be worst in this respect.


Alex

Gil

unread,
Sep 22, 2014, 2:41:22 PM9/22/14
to psm...@googlegroups.com
I did try this on my Windows 8.1 x64 PC as well and it fails with the following:

E:\psmoveapi\my_build>psmove_get_firmware_info.exe
[PSMOVE CRITICAL] Assertion fail in psmove_calibration_new: Could not determine serial from controller
[PSMOVE CRITICAL] Assertion fail in psmove_calibration_supported: calibration != NULL
[PSMOVE CRITICAL] Assertion fail in psmove_get_magnetometer_calibration_filename: serial != NULL
[PSMOVE WARNING] Magnetometer in (null) not yet calibrated.
Serial: (null)
[PSMOVE CRITICAL] Assertion fail in _psmove_get_firmware_info: res == expected_res
Failed to retrieve firmware info.

With your version:

E:\AN_psmoveapi\psmoveapi\mybuild>psmove_get_firmware_info.exe
[PSMOVE CRITICAL] Assertion fail in psmove_calibration_new: Could not determine serial from controller
[PSMOVE CRITICAL] Assertion fail in psmove_calibration_supported: calibration != NULL
[PSMOVE DEBUG] Can't create orientation - no calibration!
[PSMOVE CRITICAL] Assertion fail in psmove_get_magnetometer_calibration_filename: serial != NULL
[PSMOVE WARNING] Magnetometer in (null) not yet calibrated.
Serial: (null)
[PSMOVE CRITICAL] Assertion fail in _psmove_get_firmware_info: res == expected_res
Failed to retrieve firmware info.

Gil
--
You received this message because you are subscribed to the Google Groups "psmove" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psmove+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/psmove.
For more options, visit https://groups.google.com/d/optout.

Alexander Nitsch

unread,
Sep 22, 2014, 3:50:00 PM9/22/14
to psm...@googlegroups.com
> I did try this on my Windows 8.1 x64 PC as well and it fails with the following:
>
> E:\psmoveapi\my_build>psmove_get_firmware_info.exe
> [PSMOVE CRITICAL] Assertion fail in psmove_calibration_new: Could not determine serial from controller
> [PSMOVE CRITICAL] Assertion fail in psmove_calibration_supported: calibration != NULL
> [PSMOVE CRITICAL] Assertion fail in psmove_get_magnetometer_calibration_filename: serial != NULL
> [PSMOVE WARNING] Magnetometer in (null) not yet calibrated.
> Serial: (null)
> [PSMOVE CRITICAL] Assertion fail in _psmove_get_firmware_info: res == expected_res
> Failed to retrieve firmware info.

Wow, we cannot even determine the Bluetooth device address on Windows 8?
Hm, maybe this has something to do with the way you managed to get the
controller to connect.

Only running with USB connection did work without modifying the
registry, right? Do the same problems as in the above listing occur in
this mode?


> With your version:
>
> E:\AN_psmoveapi\psmoveapi\mybuild>psmove_get_firmware_info.exe
> [PSMOVE CRITICAL] Assertion fail in psmove_calibration_new: Could not determine serial from controller
> [PSMOVE CRITICAL] Assertion fail in psmove_calibration_supported: calibration != NULL
> [PSMOVE DEBUG] Can't create orientation - no calibration!
> [PSMOVE CRITICAL] Assertion fail in psmove_get_magnetometer_calibration_filename: serial != NULL
> [PSMOVE WARNING] Magnetometer in (null) not yet calibrated.
> Serial: (null)
> [PSMOVE CRITICAL] Assertion fail in _psmove_get_firmware_info: res == expected_res
> Failed to retrieve firmware info.

Are you sure this is "my" version, i.e. the branch called
"alt-read-feature"? I added a console output right before the last
assert in this list, but I cannot see it in your listing.


Alex

Gil

unread,
Sep 22, 2014, 5:00:08 PM9/22/14
to psm...@googlegroups.com
Alex,

I'll need to check this out again using your version. I'm pretty sure I did not get the right branch for your alt-read-feature.

Give me a little time to do this but I'll check it again.

As for the USB connection, no, it did not work when connected via USB either.

Gil

-----Original Message-----
From: psm...@googlegroups.com [mailto:psm...@googlegroups.com] On Behalf Of Alexander Nitsch
Sent: Monday, September 22, 2014 2:50 PM
To: psm...@googlegroups.com
Subject: Re: [psmove] Re: Reading HID Feature Reports on Windows

gilc

unread,
Sep 22, 2014, 10:44:26 PM9/22/14
to psm...@googlegroups.com, nit...@ht.tu-berlin.de
Ok, I think I got the correct branch this time. I only see an additional printout for the "Feature Read result = 0". 

Windows 8.1 x64

Here's the result of a Bluetooth connection:

E:\AN_psmoveapi\psmoveapi_alt\my_build>psmove_get_firmware_info.exe
[PSMOVE CRITICAL] Assertion fail in psmove_calibration_new: Could not determine serial from controller
[PSMOVE CRITICAL] Assertion fail in psmove_calibration_supported: calibration != NULL
[PSMOVE DEBUG] Can't create orientation - no calibration!
[PSMOVE CRITICAL] Assertion fail in psmove_get_magnetometer_calibration_filename: serial != NULL
[PSMOVE WARNING] Magnetometer in (null) not yet calibrated.
Serial: (null)
Feature Read result = 0
[PSMOVE CRITICAL] Assertion fail in _psmove_get_firmware_info: res == expected_res
Failed to retrieve firmware info.

E:\AN_psmoveapi\psmoveapi_alt\my_build>

And the result of a USB connection:
E:\AN_psmoveapi\psmoveapi_alt\my_build>psmove_get_firmware_info.exe
[PSMOVE CRITICAL] Assertion fail in psmove_calibration_new: Could not determine serial from controller
[PSMOVE CRITICAL] Assertion fail in psmove_calibration_supported: calibration != NULL
[PSMOVE DEBUG] Can't create orientation - no calibration!
[PSMOVE CRITICAL] Assertion fail in psmove_get_magnetometer_calibration_filename: serial != NULL
[PSMOVE WARNING] Magnetometer in (null) not yet calibrated.
Serial: (null)
Feature Read result = 0
[PSMOVE CRITICAL] Assertion fail in _psmove_get_firmware_info: res == expected_res
Failed to retrieve firmware info.

E:\AN_psmoveapi\psmoveapi_alt\my_build>

gilc

unread,
Sep 22, 2014, 10:59:18 PM9/22/14
to psm...@googlegroups.com, nit...@ht.tu-berlin.de
And here is the results from Windows 7 x64 using the "alt-read-feature" build

windows 7 x64 - USB connection

D:\Users\Gil.Clayton\Desktop>psmove_get_firmware_info.exe
[PSMOVE DEBUG] Current host: f0:65:dd:64:00:d1
[PSMOVE DEBUG] Current host: f0:65:dd:64:00:d1
[PSMOVE DEBUG] Current host: f0:65:dd:64:00:d1
Serial: 00:13:8a:92:21:fd
Feature Read result = 0
[PSMOVE CRITICAL] Assertion fail in _psmove_get_firmware_info: res == expected_res
Failed to retrieve firmware info.

Windows 7 x64 - Bluetooth connection

D:\Users\Gil.Clayton\Desktop>psmove_get_firmware_info.exe
[PSMOVE DEBUG] Current host: f0:65:dd:64:00:d1
[PSMOVE DEBUG] Current host: f0:65:dd:64:00:d1
[PSMOVE DEBUG] Current host: f0:65:dd:64:00:d1
Serial: 00:13:8a:92:21:fd
Feature Read result = 0
[PSMOVE CRITICAL] Assertion fail in _psmove_get_firmware_info: res == expected_res
Failed to retrieve firmware info.

Alexander Nitsch

unread,
Sep 23, 2014, 2:02:50 PM9/23/14
to psm...@googlegroups.com
> Ok, I think I got the correct branch this time. I only see an additional
> printout for the "Feature Read result = 0".

Yes, that is the correct one. Hm, the alternative way of reading that
HID report on Windows fails as well. No difference with the later
version of Windows, obviously.

Thanks again for testing.


Alex

Chadwick Boulay

unread,
Feb 9, 2015, 2:52:33 PM2/9/15
to psm...@googlegroups.com, nit...@ht.tu-berlin.de
So I'm running into this problem now too :\

I cannot pair on Windows 8.1 x64 using psmovepair.exe because hid_get_feature_report for PSMove_Req_GetBTAddr returns -1. I built hidapi's test gui and tested a bunch of different bytes.

0x10 works, but the response cycles through the following three returns.
```
10 00 0d 07  11 ff80 37 7f  16 ff91 31 6f  3a 7f fff0 7f  
7f ff80 62 7f  4b 6f 58 ff91  39 7f 5f ff80  79 ff80 45 ff90  
5f ff80 37 ff80  51 6e 27 ff80  ffe2 08 fffc 7f  fff4 7f 7c ff81  
ff84 00 
```
```
10 01 07 fffe  7f fff1 7f 79  ff81 00 00 00  00 00 00 00  
01 00 01 ffde  08 ffe0 01 70  ff95 11 ff80 ffc4  ff81 ffe0 01 02  
ff80 5b ff92 7d  ff81 ffe0 01 ffd3  7f 1d ff80 69  ff95 ffa2 07 ffe4  
fffa 00 
```
```
10 ff82 26 ffc2  ffba 76 0d ffc3  65 17 ffb3 ffc1  fffc ffd0 71 3f  
2a ffe3 79 3f  fff5 ffd8 71 3f  50 ff9e 19 3f  fff9 09 ffac 3d  
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  
00 00 
```

0x11 works. The output changes each time I run it until settling on something like this:
```
11 02 00 01  28 00 00 00  00 00 00 00  00 00 00 00  
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  
00 00 
```

0xe0 works, but all 0's (even the first byte)
```
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  
00 00 
```

The only reason my PSMove controller works on my MacbookPro is because I paired it in OSX, then booted back into Windows, then I was able to make the registry change that allowed pairing.

On my desktop, the interesting registry entry appeared spontaneously after plugging the controller in, but I can't pair. Touching the PS button does nothing in either the Windows "Add Devices and Printers" GUI or the CL psmove-pair-win app.

I'm going to do a little more testing...

Chadwick Boulay

unread,
Feb 11, 2015, 10:33:12 AM2/11/15
to psm...@googlegroups.com
I think I solved the problem, at least on my system. The controller works well now, can be paired (though a registry hack + reboot is still required to connect), and can be used with the tracker-less test applications.

Alexander Nitsch

unread,
Feb 11, 2015, 1:58:34 PM2/11/15
to psm...@googlegroups.com
> I think I solved the problem, at least on my system
> <https://github.com/thp/psmoveapi/pull/149>. The controller works well now,
> can be paired (though a registry hack + reboot is still required to
> connect), and can be used with the tracker-less test applications.

Sounds good. Also seems to work on Windows 7 still.

Just a thought regarding the general handling of the Move on Windows:

The Move reports 3 different usage pages in its HID descriptor. Feature
reports 0x04 and 0x05 are part of usage page 0xFF02. I think it was Gil
who reported (on the mailing list, I believe) some success with making
reports work on Windows 8 if using the correct usage page. While the
Windows HID API lets you configure this kind of setting, I do not know
if the same is true for hidapi. We should check it out. Maybe this is a
cleaner way to accomplish proper communication on Windows 8. Besides,
this is actually the right™ way to handle HID, but other platforms do
not seem to be too strict about it ...


Alex

Reply all
Reply to author
Forward
0 new messages