I have an emonTH bought from the openenergymonitor.com shop (order 11461, 15 Feb 2016) which I believe came with firmware V2.6 installed. It was supplied with a DHT22 and external DS18B20 installed, and I have since added an optical pulse counter via the terminal strip.
After adding the pulse counter, I found that I was getting very large percentage of bad temperature and humidity readings (humidity frequently dipped to 0% for one reading, the DS18B20 would jump to about 85C, and the DHT22 returned a zero temperature value).
I have looked at the firmware source (emonTH_DHT22_DS18B20_RFM69CW_Pulse.ino) and believe that I have found a problem with the way low power time delays are generated by using the watchdog timer to re-activate the ATmega after putting it into a power down mode. The pulse counting interrupts are causing premature reactivation of various critical delays resulting in invalid data being generated.
Is this a known problem? If not, is this the right forum with which to share the fix?
Most of the errors are fixed with the following patch in ‘dodelay()’:
#ifdef INSOMNIA while(Sleepy::loseSomeTime(ms) == 0) if(insomnia++ > 100) break; #else Sleepy::loseSomeTime(ms); // JeeLabs power save function: enter low power mode for x seconds (valid range 16-65000 ms) #endif
but there are some other problems like an apparent attempt to de-bounce the pulses which doesn’t seem to be able to work (unless I have misunderstood the intention).
.
Regards,
DigbyT