-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User-configurable number of pulsetimers to use with PCF8574 chip. #8266
Comments
You are right, change to 16 does corrupt settings area. Compability breaking change needed |
Theo is doing a lot of changes under the hood at the moment. |
@Jason2866 Thank you very much for the quick answer. Just a clarification: the number of relays is not the problem; the current version works fine with 16 relays. The problem is related only to the pulsetime functionality. Glad to know that there will be a solution, even if it needs a hardware upgrade to ESP32. Will try to get a couple of them. Any hint on the availability time? In the meantime, can you suggest any workaround for the intended watchdog functionality, or how to compile a custom version that works, even if compatibility is broken? |
Not easy, since settings are stored in a restricted area where no place is left. |
@Jason2866 Thank you for the feedback. This was a helpful hint; I had not realized that the reason for the settings garbling was lack of room in the settings area. Based on your remark, I was able to successfully build a custom version with 16 pulsetimers. I made room for them by disabling Domoticz support (which I don't use) and removing from the SYSCFG structure some unneded Domoticz-related variables. This involved only minimal changes to the tasmota.h and the settings.h files (as well as defining a specific CFG_HOLDER value). I know that modifying files that are not designed for user configuration is not an ideal solution, but considering that this is only needed for one specific relay controller and that the changes are clean and very localized, I think it is the best alternative for my needs. Thank you for your help. Shall I close the issue? I think the requested functionality can still be useful for other people, even if it cannot be addressed until some future release. |
Great you found a solution for your needs. The beauty of Open Source software. |
@gufonero I'm glad to stumble upon your issue and would like to know if you can share the changes inside settings.h and tasmota.h. I tried to simply reduce free_f61 space in order to compile it properly, but didn't get it to work by now. |
[EDIT: The solution described in this message is deprecated, since support for 32 pulsetimers has been implemented in the current Tasmota version. See message from Theo @arendst below.] @fflnvb Sure I'm happy to share the changes I made, but please note that they are based on Tasmota v8.2, later upgraded to v8.5.1. They might not be appropriate for later versions because if I remember correctly there were some changes in the config data area layout after Tasmota v.9. The general idea is to increase the number of pulsetimers defined by MAX_PULSETIMERS from 8 to 16. For this to work you need to remove something else that takes the same size from the config data area so that its size stays the same. I decided to remove some Domoticz-related data since I don't use Domoticz. All of this is controlled by two #define variables USE_CUSTOM_MULTI_PCF8574=1 and USER_MAX_PULSETIMERS=16 which are defined in an ad-hoc environment inside platformio_override.ini. You also need to change the value of the CFG_HOLDER variable to something different from the default. Here are the relevant parts of the setup. settings.hDisable the domoticz data areas as follows
tasmota.hDisable the domoticz data areas as follows
platformio_override.iniCreate a new environment as follows
user_config_override.hAdd the following to manage the built-in CFG_HOLDER and
Hope this helps. Please let me know if you need something else. |
I'll add support for 32 pulsetimers today.
|
Extent number of pulsetimers from 8 to 32 (#8266)
@arendst Nice enhancement, Theo. Thank you very much! |
Have you looked for this feature in other issues and in the docs?
Yes.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.
The number of Pulsetimers in Tasmota 8.2 is limited to a hard-coded value of 8, defined by the MAX_PULSETIMERS constant in the tasmota.h file. I need to increase it in order to control 16 relays driven by two PCF8574 IO expanders. The pulsetime functionality is used as a watchdog safeguard, to prevent the relays staying in the ON state indefinitely in case the MQTT OFF message does not reach the ESP due to WiFi failure.
Describe the solution you'd like
A clear and concise description of what you want to happen.
A user-friendly way to increase the number of pulsetimers. The concrete proposal is a MAX_PULSETIMERS preprocessor variable that can be defined in user_config_override.h
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Tried to compile a custom version changing the value of the MAX_PULSETIMERS constant in the tasmota.h file to 16, and changing also the CFG_HOLDER value. The ESP starts right after flashing, but on reboot it is unable to connect to the WiFi network.
This looks like a bug (see more details below), but it also may be that there more changes needed to increase the number of pulsetimers. I have found no documentation on this topic and I would appreciate any directions to make it work.
In any case I believe that the proposed change would be useful for people needing to drive more than 8 relays with a single ESP.
Additional context
Add any other context or screenshots about the feature request here.
Details on the functioning of the customized 8.2 version built with MAX_PULSETIMERS=16.
The firmware starts correctly after erasing / flashing, and both the console and the web UI are available.
The decode-config utility, when run right after this first boot, reports a length error (4112 = 4096 + 16).
My understanding is that increasing the number of pulsetimers makes the config data structure 16 bytes bigger, and I suspect that the firmware is mixing up both versions, but have not been able to understand what is happening precisely.
(Please, remember to close the issue when the problem has been addressed)
The text was updated successfully, but these errors were encountered: