-
CommentStreams:850600a5301195888891e85c7d9a4175
Jump to navigation
Jump to search
I've been playing with random registers on the i2c-1 0x36 address and I have discovered that channel 0x14 seems to behave like a sort of power consumption meter, can anyone verify this?
While pulling around 7amps with 4 batteries, this addition to the x750ups.py script works perfectly and seems very accurate! (ymmv depending on battery quantity/quality/health and amperage you are pulling, you may need to play with the values):
def readStatus(bus):
address = 0x36
read = bus.read_word_data(address, 0x14)
return struct.unpack("<H", struct.pack(">H", read))[0]
- ...
while True:
status = readStatus(bus)
- ...
print "Status:%6i" % status
- ...
if status < 512:
print "USB Power Connected 2A Charging"
elif status < 1024:
print "AC Power Connected 3A Charging"