-
-
Notifications
You must be signed in to change notification settings - Fork 464
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
If deej starts too fast on windows startup it sometimes fails to detect sliders #23
Comments
Hi @prueker, thanks for writing. I'd like to understand this problem a bit more in-depth in order to help you. The logs you attached are suggesting that deej connects successfully, and that it'll handle the next line read from serial as the baseline for the number of sliders (what you're calling "detecting sliders"). So to clarify - which of these most accurately describes what you're running into?
On a related note, I do plan to add more robust connection handling (including reconnection attempts where appropriate), but there isn't a specific time frame for this yet. As a workaround until then, adding a 20 to 30 second sleep in your startup script launching deej might be an acceptable solution. |
It's the number 1 case. deej starts, it says the "connected" line (which is the last line in the log until I close deej and restart it, as shown in the screenshot above), but not the "Detected sliders" line until I close deej and restart it, upon which it works immediately. So I have the feeling that deej connects to the COM port, but the arduino might not have booted fully yet and isn't sending lines and so it somehow blocks it? |
Definitely sounds like something of that sort - I concur that some sort of retrying logic is the right call here. I'll likely do this in a small hotfix (and not as part of a more holistic improvement around connection stability), to solve this specific instance of it. If it's alright with you, I'll keep you updated here when it's ready. Thanks again for the report! |
Sounds good, I'll be happy to test it. |
Hijacking this a bit (similar, but not the same issue): when the pc goes in hibernation and then comes out of it, the connection with the arduino is gone. A restart of deej solves this. I guess this would be fixed when you implement that more robust connection handling? |
Hey @Nickxsch, sorry about the delay in responding. Yes, this would be fixed together with those changes. I still don't have an ETA for this, unfortunately. I hope that in the meantime continuing to restart deej isn't a huge hassle, and I will update here when a fix is implemented. Thanks! |
@omriharel not a problem at all. I know this isn't a commercial product with a full time dev team behind it 🙂 |
I hacky workaround that I've been using involves AutoHotKey. A "script" that launches at start up will first wait 20 seconds, then open deej.exe (if it isn't already open). Here is the script I'm using
Modify the path and sleep time to fit your needs. The Config.yaml will need to be in the same location as the script. Compile the script by right clicking on it and selecting compile script. This will produce an .exe file that can be placed in the startup folder. (make sure the config.yaml is also with this new "launch script" and NOT with deej.exe. ) |
I just tossed the above PR up to solve the serial connections. It basically just closes the channels, drops out of the go routine, and restarts the serial if it loses connection. If it fails to connect, it will try again and then exponentially back off until it reaches a 100 second wait period at which point it just continues one try per 100 seconds. |
Marcus, you brilliant man, thanks! |
Updating here for posterity - the changes in #32 do the job but I currently have separate plans to fix this as part of a connection stability pass planned for the near future. I invite you to read my comment on the PR here for additional context. I'll be sure to update this issue when this is released. Thank you! |
Was this ever solved? it's been a few years and i think i'm having the same issue |
Also getting this issue having recently built a device. Deej detects with no com port error but i have to restart deej and re insert the arduino then it works fine. |
My PC boots quick and about half of the time, the application starts before it can detect the sliders and I have to manually close/restart deej so it detects them.
Maybe a check to see if sliders were detected could be added and if they were not, put in a retry-loop to try for 5 times every x seconds to prevent this?
The text was updated successfully, but these errors were encountered: