-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
NUT with IPPON Back Pro and Smart Winner #242
Comments
• Which version of NUT are you using? This really seems like something that the driver should be able to handle, since it should get an error code from libusb when the UPS disconnects. Can you try this UPS with nutdrv_qx? It is the successor to the blazer_* drivers. |
NUT 2.6.5
I may doing this some time later (it is need to build latest version of |
Note that NUT has not been tested as extensively with libusb-1.x and libusb-compat (versus libusb-0.1.x). It should work, but since it is not easy to simulate USB errors, the equivalent error-handling code has not been exercised as much.
With either nutdrv_qx or blazer_usb, you can kill the driver process, and start it manually (not via upsdrvctl) with extra -D flags to try to catch the error message when the UPS disconnects. |
I runned blazer_usb: At these time: Resume: device drops the USB connection and immediately restore it, but blazer_usb can't reconnect. Also I compiled nutdrv_qx from latest sources and try run it now, but unsussessful: Next I run blazer_usb again: 0.456802 Using 'guestimation' (low: 10.400000, high: 13.000000)! |
The blazer_USB peridocally looses connection with several IPPON UPS:
I make workaround: the script called by upsmon daemon (the token "NOTIFYCMD" of the upsmon.conf), this script unload blazer_usb and load it's again.
The script:
#!/bin/bash
# notifycmdhandler - script for NOTIFYCMD in the upsmon.conf
# It can use the environment variables NOTIFYTYPE and UPSNAME to know what has happened and on which UPS.
# Please insert into /etc/sudoers followed line:
# upsmon ALL=(root) NOPASSWD: /bin/service upsdrv restart
#
# NUT driver; vendor ID and product ID of USB device
NUTDRIVERNAME=blazer_usb
UPSUSBVID=06da
UPSUSBPID=0003
# Programs
GREP=/bin/grep
SUDO="/usr/bin/sudo -S"
LSUSB=/usr/bin/lsusb
SERVICE=/bin/service
LOGGER=/usr/bin/logger
# Functions
try_restart_blaser_usb(){
# check usb device presented if the blazer_usb driver is used
# if result of grep is zero then device is connected and we may restart of blazer_usb (this is should restore connection the NUT with UPS)
[[ ${NUTDRIVERNAME} == "blazer_usb" && -n ${UPSUSBVID} && -n ${UPSUSBPID} ]] && {LSUSB} | ${GREP} -q ${UPSUSBVID}:${UPSUSBPID}
if [[ $? -eq 0 ]]
then
${SUDO} ${SERVICE} upsdrv restart 2>&1 | logger -p daemon.info -t notifycmdhander
${LOGGER} -p daemon.info -t notifycmdhander "${SUDO} /bin/bash -c "set | /bin/grep UID" (restart service upsdrv) with result: $?"
else
${LOGGER} -p daemon.info -t notifycmdhander "USB device ${UPSUSBVID}:${UPSUSBPID}" not found (NUTDRIVERNAME=${NUTDRIVERNAME})
fi
}
# Main code
[[ ${UPSNAME} ]] || { ${LOGGER} -p daemon.error UPSNAME is not defined! ; exit 1 }
[[ ${NOTIFYTYPE} ]] || { ${LOGGER} -p daemon.error NOTIFYTYPE is nod defined! ; exit 1 }
if [[ "${NOTIFYTYPE}" == "NOCOMM" ]]; then
# Fix event "NOCOMM" (wall message like "UPS IPPON@localhost is unavailable")
[[ ${NUTDRIVERNAME} == "blazer_usb" ]] && try_restart_blaser_usb
fi
The text was updated successfully, but these errors were encountered: