I'm currently working on an application that relies on a SpaceMouse Wireless.
I've developped a code in python to read and send the SpacMouse info to another device. I've managed to have it work with a SpaceNavigator. Now I would like to make it work with the SpaceMouse Wireless but I'm unable to as when I try to "choose" the receiver, there are 7 of them and the program will simply choose the first, while the one (and only) who receives data is the 3rd our 4th one. Any suggestions?
dcrb wrote: ↑Mon Apr 12, 2021 7:01 am
Any suggestions?
The Universal Receiver (UR) can pair up to five wireless devices, each on a separate USB interface.
Within each interface, you will find a set of top-level collections (as per the HID specification; these are also known as "application collections"). There's one top-level collection if the interface has no pairing, two if the pairing is for a SpaceMouse and three for a CadMouse type. You're interested in the second case.
The two top-level collections (all in the "generic" desktop usage page) consist of a "multi-axis controller" usage collection (ID 0x08) and a "vendor-defined" collection. You want to use the former.
Thanks for your reply. I'm quite new to this and I don't understand much of USB HIDs.
For the SpaceMouse wireless cabled, I use the following line to select it, which works perfectly since there's only one HID:
dev = usb.core.find(idVendor=0x256f, idProduct=0xc62e) #SpaceMouse Wireless (Cabled)
I've read your answer and thought about it but I'm still stuck. How can I do the equivalent to that line of code for the SpaceMouse while using the wireless receiver? (as if I just replace the idProduct by the UR one, it won't work since it will select the first that doesn't get data)
dcrb wrote: ↑Tue Apr 13, 2021 7:40 am
How can I do the equivalent to that line of code for the SpaceMouse while using the wireless receiver? (as if I just replace the idProduct by the UR one, it won't work since it will select the first that doesn't get data)
What Python library are you using? Have you look into examples of accessing devices with multiple USB interfaces?
I haven't. Since I could deal with the SpaceMouse wired but not with the wireless receive, I figured I'd rather ask here.
I will try to figure it out and consult with PyUSB developpers with the information you've gave me about the interfaces and collections a few days ago.
Thank you for your time and cooperation. I'll gladly share here if I find a workaround.
dcrb wrote: ↑Thu Apr 15, 2021 7:21 am
I'll gladly share here if I find a workaround.
Yes, please. I think others will certainly benefit if you demonstrate how to access a SpaceMouse connected over a Universal Receiver in a Python program.
I'd like to see that code too.
Then I wouldn't have to chase my remote control tank connected via the USB cable!
(The SpaceMouse makes a great tank controller - and if you connect the tank camera to the device LCD you can see where it is going...)