OpenSprinkler Forums Comments, Suggestions, Requests Change request – Water duration with one sec resolution

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #40533

    sakos
    Participant

    Hi,

    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)

    #40539

    sakos
    Participant

    It 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 hours

    #40547

    Ray
    Keymaster

    This 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.

    #40574

    sakos
    Participant

    I 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.

    #40587

    Ray
    Keymaster

    We 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.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums Comments, Suggestions, Requests Change request – Water duration with one sec resolution