Is the power source exposed to the OS?
#4
(07-20-2019, 06:02 AM)seal Wrote: But is there a way for the operating system to know what the current power source is? For the purpose of a script that would notify if DC power is lost and the system is now running on battery? Alternatively can the operating system know what the battery level is?

The last 2 where i2c volt/current sensors so they can measure an input so long as inline.

The system itself if the UPS is any good will not be able to tell the difference between 12v non bat vs 12v bat.
But if you put a cheap i2c sensor on your battery output then job done.

Example software is via Sparkfun https://www.sparkfun.com/products/15176
https://www.rototron.info/raspberry-pi-ina219-tutorial/

https://pypi.org/project/pi-ina219/
dunno what happened to the aliexpress links?
https://www.ebay.co.uk/itm/302997431044

Can not really tell you more as not done any gpio work on that platform
To your original answer prob yes as has a port thought I was in the rockpro64 section hence 3a and all the rest doh! Smile


Messages In This Thread
Is the power source exposed to the OS? - by seal - 07-19-2019, 05:43 PM
RE: Is the power source exposed to the OS? - by stuartiannaylor - 07-20-2019, 07:17 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  power usage for Pine64 LTS + Screen Little_Johnny 1 2,990 02-17-2021, 07:19 PM
Last Post: Little_Johnny

Forum Jump:


Users browsing this thread: 1 Guest(s)