Closed eried closed 4 years ago
Hi. Do you get any messages in cura.log that say "Exception while reading HID events" when it fails after switching away and returning?
I only see
2020-06-15 16:01:25,005 - ERROR - [RawMouse] RawMouse.RawMouse._run_hid [243]: Exception while reading HID events: read error
2020-06-15 16:07:50,341 - DEBUG - [MainThread] cura.OAuth2.AuthorizationHelpers.getAccessTokenUsingRefreshToken [53]: Refreshing the access token.
2020-06-15 16:07:50,694 - DEBUG - [MainThread] cura.OAuth2.AuthorizationService._storeAuthData [213]: Attempting to store the auth data
but nothing recently. I will try to find a way to replate the error, but I think just reloading on window active would do the job.
but I think just reloading on window active would do the job.
It would be nice to be able to detect when it's necessary to do a restart rather than restarting every time the focus is lost/restored by Cura.
I know, but Restarting does not seem to be very resource intensive
Next time it occurs, look at the log and see if it produced a message, thanks.
Next time it occurs, look at the log and see if it produced a message, thanks.
OK, so the last message before it failed (and continued working in other software for example)
2020-06-24 15:50:45,389 - DEBUG - [RawMouse] RawMouse.RawMouse._decodeSpacemouseEvent [336]: Spacemouse battery level 54%
2020-06-24 15:53:54,181 - DEBUG - [MainThread] cura.OAuth2.AuthorizationHelpers.getAccessTokenUsingRefreshToken [53]: Refreshing the access token.
2020-06-24 15:53:54,551 - DEBUG - [MainThread] cura.OAuth2.AuthorizationService._storeAuthData [213]: Attempting to store the auth data
2020-06-24 15:54:02,024 - DEBUG - [RawMouse] RawMouse.RawMouse._decodeSpacemouseEvent [336]: Spacemouse battery level 54%
2020-06-24 15:54:04,570 - DEBUG - [MainThread] cura.AutoSave._onTimeout [60]: Autosaving preferences, instances and profiles
2020-06-24 15:54:07,407 - ERROR - [RawMouse] RawMouse.RawMouse._run_hid [243]: Exception while reading HID events: read error
2020-06-24 15:54:07,407 - ERROR - [RawMouse] RawMouse.RawMouse._run_hid [243]: Exception while reading HID events: read error
So I would guess that the best solution would be to register any error, and if rawmouse was enabled before the error, then trigger Restart on the first window focus no?
The master branch now detects the read error and does a restart, could you please try that.
Loaded, I will see if it happens again. Thanks! :)
Hi, has this fix been working OK for you?
Yes! I have been using it since then and no more issues
Hi again! How could I trigger an automatic reload on every windows switch/activation?
For some reason under Windows (with the actions set to none in the official driver) this works perfectly but from time to time I need to call "Extensions / Rawmouse / Restart" to make it respond again. Usually after switching to Inventor for example.
I would appreciate any tip how to code that, because I can see how undocumented is the development of cura plugins