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

Support for OS3M Mouse #25

Open
hotsgit opened this issue Apr 2, 2024 · 15 comments
Open

Support for OS3M Mouse #25

hotsgit opened this issue Apr 2, 2024 · 15 comments

Comments

@hotsgit
Copy link

hotsgit commented Apr 2, 2024

GENERAL INFO: In the past year or so 3 DIY 6DoF mice have been developed, so I'm hoping people will be able to adapt this plugin to them. I built an OS3M mouse (I didn't design it) which acts as a serial 6DoF mouse in Windows and I've gotten it working in one game without an intermediary program. The pic below shows all 6 axes (X and Y are in the box).
image

OS3M OVERVIEW (not necessary to look at):
https://github.com/spoter368/os3m-hardware
https://www.youtube.com/watch?v=p3HOFJEZwfs

REQUEST: I'm not sure what I'm doing wrong when adding it to the device list in config.json. I can confirm that the rawmouse plugin installed correctly in Cura 5.5.0 but the log file says "No mouse found!".

Log File:
image
image

From Device Manager:
image
image

My added line in config.json - this does nothing. I've tried several combinations of profiles and device names, pretty sure I shouldn't use libspnav since that's not installed (is that just a Linux thing?):
image

Also are there deadbands I can set in that config.json, or do I have to change RawMouse.Py?

@smartavionics
Copy link
Owner

Hi, I'm happy to help with this but rather busy right now. Will look into it soon.

@smartavionics
Copy link
Owner

Hi, have you made any progress? Could it be that another driver has grabbed the device and so it isn't visible to Cura?

@hotsgit
Copy link
Author

hotsgit commented Apr 3, 2024

No drivers were running, no new progress. For available OS3M drivers, so far there's only one for Solidworks API and one for a test program. Does it need a driver to work with Rawmouse even though windows recognizes it as a serial 6DoF USB device?

If yes, would the config.json and Rawmouse.py need a custom profile for whatever custom driver this OS3M needs, or could it use the spacemouse profile? Should I pursue libspnav as a driver or is it just for linux?

@smartavionics
Copy link
Owner

I would not expect it to require a driver. The whole point of RawMouse is that it can work directly with a HID device. Ignore libspnav as that's a Linux thing that someone requested support for.

What usage page and usage values does your device support?

@hotsgit
Copy link
Author

hotsgit commented Apr 5, 2024

I think this means Usage Page 0x01 and Usage 0x04 but I'm speculating a bit since the internet isn't useful for how to find those.

image

Tables from Microsoft:

image

A dumb mistake in my first post is that I was editing a backup of the config.json, so I put this line into the correct json file...

image

and now Rawmouse sees the device in Cura - except moving the mouse does nothing:

image

image

Same results with this:
image

@smartavionics
Copy link
Owner

Sorry for the slow response, I've only just got in from work.
It's good that the device is now detected. I think the problem you have now is that the data format of your device does not match the format that the spacemouse uses. Do you have any documentation that describes the layout of the data that is sent with each HID event when you move the axes or press buttons?

@smartavionics
Copy link
Owner

Hi, I have added some extra diagnostics to the master branch. It will now print the usage_page and usage of the HID device that is found and it will also print the contents of the events when the profile name isn't recognized (i.e. the profile name is not spacemouse or tiltpad). So if you change your config file to have some other profile name you should see the contents of the events in cura.log.

@smartavionics
Copy link
Owner

Sorry, I forgot to add that you will need to define a profile with the new name, e.g. "STM32HI", so you could just duplicate the spacemouse profile and give the duplicate that name.

@smartavionics
Copy link
Owner

I've had a dig and found https://github.com/spoter368/os3m-software. Looking at that, I think the event data format is going to be very similar to what the spacemouse provides.

@smartavionics
Copy link
Owner

Did your log show any "Unknown spacemouse event" messages? If so, what was the reported len?

@smartavionics
Copy link
Owner

I'm pretty certain what needs to be done and have pushed some code to the master branch. You should see some movement but the scaling is probably wrong.

@hotsgit
Copy link
Author

hotsgit commented Apr 6, 2024

Thanks so much for all your work! With the new code the OS3M can move the build area in Cura, though I had to change the scale in all axes to 0.0005, and I will take a while to figure out which axes are which and how to get rid of drift. Will update.

Weirdly enough the rawmouse option to see device info in Cura doesn't work now.

@smartavionics
Copy link
Owner

Good sounds like progress.

I have pushed another update that should fix the lack of device info.

I should think that altering the threshold values should fix the drift.

@hotsgit
Copy link
Author

hotsgit commented Apr 7, 2024

Hello, can you set these as the values for the "os3m" profile? They're a baseline, and I'll inform people how to change them.

  "axes" : [
    { "offset": 0.0, "scale": -0.0015, "threshold": 0.080, "target": "movx" },
    { "offset": 0.0, "scale": -1.8, "threshold": 94.0, "target": "zoom" },
    { "offset": 0.0, "scale": 0.0015, "threshold": 0.080, "target": "movy" },
    { "offset": 0.0, "scale": -0.0004 , "threshold": 0.023, "target": "rotpitch" },
    { "offset": 0.0, "scale": -0.0004, "threshold": 0.022, "target": "rotroll" },
    { "offset": 0.0, "scale":  0.0005, "threshold": 0.023, "target": "rotyaw" }
  ]

If the OSM hardware/firmware is improved then I can just tell people what new values to use here: spoter368/os3m-software#8

@smartavionics
Copy link
Owner

I've incorporated your config values and made a new release (1.2.2).

Let's leave this issue open in case you want to make some further changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants