zmiana w modb_orno3.c i dodanie skryptu usuniecie_pola_highfluct.sh

This commit is contained in:
ms
2026-02-15 22:22:01 +01:00
parent bc399e0044
commit 7220d3e750
2 changed files with 14 additions and 17 deletions

View File

@@ -348,25 +348,21 @@ int influx_send_orno_batch(s_voltage *v, int v_ok, s_current *i, int i_ok,
char batch[1024];
int offset = 0;
if (v_ok) {
offset += snprintf(batch + offset, sizeof(batch) - offset,
"orno,device=orno,pomiar=voltage L1=%.2f,L2=%.2f,L3=%.2f\n", v->U1, v->U2, v->U3);
}
if (i_ok) {
offset += snprintf(batch + offset, sizeof(batch) - offset,
"orno,device=orno,pomiar=current L1=%.2f,L2=%.2f,L3=%.2f\n", i->I1, i->I2, i->I3);
}
if (p_ok) {
offset += snprintf(batch + offset, sizeof(batch) - offset,
"orno,device=orno,pomiar=power total=%.3f,L1=%.3f,L2=%.3f,L3=%.3f\n", p->P_Tot, p->P1, p->P2, p->P3);
}
if (w_ok) {
offset += snprintf(batch + offset, sizeof(batch) - offset,
"orno,device=orno,pomiar=energy total=%.3f,L1=%.3f,L2=%.3f,L3=%.3f\n", w->W_Tot, w->W1, w->W2, w->W3);
}
/* Line protocol format: measurement,tag=value field=value ... */
/* New format groups data by phase with U, I, P, W fields */
offset += snprintf(batch + offset, sizeof(batch) - offset,
"energydb,device=orno,phase=L1 U=%.2f,I=%.2f,P=%.2f,W=%.2f\n"
"energydb,device=orno,phase=L2 U=%.2f,I=%.2f,P=%.2f,W=%.2f\n"
"energydb,device=orno,phase=L3 U=%.2f,I=%.2f,P=%.2f,W=%.2f\n"
"energydb,device=orno,phase=total P=%.2f,W=%.2f\n",
v->U1, i->I1, p->P1, w->W1,
v->U2, i->I2, p->P2, w->W2,
v->U3, i->I3, p->P3, w->W3,
p->P_Tot, w->W_Tot);
if (f_ok) {
offset += snprintf(batch + offset, sizeof(batch) - offset,
"orno,device=orno,pomiar=frequency frequency=%.4f\n", f->Freq);
"energydb,device=orno,frequency=Hz value=%.4f\n", f->Freq);
}
if (offset == 0) return 0;