Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse Direction and Speed options in software not working #13

Open
voxpop9 opened this issue Jun 15, 2024 · 14 comments
Open

Reverse Direction and Speed options in software not working #13

voxpop9 opened this issue Jun 15, 2024 · 14 comments
Labels
help wanted Extra attention is needed

Comments

@voxpop9
Copy link

voxpop9 commented Jun 15, 2024

As per the title, i have tried to reverse and slow down the mouse using the 3Dconnexion's software and it is not working.

@AndunHH
Copy link
Owner

AndunHH commented Jun 15, 2024

Yes, this is a known problem now. The 3dconnexion driver doesn't save this setting on the pc, but probably send this information to the spacemouse. And our version doesn't recognize this settings.

I would also like to have this feature! We need to find a solution. Maybe some other project has already solved this issue and we can merge the solution? I would start by looking into the history of the projects, where teaching tech sourced the HID interface.

@voxpop9
Copy link
Author

voxpop9 commented Jun 16, 2024

Yes, this is a known problem now. The 3dconnexion driver doesn't save this setting on the pc, but probably send this information to the spacemouse. And our version doesn't recognize this settings.

I would also like to have this feature! We need to find a solution. Maybe some other project has already solved this issue and we can merge the solution? I would start by looking into the history of the projects, where teaching tech sourced the HID interface.

That's interesting, because the Arduino code itself mentions using the software to invert it. perhaps 3Dconnexions changed this at one point.

@AndunHH
Copy link
Owner

AndunHH commented Jun 16, 2024

You are right, but I am sure, this was not working on windows ...

For Linux this is a different story, as the original driver is from 2014 and spacenavd is a popular alternative, which allows this. I linked it in the readme, if you are interested.

@voxpop9
Copy link
Author

voxpop9 commented Jun 16, 2024

You are right, but I am sure, this was not working on windows ...

For Linux this is a different story, as the original driver is from 2014 and spacenavd is a popular alternative, which allows this. I linked it in the readme, if you are interested.

Im on Windows so it foesn't apply to me unfortunately. Oh well, i only use it for Onshape at the moment so code level modifications will suffice for now.

@coliss86
Copy link
Contributor

I don't know how to implement this, the USB bus should be sniffed with a genuine mouse and the protocol should be reversed engineered. A lot of work...

@AndunHH
Copy link
Owner

AndunHH commented Jul 21, 2024

To let you know:
I did an overhaul of the USB HID interface and I'm not done yet - in the branch EnableLED

There are many reports in the HID descriptor that are not used now. I found out that report ID

  1. IN Translation
  2. IN Rotation
  3. IN Keys
  4. OUT LEDs
  5. not existent
  6. OUT Usage (0x21) Cnt 1
  7. OUT Usage (0x22) Cnt 1
  8. OUT Usage (0x23) Cnt 7
  9. OUT Usage (0xB0) Cnt 7
  10. OUT Usage (0x25) Cnt 7
  11. OUT Usage (0x26) Cnt 1
    ...

'19. OUT Usage (0x2E) Cnt 1

See https://github.com/AndunHH/spacemouse/blob/main/SpaceNavigator.md#hid-report-of-space-navigator for the whole HID descriptor.

I guess, that those six reports will tell the spacemouse about the sensitivities for the single axis. I have no clue, what report 19 will tell us ;) ... After finishing the LEDs, this will be next and is recorded here as a reminder.

@AndunHH
Copy link
Owner

AndunHH commented Aug 28, 2024

My last comment is missing some important information: the observed hid descriptor with the additional reports are observed in a classical space navigator, which is NOT equal to our emulated space mouse pro!

I tried to switch our emulation to such a space navigator to get the configuration going. Unfortunately, this failed, because the driver didn't send any additional information.??? As expected the keys stopped working because the classic space navigator has only two keys. Therefore we stay we the actual emulation of the space mouse pro, where at least all keys are working.

If someone has such a space mouse pro, so we can Wireshark the USB communication, this would help!

@Mr-Falat
Copy link

in my opinion this settings parameters send to Spacemouse to another endpoint or send by custom feature defined in HID Descriptor ID-6 to ID-19 !
bc when I made any change to any parameters on Setting Window I can see RX LED of my Arduino Pro micro is light up ! that is show data has send from software to arduino.

@AndunHH
Copy link
Owner

AndunHH commented Jan 28, 2025

Hi

I also thought about that.

I got hands on a classical space navigator (the old mouse with only two buttons) and observed the communication with Wireshark. The capture can be found here:

https://github.com/AndunHH/spacemouse/blob/main/Reverse-Engineering-Docs%2FSpaceNavigator-Connected-Calibrate.pcapng

The hid descriptord are also extracted and linked in the post above.

Unfortunately, when I pressed calibrate on my PC the only communication was to toggle the LED on and off to show some blinking. I couldn't see anything else on other endpoints.

That's why help is needed by someone to Wireshark the communication of a real space mouse pro.

@Mr-Falat
Copy link

Mr-Falat commented Feb 6, 2025

Hi everybody .
I found something about atmega32u4 endpoints that may help :

https://www.avrfreaks.net/s/topic/a5C3l000000UcghEAC/t162507

can anybody check this link ?

@AndunHH
Copy link
Owner

AndunHH commented Feb 6, 2025

in my opinion this settings parameters send to Spacemouse to another endpoint or send by custom feature defined in HID Descriptor ID-6 to ID-19 ! bc when I made any change to any parameters on Setting Window I can see RX LED of my Arduino Pro micro is light up ! that is show data has send from software to arduino.

Have you checked, if only the LEDs are toggled at this moments or are there really some calibration values transmitted? Can you record the data with wireshark? All I got, were the instructions to turn on and off the LED, as I uploaded here: https://github.com/AndunHH/spacemouse/blob/main/Reverse-Engineering-Docs/SpaceNavigator-Connected-Calibrate.pcapng

Hi everybody .
I found something about atmega32u4 endpoints that may help :
https://www.avrfreaks.net/s/topic/a5C3l000000UcghEAC/t162507
can anybody check this link ?

I checked the linked page, but can not see the real value. Obviously there may be some endpoints which can not be read and wrote correctly by the atmega32u4 simultaneosly. But I have no clue, if this is the problem we face and how to solve this in our use case. There we would need some other specialist.

But first off all, we need to sniff the values send over USB when a original mouse is connected and the calibration in the menu is performed.

@Mr-Falat
Copy link

Mr-Falat commented Feb 7, 2025

Hi.
I can do that guys.
i received a new "SpaceMouse Compact" this week for better observation.
but last night when i connected the promicro to pc i see something intresting: when i swetched between softwares in windows, the RX LED of promicro is blinking !
I think the driver send speed and axis direction of device separately for each program!

@Mr-Falat
Copy link

Mr-Falat commented Feb 7, 2025

Sorry if I sometimes post irrelevant information.
I am not very familiar with USB. And I am looking for the problem through observation and experiment.

@AndunHH
Copy link
Owner

AndunHH commented Feb 8, 2025

Great to hear, that you have a original space mouse for observation.

It would be very interesting to observe the commands send and received during calibration!

Regarding the different headers: We can not emulate the USB header completly, because we also need to programm our mouse through the usb device. I hope this seems not to be the problem. The most interesting part is inside the HID descriptor. So it would be interesting if you compare the HID descriptor details of our emulated mouse and the original one.

You find our emulated header here:

static const uint8_t SpaceMouseReportDescriptor[] PROGMEM = {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants