diff --git a/rd_unb2c.py b/rd_unb2c.py index bd59ab928ad7c83c679a1d7b470453a6d3dddd7b..8299b0aa1530cc9ab44aca7a44b8a62ab6888dce 100644 --- a/rd_unb2c.py +++ b/rd_unb2c.py @@ -75,7 +75,9 @@ def read_pol(node_nr, i2c_addr): if ret_ack < 1: print("no device found") else: + sleep(0.1) ret_ack, vout_mod = LOC_PWR.read_bytes(LP_VOUT_MODE, 1) + sleep(0.1) ret_ack, raw_value = LOC_PWR.read_bytes(LP_VOUT, 2) vout_mod = int(vout_mod,16) ret_value = [] @@ -83,12 +85,14 @@ def read_pol(node_nr, i2c_addr): ret_value.append(int(raw_value[2:], 16)) vout = calc_lin_3bytes(ret_value, [vout_mod]) stri = "Output voltage :{0: <5.2f} V ".format(vout) + sleep(0.1) ret_ack, raw_value = LOC_PWR.read_bytes(LP_IOUT, 2) ret_value=[] ret_value.append(int(raw_value[:2],16)) ret_value.append(int(raw_value[2:],16)) iout = calc_lin_2bytes(ret_value) stri += "Output Current :{0: <5.2f} A ".format(iout) + sleep(0.1) ret_ack,raw_value = LOC_PWR.read_bytes(LP_temp, 2) ret_value=[] ret_value.append(int(raw_value[:2],16)) @@ -160,7 +164,7 @@ def read_qsfp(node_nr = 0, module=0): stri = "Voltage QSFP in slot {0} node {1} is {2:3.2f} V".format(module, node_nr, Power_in_mod) print(stri) -if 1: +if 0: rw_eeprom(0xCD) for color in list(LED_COLORS.keys()): print(color) @@ -171,7 +175,7 @@ if 1: for node_cnt in range(4): for qsfp_cnt in range(6): read_qsfp(node_nr = node_cnt, module=qsfp_cnt) -#else: +else: for node_cnt in range(4): read_pol(node_cnt, LOC_POWER_CORE) read_pol(-1,0x01)