# HG changeset patch # User Michiel Broek # Date 1712840252 -7200 # Node ID 0c2c66920d79f9a27338f5ad8957d3854b3556dd # Parent b2e2cbb13cb37372d9101e8e2aa45a15633708f1 Only log temperature error once. Only log temperature Ok again once. Do not log changed temperature. diff -r b2e2cbb13cb3 -r 0c2c66920d79 thermferm/devices.c --- a/thermferm/devices.c Thu Apr 11 13:18:20 2024 +0200 +++ b/thermferm/devices.c Thu Apr 11 14:57:32 2024 +0200 @@ -238,7 +238,7 @@ time_t now, my_timestamp; int my_value, test_value; #ifdef HAVE_WIRINGPI_H - int i; + int rc, i; char buf[40]; #endif @@ -792,9 +792,12 @@ // syslog(LOG_NOTICE, "sensor %s value %d", dev_w1->address, dev_w1->value); found = TRUE; if ((dev_w1->value == -1) || (dev_w1->value < -55000)) { - syslog(LOG_NOTICE, "sensor %s value error %d", device->address, dev_w1->value); + if (device->present != DEVPRESENT_ERROR) + syslog(LOG_NOTICE, "sensor %s value error %d, keep %d", device->address, dev_w1->value, device->value); device->present = DEVPRESENT_ERROR; } else { + if (device->present != DEVPRESENT_YES) + syslog(LOG_NOTICE, "sensor %s value ok %d", device->address, dev_w1->value); device->value = dev_w1->value; device->timestamp = time(NULL); device->present = DEVPRESENT_YES; diff -r b2e2cbb13cb3 -r 0c2c66920d79 thermferm/one-wire.c --- a/thermferm/one-wire.c Thu Apr 11 13:18:20 2024 +0200 +++ b/thermferm/one-wire.c Thu Apr 11 14:57:32 2024 +0200 @@ -340,8 +340,8 @@ mDelay(conv_time); if ((fgets(buffer, 25, fp))) { sscanf(buffer, "%d", &value); - if (cur_w1->value != value) - syslog(LOG_NOTICE, "One-wire device %s temperature read %d => %d", cur_w1->address, cur_w1->value, value); +// if (cur_w1->value != value) +// syslog(LOG_NOTICE, "One-wire device %s temperature read %d => %d", cur_w1->address, cur_w1->value, value); cur_w1->value = value; /* devices.c will pick this up */ } else { syslog(LOG_NOTICE, "One-wire device %s temperature read error", cur_w1->address);