Feature: Save time with RTC or in Flash memory #4

Open
opened 2024-07-25 00:49:46 +02:00 by DeltaLima · 0 comments
Owner

When the Controller starts and there is no connection to the NTP Server, it will try to reach it into infinity. During this time, all grow related stuff is off, which can be fatal e.g. when the light stays off for hours/days.
To prevent this, there should be a timeout with an alternative to restore the time.

One way could be to just use an external RTC via I2C e.g. DS3231

Another way is to store e.g. every hour the last timestamp.
Doing this with eeprom() could cause damage to the flash on the long term i guess. I think littlefs is a much better way to do, but still produces a lot write cycles on the flash memory, but it comes with an wear out logic.

I remember I read esp8266 flash memory can handle up to 100.000 write crycles per bit ?

Assuming a grow duration of 90 days, that would be 90days * 24 hours = 2160 times writing the timestamp.
100.000 / 2160 = ~46 grows
46 grows (90days) / 4 (quarter year) = 11,5

So after about 11 years the flash memory would be at its specified write limit.

When the Controller starts and there is no connection to the NTP Server, it will try to reach it into infinity. During this time, all grow related stuff is off, which can be fatal e.g. when the light stays off for hours/days. To prevent this, there should be a timeout with an alternative to restore the time. One way could be to just use an external RTC via I2C e.g. DS3231 Another way is to store e.g. every hour the last timestamp. Doing this with eeprom() could cause damage to the flash on the long term i guess. I think littlefs is a much better way to do, but still produces a lot write cycles on the flash memory, but it comes with an wear out logic. I remember I read esp8266 flash memory can handle up to 100.000 write crycles per bit ? Assuming a grow duration of 90 days, that would be 90days * 24 hours = 2160 times writing the timestamp. 100.000 / 2160 = ~46 grows 46 grows (90days) / 4 (quarter year) = 11,5 So after about 11 years the flash memory would be at its specified write limit.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: DeltaLima/CanGrow#4
No description provided.