OpenSprinkler › Forums › Comments, Suggestions, Requests › Change request – Water duration with one sec resolution
- This topic has 4 replies, 2 voices, and was last updated 9 years, 3 months ago by Ray.
-
AuthorPosts
-
October 17, 2015 at 9:00 am #40533
sakosParticipantHi,
There is a limitation that the seconds settings disappears on the GUI when the minutes are more than 0. It means that I cannot configure e.g 1:30 watering time for a station.
I checked the code and found that a very strange thing. The 16 bit encoded watering time is encoded to 8 bits for storing then decoded to 16 bit again when it is used for scheduling. Actually I could not understand the rational behind that.I think it would be very easy to remove this unnecessary limitation and let the users to set the timer with one second resolution in the whole range (0s->24hours)
October 17, 2015 at 12:05 pm #40539
sakosParticipantIt seems that even the API has been changed and the below coding is obsolete.
0 – 59 seconds, in steps of seconds
1 to 179 minutes, in steps of minutes
3 to 16 hours, in steps of hoursOctober 17, 2015 at 9:18 pm #40547
RayKeymasterThis is because when stored in EEPROM the water time is converted to 1-byte representation. It uses a non-linear scaling method to do this conversion. Because OpenSprinkler supports a large number of stations (56 in the current firmware) and a large number of programs, in order to fit everything in the limited EEPROM, it’s necessary to reduce the storage size for water times.
The relevant discussion is in this thread:
https://opensprinkler.com/forums/topic/survey-can-station-water-time-fit-in-1-byte/
The current compression scheme is based on the fact that very few users need second-level granularity at all. Most users need just minute-level granularity. In addition, this only affects the stored water time — at run-time the actual water time is the stored water time multiplied by the watering percentage, and it is down to resolution of seconds.The API is designed to be transparent of how the water times are stored internally, so when using the API you don’t need to be aware of the compression method.
October 21, 2015 at 3:28 am #40574
sakosParticipantI see. Actually it is a rear but a valid use case when such granularity is needed. e.g. for seed germination program (1:30 watering, 10 times a day) Since the EEPROM is not a limitation for RPi this compression could be removed from those verison.
I modified the firmware and it works fine. Even the GUI allows the setting of such durations with typing in the values directly instead of clicking on +/- signs.October 22, 2015 at 8:34 am #40587
RayKeymasterWe are considering to change this to second-level granularity in the next firmware, by storing program data onto the microSD card. This way the storage will not be limited by EEPROM.
-
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › Comments, Suggestions, Requests › Change request – Water duration with one sec resolution