-
Notifications
You must be signed in to change notification settings - Fork 8
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
Communicating with NUCUPS, but voltages and currents reported as zero #1
Comments
The above is on a NUCUPS. I have tried the same on an OpenUPS and see the same zero voltage and current reported. |
Did you run the command with sudo ? Are you using a 3.0 or 2.0 port ? Also you can try to replug in the USB port and rerun command with sudo. |
Hi @nicupavel, thank you very much for the quick reply with suggestions. Sorry it has taken a while to test and get back to you. On all the systems tested, USB 2 ports are used and I had been trying with sudo and the root account in the above. I have made progress through following your suggestions:
So the new code has successfully read the current state, reporting input and output voltages -- great news! A few points:
Is the code -- after the first run -- not releasing the interface? I checked that the nut daemons and ups drives had not been started up in the background. Any further attempts to run after the first give the same errors. Here's the dmesg:
Nothing is reported to syslog during these attempts. It also only reports voltages from 3 of the 6 cells -- is this correct behaviour?
It would be great to be able to use this to change the config (which I currently do through a virtual machine running the windows software). The main use right now is to monitor power, voltage and current. It is reporting CCharge and CDischarge. Is it possible to report input and/or output current (to the UPS and out to the powered device)? |
I'm investigating this, it's related to a shorter than expected (for some devices) timeout value. |
Please check latest version (0.6) from master. |
Hi @nicupavel, thanks for taking a look at this. I have just quickly pulled the update and rebuilt.
Then after stopping all nut daemons running:
Note we lose the error message about interface 0 being claimed by usbfs -- progress! Disconnecting and then reconnecting the usb cable to the OpenUPS and we see:
Great! Trying again:
Humpf! Or behaviour differs depending on the version of the usbhid driver or Linux kernel?
Although it'd be better not to be messing with the underlying linux system if possible... Double checking this code is version 0.6:
I'd build with a make clean, then make - and run from the local folder.
|
I disabled CLOCK_OUT in e3e0e7b. Let me know if it works better. |
Looking good! Thanks for the quick update. Without any nut services running, it now runs error-free every time -- which is fantastic! Nice work! More details below. Without any nut services running, it runs error-free every time:
Also on this system, no need for sudo/root privileges -- same output. With nut services running, it also gives the above most of the time, just falling over every now-and-then (with a
|
Thanks for this. I am running into a similar issue on Debian - I tried the update in e3e0e7b but didn't work out (nor did a build from master branch). Here is the error I am seeing, after a system reboot the first run of the command works without error, then I get:
Is there something else I'm missing? Not sure how you were able to get it to work @adamcandy If anyone is looking for a temporary solution, I am doing the following:
Thanks, so far this is a really impressive product! |
Thanks for feedback, anything interesting shows in kernel log (dmesg) beside -110 errors ? |
@mini-box unfortunately no, nothing showing up in dmesg when I get the error. |
I pushed a new commit disabling a IO_DATA5 usb message which leads to these timeouts. There is also a 1.0 snap available for you to try. |
Just re-built it and it works great - thank you! |
Hi @nicupavel and @mini-box,
Fantastic to have a Linux tool to talk with the mini-box UPSs - good job! I have built and tested. It looks to be communicating with the UPS fine, but has a few issues reading some of the data, such as voltage and current (see logs below). This is possibly connected to the
hid_interrupt_read failed with return code -110
error reported but the usb library.Have tried running with root user and also made sure to stop NUT and processes that might have locked access to the USB interface. (in fact this cleared the error
interface 0 already claimed by driver "usbfs", attempting to detach it
I saw initially.)Is there anything you can suggest we try to correct this?
Thank you for your help.
Cheers,
Adam
The text was updated successfully, but these errors were encountered: