Convert and update values shown in the cointerra api output.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
diff --git a/driver-cointerra.c b/driver-cointerra.c
index cb63264..d17c0aa 100644
--- a/driver-cointerra.c
+++ b/driver-cointerra.c
@@ -566,6 +566,11 @@ static void cta_parse_debug(struct cointerra_info *info, char *buf)
info->autovoltage = u8_from_msg(buf, CTA_STAT_AUTOVOLTAGE);
info->current_ps_percent = u8_from_msg(buf, CTA_STAT_POWER_PERCENT);
info->power_used = hu16_from_msg(buf,CTA_STAT_POWER_USED);
+ info->power_voltage = hu16_from_msg(buf,CTA_STAT_VOLTAGE);
+ info->ipower_used = hu16_from_msg(buf,CTA_STAT_IPOWER_USED);
+ info->ipower_voltage = hu16_from_msg(buf,CTA_STAT_IVOLTAGE);
+ info->power_temps[0] = hu16_from_msg(buf,CTA_STAT_PS_TEMP1);
+ info->power_temps[1] = hu16_from_msg(buf,CTA_STAT_PS_TEMP2);
mutex_unlock(&info->lock);
}
@@ -1013,11 +1018,11 @@ static struct api_data *cta_api_stats(struct cgpu_info *cgpu)
/* Status readings */
for (i = 0; i < CTA_CORES; i++) {
sprintf(buf, "CoreTemp%d", i);
- root = api_add_uint16(root, buf, &info->coretemp[i], false);
+ root = api_add_int16(root, buf, &info->coretemp[i], false);
}
- root = api_add_uint16(root, "Ambient Low", &info->ambtemp_low, false);
- root = api_add_uint16(root, "Ambient Avg", &info->ambtemp_avg, false);
- root = api_add_uint16(root, "Ambient High", &info->ambtemp_high, false);
+ root = api_add_int16(root, "Ambient Low", &info->ambtemp_low, false);
+ root = api_add_int16(root, "Ambient Avg", &info->ambtemp_avg, false);
+ root = api_add_int16(root, "Ambient High", &info->ambtemp_high, false);
for (i = 0; i < CTA_PUMPS; i++) {
sprintf(buf, "PumpRPM%d", i);
root = api_add_uint16(root, buf, &info->pump_tachs[i], false);
@@ -1103,6 +1108,12 @@ static struct api_data *cta_api_stats(struct cgpu_info *cgpu)
root = api_add_uint8(root,"AV",&info->autovoltage, false);
root = api_add_uint8(root,"Power Supply Percent",&info->current_ps_percent, false);
root = api_add_uint16(root,"Power Used",&info->power_used, false);
+ root = api_add_uint16(root,"IOUT",&info->power_used, false);
+ root = api_add_uint16(root,"VOUT",&info->power_voltage, false);
+ root = api_add_uint16(root,"IIN",&info->ipower_used, false);
+ root = api_add_uint16(root,"VIN",&info->ipower_voltage, false);
+ root = api_add_uint16(root,"PSTemp1",&info->power_temps[0], false);
+ root = api_add_uint16(root,"PSTemp2",&info->power_temps[1], false);
return root;
}
@@ -1119,9 +1130,9 @@ static void cta_statline_before(char *buf, size_t bufsiz, struct cgpu_info *coin
if (info->corefreqs[i] > freq)
freq = info->corefreqs[i];
}
- max_volt /= 100;
+ max_volt /= 1000;
- tailsprintf(buf, bufsiz, "%3dMHz %3.1fC %2.1fV", freq, cointerra->temp, max_volt);
+ tailsprintf(buf, bufsiz, "%4dMHz %3.1fC %3.2fV", freq, cointerra->temp, max_volt);
}
struct device_drv cointerra_drv = {
diff --git a/driver-cointerra.h b/driver-cointerra.h
index eb6175c..523012e 100644
--- a/driver-cointerra.h
+++ b/driver-cointerra.h
@@ -15,7 +15,7 @@
#define CTA_READ_TIMEOUT 1
#define CTA_READ_INTERVAL 100
#define CTA_SCAN_INTERVAL 500
-#define CTA_RESET_TIMEOUT 200
+#define CTA_RESET_TIMEOUT 1000
#define CTA_INIT_DIFF 32*0.9999847412109375
@@ -118,9 +118,15 @@
#define CTA_STAT_UPTIME_MS 21
#define CTA_STAT_HASHES 25
#define CTA_STAT_FLUSHED_HASHES 33
-#define CTA_STAT_AUTOVOLTAGE 41
-#define CTA_STAT_POWER_PERCENT 42
-#define CTA_STAT_POWER_USED 43
+#define CTA_STAT_AUTOVOLTAGE 41
+#define CTA_STAT_POWER_PERCENT 42
+#define CTA_STAT_POWER_USED 43
+#define CTA_STAT_VOLTAGE 45
+#define CTA_STAT_IPOWER_USED 47
+#define CTA_STAT_IVOLTAGE 49
+#define CTA_STAT_PS_TEMP1 51
+#define CTA_STAT_PS_TEMP2 53
+
#define CTA_CORES 8
#define CTA_PUMPS 2
@@ -183,6 +189,11 @@ struct cointerra_info {
uint8_t autovoltage;
uint8_t current_ps_percent;
uint16_t power_used;
+ uint16_t power_voltage;
+ uint16_t ipower_used;
+ uint16_t ipower_voltage;
+ uint16_t power_temps[2];
+
/* Calculated totals based on work done and nonces found */
uint64_t hashes;