-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Paged EEPROM writing proposal #87
base: main
Are you sure you want to change the base?
Conversation
If you want to keep same weardown guarantee, then instead of allowing 67 writes per hour we can allow 59 writes - exact amount of new regions unlocked. |
b189972
to
11bcf6e
Compare
11bcf6e
to
3117eaf
Compare
Thanks for your PR, but I fear there is a misunderstanding here on the reason for the annoying limit on parameter writes. This limit protects the flash memory in the Daikin unit, not in the ATmega. The ATmega EEPROM is only written if you switch mode (L0 to L1, L1 to L0 ) or if you change some of the other basic settings (V, C) which are supposed to be set only once. There is no protection against too many writes to the ATmega EEPROM, as such (ab)use was not anticipated - the system is supposed to remain in L1 mode. Thus no wear leveling was implemented. The parameter storage in Daikin F-series indoor systems may (*) have been implemented in flash memory without any wear leveling. The problem is that we cannot resolve this issue ourselves, it is just a limitation from the Daikin system itself. (*) In Daikin's Modbus Interface DIII design guide for the EKMBDXA7V1, a warning is included that "The number of control commands per indoor unit is limited to 7000 per year. If the BMS controls the units by using an automatic control program, please make sure it doesn’t exceed this limitation." The number of 7000x/year is likely based on 100.000x in an estimated life-time of 14 years. I remember a similar warning from another Daikin document which explicitly mentions flash wear as the reason for this limitation. The Modbus Interface DIII functions with many F-series systems as well as some simpler/older EKHBRD-A/EKEQ/EWAQ/EWYQ systems. As Daikin does not warn about any limitation in write frequency for Altherma models in their LAN adapter documents, I can only hope that proper wear leveling has been implemented in the (newer) Altherma models - perhaps we can thus remove the parameter write limitation for certain models or make it an option to remove it for well-informed users. I you are willing to risk flash wear, you can change the write frequency limits in the header file, but I would recommend to find another solution which limits the number of changes. |
Oh, that's very sad. My problem is - the unit is unable to keep temperature within desired contraints. More precise, it not able to keep temperature close to what is selected at the controller. I speculate it happens due to incorrectly placed thermometer (near air intake only). It's readings differs from my other zigbee thermometers in different rooms. (Its 23 degree in my living room, T0 temperature is 30, T1 temperature is 27). The only alternative solution I could think about is to add virtual thermometer device to the bus and somehow make unit make it's judgments based on this new sensor readings. Right now I need around 1 power cycle per hour to achieve this goal. (9 minutes cool down, 50 minutes waiting). I could just send "ambient temperature" instead of that. Hopefully it's not being written to the unit EEPROM. However I have no clue how to register such device on a bus. |
Controlling this virtual thermometer would make whole unit control much easier. I would just set it to "auto", and then set "current temperature" either colder than desired, hotter, or exactly as desired. |
I wonder if main controllers have the option to defer the room temperature measurement to a second, auxiliary, controller, to allow a virtual thermometer. But I doubt this is possible. Two other approaches might be: |
This merge is proposal of fighting annoying 1 update per hour limitation.
How it works. It reorganize memory layout of EEPROM.
Now it goes like this: | SIGNATURE | ACTIVE_PAGE_ID |
Where each page is: | WRITES_COUNT | PAGE_CONTENT |
Page is what you originally intent to store in EEPROM. But now each time WRITES_COUNT exceeds some threshold (I set it to 1000 writes), it copy current page content and move it to new page. So it wears EEPROM more evenly.
Also it stores WRITES_COUNT in memory, but writes it only on each 16 write, to further reduce stress on this cell.
Atmega has 1KB of EEPROM, so right now 59 pages fit in there. It has guarantee of 100.000 write/clear cycles per cell. So safe estimation for 10 years warranty is (59*100000/10/365/24) ~ 67 writes per hour.
I've updated
TIME_ERRORS_PERMITTED
andTIME_WRITE_PERMISSION
to 60 writes per hour