Hello there,
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?
Thanks in advance,
Dectecting SpaceMouse Wireless Receiver via PyUSB
Moderator: Moderators
Re: Dectecting SpaceMouse Wireless Receiver via PyUSB
Hi dcrb,
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.
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.
Re: Dectecting SpaceMouse Wireless Receiver via PyUSB
Hello ngomes,
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)
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)
Re: Dectecting SpaceMouse Wireless Receiver via PyUSB
What Python library are you using? Have you look into examples of accessing devices with multiple USB interfaces?
Re: Dectecting SpaceMouse Wireless Receiver via PyUSB
I'm using pyUSB. I've tried to check such examples but haven't found anything that helped solve my issue so far
Re: Dectecting SpaceMouse Wireless Receiver via PyUSB
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.
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.
Re: Dectecting SpaceMouse Wireless Receiver via PyUSB
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...)
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...)