Hi Roger, Hi all,> Does upsmon.conf specify a shutdown on LB?I think so. You mean SHUTDOWNCMD? The relevant parts of my upsmon.conf (notifications removed): MONITOR ups at localhost 1 upsmaster secret master MINSUPPLIES 1 SHUTDOWNCMD "/sbin/shutdown -h +0" POLLFREQ 5 POLLFREQALERT 2 HOSTSYNC 15 DEADTIME 40 POWERDOWNFLAG /etc/killpower RBWARNTIME 43200 NOCOMMWARNTIME 1800 FINALDELAY 1> What happens if you let the battery power the system until LB is reached?It's the same :-(> How old is this battery?About half a year. But I already went into this issue some months before with the 2.7.4 Raspbian package but havn't found the time to fix it.>> 8. Seconds later the UPS reboots, killing the RasPi >> 9. UPS and RasPi are up and running again - "OL CHRG" >> >> The UPS is set to "offdelay=5" and no ondelay > What happens if you use the default values of offdelay=20 and ondelay=30 > seconds, or longer?With defaults its the same. But I noticed two other details: 1. I was a bit wrong with step 7 and 8 - Looks like the UPS is "OL CHRG" (according to display) at first but goes to battery ("OL DISCHRG" according to nut) right when the RasPi (and nut) is booting. 2. When I pull the plug of the RasPi after UPS went down before main power comes back (so between step 5 and 6), the UPS comes up in state "OL CHRG" and is stable. Maybe nut is sending `upsdrvctl shutdown` right after boot again but without shutting down the system or sending an notification? Is there a way to check this reliably? Stefan
On 2/18/20 9:34 AM, Stefan Schulze wrote:> Hi Roger, Hi all, > >> Does upsmon.conf specify a shutdown on LB? > I think so. You mean SHUTDOWNCMD? > The relevant parts of my upsmon.conf (notifications removed): > > MONITOR ups at localhost 1 upsmaster secret master > MINSUPPLIES 1 > SHUTDOWNCMD "/sbin/shutdown -h +0" > POLLFREQ 5 > POLLFREQALERT 2 > HOSTSYNC 15 > DEADTIME 40 > POWERDOWNFLAG /etc/killpower > RBWARNTIME 43200 > NOCOMMWARNTIME 1800 > FINALDELAY 1 > >> What happens if you let the battery power the system until LB is reached? > It's the same :-( > >> How old is this battery? > About half a year. But I already went into this issue some months before with the 2.7.4 Raspbian package but havn't found the time to fix it. > >>> 8. Seconds later the UPS reboots, killing the RasPi >>> 9. UPS and RasPi are up and running again - "OL CHRG" >>> >>> The UPS is set to "offdelay=5" and no ondelay >> What happens if you use the default values of offdelay=20 and ondelay=30 >> seconds, or longer? > With defaults its the same. > > > But I noticed two other details: > 1. I was a bit wrong with step 7 and 8 - Looks like the UPS is "OL CHRG" (according to display) at first but goes to battery ("OL DISCHRG" according to nut) right when the RasPi (and nut) is booting. > 2. When I pull the plug of the RasPi after UPS went down before main power comes back (so between step 5 and 6), the UPS comes up in state "OL CHRG" and is stable. > > Maybe nut is sending `upsdrvctl shutdown` right after boot again but without shutting down the system or sending an notification? Is there a way to check this reliably?indeed if the battery is discharged and in the same time nut sees "OL DISCHRG", nut might trigger a shutdown ( although, as far as I know, this should happen only for "OB DISCHRG"). I'd like to understand _why_ does the DISCHRG flag appear when the UPS is actually online and charging. this could be a firmware error ( the UPS sends incorrect data ) or nut incorrectly reading ( or interpreting ) the data it receives.
>> But I noticed two other details: >> 1. I was a bit wrong with step 7 and 8 - Looks like the UPS is "OL CHRG" (according to display) at first but goes to battery ("OL DISCHRG" according to nut) right when the RasPi (and nut) is booting. >> 2. When I pull the plug of the RasPi after UPS went down before main power comes back (so between step 5 and 6), the UPS comes up in state "OL CHRG" and is stable. >> >> Maybe nut is sending `upsdrvctl shutdown` right after boot again but without shutting down the system or sending an notification? Is there a way to check this reliably? > > indeed if the battery is discharged and in the same time nut sees "OL DISCHRG", > nut might trigger a shutdown (although, as far as I know, > this should happen only for "OB DISCHRG").Do you mean "fully discharged" (that is not the case here, not even LB). But I guess even in this case nut should trigger a clean system shutdown and not only shutting down the UPS?> I'd like to understand _why_ does the DISCHRG flag appear when the UPS is actually online and > charging. this could be a firmware error (the UPS sends incorrect data) > or nut incorrectly reading ( or interpreting ) the data it receives.I think nut is correctly reading the "OL DISCHRG" from the UPS. It is obviously OL (I plugged it into the socket) and the display shows it's using the battery. My guess is, that nut is sending the shutdown to the UPS when booting up during this scenario. When I'm back at home, I'll try to manually call `upsdrvctl shutdown` to check if the UPS then goes to 'OL DISCHRG' and try to capture an usbhid dump. But I probably have only one minute time :-) I hope I won't trash the SD card of the RasPi with all this crashing :-D Stefan _______________________________________________ Nut-upsuser mailing list Nut-upsuser at alioth-lists.debian.net https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser