Re: [DNG] rq: show me your power

2018-03-12 Thread Adam Borowski
On Mon, Mar 12, 2018 at 03:02:38AM +0100, Arnt Karlsen wrote:
> On Mon, 12 Mar 2018 00:59:21 +0100, Adam wrote in message 
> <20180311235921.aq6uclmmsx2ip...@angband.pl>:
> 
> > Hi!
> > If you have a machine with a non-boring power connection (USB, etc)
> > or an UPS that's recognized by the kernel (rather than just nut),
> > please ls /sys/class/power_supply/ -- if you see anything other than
> > "ac" or "battery" there, please send me that data.
> 
> ..I have one laptop with "AC0", one with "AC", both with "BAT0". 
> Both my Raspberry Pis have empty /sys/class/power_supply link 
> trees, 3 pipe mails mailed in case you can use them. 

That's the common case, that's handled well by any tool I looked at:
* laptops with exactly one AC and exactly one battery
* desktops/servers/boards with no power sensors of any kind

Systemd knows about multiple AC/multiple batteries, current powermgmt-base
also about old style not yet converted drivers (Powerbooks, ancient i386);
what I'm interested in are more exotic new style cases.

> > grep . /sys/class/power_supply/*/* | mail -s power kilob...@angband.pl

Your local MTA is not capable of delivering outgoing mail (that's the
default unless configured); unless you have some other purpose, don't bother
fixing this for my sake (your machines are already handled well).

Thanks for looking!


Meow.
-- 
⢀⣴⠾⠻⢶⣦⠀ 
⣾⠁⢠⠒⠀⣿⡁ A dumb species has no way to open a tuna can.
⢿⡄⠘⠷⠚⠋⠀ A smart species invents a can opener.
⠈⠳⣄ A master species delegates.
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] rq: show me your power

2018-03-11 Thread Arnt Karlsen
On Mon, 12 Mar 2018 00:59:21 +0100, Adam wrote in message 
<20180311235921.aq6uclmmsx2ip...@angband.pl>:

> Hi!
> If you have a machine with a non-boring power connection (USB, etc)
> or an UPS that's recognized by the kernel (rather than just nut),
> please ls /sys/class/power_supply/ -- if you see anything other than
> "ac" or "battery" there, please send me that data.

..I have one laptop with "AC0", one with "AC", both with "BAT0". 
Both my Raspberry Pis have empty /sys/class/power_supply link 
trees, 3 pipe mails mailed in case you can use them. 

> grep . /sys/class/power_supply/*/* | mail -s power kilob...@angband.pl

-- 
..med vennlig hilsen = with Kind Regards from Arnt Karlsen
...with a number of polar bear hunters in his ancestry...
  Scenarios always come in sets of three: 
  best case, worst case, and just in case.
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


[DNG] rq: show me your power

2018-03-11 Thread Adam Borowski
Hi!
If you have a machine with a non-boring power connection (USB, etc)
or an UPS that's recognized by the kernel (rather than just nut), please
ls /sys/class/power_supply/ -- if you see anything other than "ac" or
"battery" there, please send me that data.

grep . /sys/class/power_supply/*/* | mail -s power kilob...@angband.pl
(or send it manually if you have no configured local MTA)

I'm especially interested in sources that can themselves switch between
abundant and stored power, such as UPS.  In that case, it'd be good to get
the data for both mains and battery cases.


 request end, continue reading only if bored 

Because of the recent thread of apt dropping Suggests:powermgmt-base in
favour of systemd's implementation, I looked into getting the former into
shape.  Even in the current neglected shape, it already does a strictly
better job than .service ConditionACPower, but the differences are only for
legacy hardware (Apple Powerbooks -- PMU, ancient i386 -- APM).  What I'm
about to upload adds support for USB (tablets and phones), but it'd be good
to research other sources known to the kernel.

The full list of possible data available through sysfs is:
"Unknown", "Battery", "UPS", "Mains", "USB",
"USB_DCP", "USB_CDP", "USB_ACA", "USB_C",
"USB_PD", "USB_PD_DRP", "BrickID"

As far as I managed to find out, none of USB* returns information about
where its power comes from, but I did not find any "intelligent" battery
connector that identifies this way.  Thus, on tablets, "Battery" means
stored power while USB* means an attached charger.  Yeah, it's possible
that the other end of the USB cable is a disconnected laptop or a power
bank, but in the vast majority of cases charging means abundant power
-- no different from a no-control or nut-only UPS being recognized "ac"
even if it's going from battery.

Alas, hardware I own includes none of such interesting cases: my only UPS
is nut-only, at the moment I have no control access to ones in data centers,
my ARM gear that can be powered via USB lacks the circuitry to tell this to
the kernel (even though the SoC has this functionality -- ie, I have "usb"
listed in sysfs but it always says it's off), etc.


Meow!
-- 
⢀⣴⠾⠻⢶⣦⠀ 
⣾⠁⢠⠒⠀⣿⡁ A dumb species has no way to open a tuna can.
⢿⡄⠘⠷⠚⠋⠀ A smart species invents a can opener.
⠈⠳⣄ A master species delegates.
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng