Coder Social home page Coder Social logo

Comments (8)

addons-assistant avatar addons-assistant commented on June 18, 2024

👋 Thanks for opening your first issue here! If you're reporting a 🐛 bug, please make sure you include steps to reproduce it. Also, logs, error messages and information about your hardware might be useful.

from addon-nut.

sinclairpaul avatar sinclairpaul commented on June 18, 2024

Not sure really what you are asking here, so the UPS disconnects from the host and reconnects? And the time out period for the driver gets hit?

Addons can be restarted using HA automation's if needed, not sure how the addon could detect if its disconnected based on a cable pull vs the scenario you describe.

from addon-nut.

etatus avatar etatus commented on June 18, 2024

The problem is that after UPS disconnection, despite it reconnects again (USB), Home Assistant can't monitor the ups anymore until the ups server is restarted manually, so I cannot receive alerts related with low battery, etc. I can restart the addon from Home Assistant, but it takes a while, so I miss information. It would be better to restart only the nut server without restarting the entire addon.

from addon-nut.

sinclairpaul avatar sinclairpaul commented on June 18, 2024

Does the pollinterval option on the driver, and other settings not help?

Personally I have a Cyberpower UPS connected via USB and haven't seen this issue. Unfortunately it would be impossible to tell when your issue exists.

from addon-nut.

etatus avatar etatus commented on June 18, 2024

I think this issue is not related with poll interval since it only happens when the ups change the status from online to on battery mode (or viceversa). Here is the host dmesg:

...
[287392.327784] usb 1-1.4: new full-speed USB device number 33 using xhci_hcd
[287392.464443] usb 1-1.4: New USB device found, idVendor=0764, idProduct=0501, bcdDevice= 0.01
[287392.464451] usb 1-1.4: New USB device strings: Mfr=3, Product=1, SerialNumber=2
[287392.464456] usb 1-1.4: Product: CP1500EPFCLCD
...
>>>>>>> Here UPS enters On Battery mode <<<<<<<<
..
[286938.072105] usb 1-1.4: USB disconnect, device number 31
[286938.370822] usb 1-1.4: new full-speed USB device number 32 using xhci_hcd
[286938.507477] usb 1-1.4: New USB device found, idVendor=0764, idProduct=0501, bcdDevice= 0.01
[286938.507484] usb 1-1.4: New USB device strings: Mfr=3, Product=1, SerialNumber=2
[286938.507490] usb 1-1.4: Product: CP1500EPFCLCD
[286938.507495] usb 1-1.4: Manufacturer: CPS
...

image

And here is the addon log:

-----------------------------------------------------------
 Add-on: Network UPS Tools
 Manage battery backup (UPS) devices
-----------------------------------------------------------
 Add-on version: 0.1.0
 You are running the latest version of this add-on.
 System: Raspbian GNU/Linux 10 (buster)  (armv7 / raspberrypi4)
 Home Assistant Core: 0.107.1
 Home Assistant Supervisor: 209
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] nut.sh: executing... 
[01:56:06] INFO: Setting mode to netserver...
[01:56:06] INFO: Generating /etc/nut/upsd.users...
[01:56:07] INFO: Configuring user: admin
[01:56:07] INFO: Password is NOT in the Have I Been Pwned database! Nice!
[01:56:08] INFO: Configuring Device named saisil...
[01:56:09] INFO: Starting the UPS drivers...
Network UPS Tools - UPS driver controller 3.8.0-3396-gcdc7c4b5b1
Network UPS Tools - Generic HID driver 0.41 (3.8.0-3396-gcdc7c4b5b1)
Using subdriver: CyberPower HID 0.4
USB communication driver 0.33
[cont-init.d] nut.sh: exited 0.
[cont-init.d] nutclient.sh: executing... 
[cont-init.d] nutclient.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[01:56:09] INFO: Starting the UPS information server...
Network UPS Tools upsd 3.8.0-3396-gcdc7c4b5b1
   0.000000	fopen /var/run/nut/upsd.pid: No such file or directory
   0.000455	listening on 0.0.0.0 port 3493
   0.001487	Connected to UPS [saisil]: usbhid-ups-saisil
[01:56:09] INFO: Starting the UPS monitor and shutdown controller...
Network UPS Tools upsmon 3.8.0-3396-gcdc7c4b5b1
   0.000000	fopen /var/run/upsmon.pid: No such file or directory
   0.000491	Using power down flag file /etc/killpower
   0.000896	UPS: saisil@localhost (master) (power value 1)
   0.001097	debug level is '1'
   0.007504	Trying to connect to UPS [saisil@localhost]
   0.023589	User [email protected] logged into UPS [saisil]
   0.008446	Logged into UPS saisil@localhost
 143.571115	Data for UPS [saisil] is stale - check driver
 145.018084	Poll UPS [saisil@localhost] failed - Data stale
 150.018951	Poll UPS [saisil@localhost] failed - Data stale
 155.019566	Poll UPS [saisil@localhost] failed - Data stale

from addon-nut.

sinclairpaul avatar sinclairpaul commented on June 18, 2024

It appears to be hardware related, personally I would try different USB ports, cable, possibly a hub. Also see if it occurs on a different hardware platform, to rule out if it is the Pi itself.

There really isn't anything that can be done here from an add on perspective. The HA integration result would be expected as the NUT server can no longer communicate with the UPS.

The addon runs existing software maintained elsewhere, I would suggest looking at https://networkupstools.org/

Power Devices support

from addon-nut.

etatus avatar etatus commented on June 18, 2024

Hmmm, you were right, it was a hardware problem related to the Raspberry Pi 4.

  • UPS connected to the Raspberry Pi 4 in different USB ports --> It disconnects the same
  • UPS connected to the Raspberry Pi 4 with different charger --> It disconnects the same
  • UPS connected to the Raspberry Pi 4 through a powered USB hub --> It disconnects the same
  • UPS connected to a Raspberry Pi 3 --> It works fine (no disconnections)

Conclusion: something weird happens with the USB ports of the Raspberry Pi 4 only when the UPS changes to on battery mode :( (BTW, the external hard disk attached to the next USB port doesn't disconnect).

I wonder if the issue is related to the Argon ONE Case I'm currently using...

Anyway, thank you for your comments @sinclairpaul

from addon-nut.

addons-assistant avatar addons-assistant commented on June 18, 2024

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

from addon-nut.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.