-

CommentStreams:850600a5301195888891e85c7d9a4175

From Geekworm Wiki
< X750
Revision as of 23:09, 5 January 2021 by 73.3.156.187 (talk) (Migrated comment #1293)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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]
  1. ...

while True:

status = readStatus(bus)
  1. ...
print "Status:%6i" % status
  1. ...
if status < 512:
        print "USB Power Connected 2A Charging"
elif status < 1024:
        print "AC Power Connected 3A Charging"