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
auxiliary/pegasus_upb strange behaviour with USB_PORT_CONTROL switch vector #1580
Comments
… with handling light of USB_PORT_CONTROL, see indilib/indi#1580
Thank you for the report. You can look at the implementation of USBControlV2SP property and it always sends a response from what I can see either Ok or Alert depending on the result. |
Ok thank you so much for the analysis ! I'll soon write a driver with native C++ framework so that I'll be able to debug/check this fo rmyself in the future. Sorry for the inconvenience, I'll re-re-recheck my client code / debug logs then to understand what is happening. Thank you again for your valuable help |
Ok I tried to checkout the logs on driver side to see what was happening there, here is what I see in the erroneous case (ie, trying to set switch vector to the same value that the driver already has):
No in the "Normal" case, ie, when part of the switch vector is different, and I do get an answer from the server:
So I guess I do see indeed the proof that an IDLE light status is send in both case. Will close the bug, sorry again |
Sorry, I cannot wrap my mind around this, it almost looks like there is an issue with the driver answering with a USB_HUB_CONTROL to a USB_PORT_CONTROL newswitch request. Sample with erroneous behaviour:
|
From what I understand from the code, there might be an issue at this exact line: indi/drivers/auxiliary/pegasus_upb.cpp Line 717 in ce74163
I think that the To me it looks like a copy paste kind of mistake, but I am not 100% sure, @knro can you please quickly check ? thank you in advance for your help |
Ok problem fixed on my side thanks to this fix, I will try to create new PR |
Note: this fix is enough to get me on track for my developments, but it is still not clear what is happening with USB_HUB_CONTROL on the UPB_V2 (I think somehow this was used in V1, but I don't understand what happened there, and what should be the expected behaviour for V2). |
indi/drivers/auxiliary/pegasus_upb.cpp Line 1227 in ce74163
To me it looks like there is a weird behaviour when trying to set some values equal to the previous value held by the upbv2. If someone from Pegasus astro can give it a looks and crosscheck this code, that would be great. |
Ok finally found the issues, fully fixed on my setup with this PR: #1581 |
Describe the bug
I am currently developing a small software to drive a telescope setup, and the UPBV2 is a central piece of my setup.
Unfortunately, I recently came across a weird behaviour with regard to the switchvector called "USB_PORT_CONTROL"
My current strategy for every switchvector, as a client, is to send the vector to the indiserver, and then wait for the corresponding light to be set to Ok (or eventually idle, but that's another story). This is somehow an acknowledgment mechanism, and the light is set to Ok, independantly of wether any or none of the switch value have actually been changed.
Anyway, this acknowledgment strategy is working pretty ok on most of the drivers I have been playing with recently, also, it is working on the "POWER_CONTROL" and "POWER_ON_BOOT" switchvector. However, when it comes to "USB_PORT_CONTROL", I noticed that the driver is never acknowledging the switch reception in the case that the sent switchvector has no difference with the current switch values.
Second issue:
In addition, I noticed that the switchvector named "USB_HUB_CONTROL" always exhibit an "Alert" value when used. I suppose there is an issue somewhere with this feature inside the indi driver, but I am not competent enough to debug this.
Is there anyway for someone to crosscheck if the behaviour can be reproduced, and if it is expected ?
Thank you in advance for your help
To Reproduce
Exact steps to reproduce the behavior.
Expected behavior
I expect the driver to send a "USB_PORT_CONTROL" switchvector with a light set to "Ok" independantly of wether the latest client command did change or didn't
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Log Files
Edit removed useless logs
The text was updated successfully, but these errors were encountered: