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

read error when trying to pull RTE and capacity #10

Open
lorenzoooooo opened this issue Oct 4, 2022 · 2 comments
Open

read error when trying to pull RTE and capacity #10

lorenzoooooo opened this issue Oct 4, 2022 · 2 comments

Comments

@lorenzoooooo
Copy link

I am using openups with firmware 1.9 and the configuration set is in the attached file.

While trying to run the following code inside GetStatus() method of object HIDOpenups:
" ret = sendMessage(OPENUPS_CLOCK_OUT, 0);
usleep(1000);
recvMessage(recv);
parseMessage(recv);
"
I get the following error:
"
hid_interrupt_read failed with return code -110
Read error [0xc0]: -110
"
it reads the capacity and the RTE but puts to 0 all the other values.
If I comment this part of code I get all the values with correct values except for the RTE and capacity and the error is not present.
Furthermore I saw that the windows interface doesn't have this problem.

settings.txt

@chunter1
Copy link

chunter1 commented Sep 1, 2023

Will this EVER get fixed?

@mcmara
Copy link

mcmara commented Jan 16, 2024

It seems that I have got it working reliably by removing all delays and sending the OPENUPS_CLOCK_OUT message twice. In particular, I changed GetStatus into this:

void HIDOpenUPS::GetStatus() 
{
    unsigned char recv[32];
    int ret;

    sendMessage(OPENUPS_GET_ALL_VALUES, 0);
    recvMessage(recv);
    parseMessage(recv);

    ret = sendMessage(OPENUPS_GET_ALL_VALUES_2, 0);
    recvMessage(recv);
    parseMessage(recv);

    ret = sendMessage(OPENUPS_CLOCK_OUT, 0);
    recvMessage(recv);
    parseMessage(recv);

    ret = sendMessage(OPENUPS_CLOCK_OUT, 0);
    recvMessage(recv);
    parseMessage(recv);
}

This is on a little rpi zero w, running Raspbian GNU/Linux 11 (bullseye). I was having the same problem as you described it above.

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

3 participants