OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) Master Valve on Zone 9-16?

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #36261

    mark
    Participant

    I have an expansion board and would like to put my master valve on a zone other than 1-8.  The drop down for master valve only gives 1-8 as options, even though I have the extra 8 zones (9-16) configured.  My current sprinkler system is already setup with zones 1-9, and has the master labeled as ’10’.  I would like to keep things clean and clear in my mind (and current labels) and keep the labels matching the same in OpenSprinkler.  Thank you for any help!

    #36263

    Samer
    Keymaster

    Sorry, unfortunately only stations 1-8 can be designated as master station in the current firmware.

    #36274

    mark
    Participant

    Thank you for the quick response!  Looks like I’m learning Python . . .

    #36299

    Ray
    Keymaster

    The original reason it’s constrained to stations 1-8 is that I thought stations 1-8 always exist, so when you define a master station it’s always valid. However, now I think about it, there is no reason why it can’t be just any station. It’s pretty easy to modify the code to support that.

    #36528

    mark
    Participant

    Yes, very easy to change.  However in doing so, I believe I exposed an existing bug (Which took a lot of time to find).  Here’s how I did it.  To change the front end, replace the code inside the ‘elif name==”mas”:’ section with the following:

    output += “<select name=’omas’>\n”
    output += “<option ” + (“selected ” if value==0 else “”) + “value=’0′>”+_(‘None’)+”</option>\n”
    for bid in range(0,gv.sd[‘nbrd’]):
    for s in range(0,8):
    sid=bid*8 + s;
    if gv.sd[‘show’][bid]&(1<<s):
    output += “<option “+(“selected ” if value==sid+1 else “”)+ “value='”+str(sid+1) +”‘>Station “+ str(sid+1).rjust(2,’0’)+”: “+snames[sid]+”</option>\n”
    output += “</select>\n”

    This will check to see if the option of the expansion board is present, and will only load zones marked as active.  The current code handles the upper values for the master just fine, and runs it perfect.  But I did find a bug in the display.  So even though the master value will turn on and off, the front end web page shows it as off.  To fix that, a simple change in the ospi.py file is needed.  Change line 97 gv.sbits[b] |=1 << sid  to gv.sbits[b] |=1 << s  ‘Sid’ will grow from 1 to 16, ‘s’ will will grow from 1 to 8 twice.  Since master was only on 1-8, using ‘sid’ was never an issue.

     

    #36537

    Ray
    Keymaster

    Thanks for making the changes. Because the assumption (that master valve can only be from 1-8) was made ever since the beginning, I won’t be surprised there are bugs (like the one you reported) that need to be fixed. It’s probably not a bug per se — since the master valve was limited to 1-8, (1<

    #36920

    GregT
    Participant

    I’m also looking to put a master on a station above 8. Is there a file I can pull from git that has these changes in it? Or will this be included in base code once it supports two masters? Thanks!

    #36950

    mark
    Participant

    I didn’t create a branch for these changes, I just opened the files and changed them locally. If you’d like to do the same, follow my previous post above. If you need more specific help, please let me know and I can walk you through it (it’s really simple).

    #37062

    Marco83
    Participant

    Hello, I have a very stupid question, I am a beginner.
    I have an Opensprinkler with 48 zones and I would like to set zone 48 as the Master.
    Mark did share with us very precious code lines, however I don’t know how to upload them into my OpenSprinkler. Do I have to compile the code? Is there a step by step procedure?

    Thanks for your help

    Marco

    #37063

    Samer
    Keymaster

    This has been added to the upcoming firmware and will be released in 2.1.4. Ray will be announcing it soon.

    Thanks

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

OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) Master Valve on Zone 9-16?