stefanbode / Sonoff-Tasmota

Provide ESP8266 based itead Sonoff with Web, MQTT and OTA firmware using Arduino IDE, enhanced with I2C options
GNU General Public License v3.0
126 stars 40 forks source link

Pulsetimers #3

Closed mrmin24 closed 7 years ago

mrmin24 commented 7 years ago

Hi,

There are still only 4 pulsetimers available for PCF8574 setup. This is not ideal especially for irrigation.

Thanks

stefanbode commented 7 years ago

Hi, this can be changed easily in the standard already in sonoff.ino. OK?

define MAX_PULSETIMERS 4 // Max number of supported pulse timers

Thanks for pointing out the pulsetimers. Haven't seen them so far. Yes great help and make it simpler. Will enable this for my project also.

mrmin24 commented 7 years ago

Yes, I will test this too. I suppose it is worth having a" IFDEF USE_PCF8574" to adjust these to 8 or more.

stefanbode commented 7 years ago

There is an additional hardcoded line in sonoff.ino: line 1373 somewhere here:

This is hardcoded &3 (Binary 11) and needs to be flexible.

pulse_timer[(device -1)&((1<<MAX_PULSETIMERS)-1)] = (power & mask) ? sysCfg.pulsetime[(device -1)&((1<<MAX_PULSETIMERS)-1)] : 0;

mrmin24 commented 7 years ago

I tested your latest baseline and the timers are working, but it seems that if you activate the nth timer and the n + 4th time (e.g.1 and 5 or 2 and 6) at the same time, the nth relay never switches off. If you activate any other timer with nth timer, it works fine

stefanbode commented 7 years ago

Fixed with 5.1.4 update