OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) sprinklers_pi – An alternative sprinkler control program

Viewing 25 posts - 26 through 50 (of 192 total)
  • Author
    Posts
  • #24950

    rszimm
    Participant

    Hmmm. So the 02:30:50 is actually what the software thinks is the local time. So it thinks it’s 2:30am the next morning (i.e. 6 hours away from you). If you run the ‘date’ command from a shell prompt on the raspberrypi, what do you get back?

    Incidentally, from the event view we can see that you’re setup to run schedule 0 at 6am and schedule 1 at 12:40am. Unfortunately, those are going to be relative to the wrong time zone, so they’re going to have gone off in the middle of the night.

    #24951

    alanwp
    Member

    Here’s what I get from date:

    pi@raspberrypi ~ $ date
    Thu Aug 1 15:20:28 UTC 2013

    This was at 9:20am local time so it looks right to me…

    #24952

    rszimm
    Participant

    Ahhh, so the raspberrypi is set to UTC rather than to MDT. I’m also in MDT and this is what I get when I run it:
    pi@raspberrypi1:~$ date
    Thu Aug 1 09:36:21 MDT 2013

    to set the timezone, run

    sudo dpkg-reconfigure tzdata
    #24953

    alanwp
    Member

    That was it. Funny thing, I had thought this was the problem yesterday and used tzselect to set the timezone – I either missed something or I don’t know what but anyway, I now get this output from date: Thu Aug 1 09:54:37 MDT 2013 and the schedules are working.

    Thanks!

    #24954

    rszimm
    Participant

    Fantastic!

    I think tzselect doesn’t actually “select the timezone” despite the name. It’s a utility to see what the time would be in other timezones.

    It occurs to me that this could have been avoided if the time on the front web page actually showed the fully configured local time. Right now the sprinklers program sends UTC time to the browser, and the browser converts that to local time. What I SHOULD be doing is converting to local time in the program and sending that to the browser. That way it will be very obvious that the timezone is messed up on the raspberrypi right from the front page.

    #24955

    boz
    Participant

    How can I configure wunderground with country information inside the client?
    Today it’s only postal code..

    Is it possible to get the source code?
    I really would like to learn to program this little amazing unit and your code is the way I like it..

    #24956

    rszimm
    Participant

    The source code is part of the distribution. If you have this running then you already have the source code on your raspberrypi.

    The weather adjustment stuff happens in the Weather.cpp file. That’s where the actual URL request to wunderground is formed and where the results are compiled into a duration adjustment. (look especially at Weather::GetScale() ). Right now it pulls from a zip code using the get string:

    /api/%s/yesterday/conditions/q/%ld.json where the %s is replaced by your API key, and the %ld is the zipcode.

    Using the wunderground API documentation here: http://api.wunderground.com/weather/api/d/docs?d=data/index you can see there are a lot of additional ways to query wunderground beyond just zipcode (e.g. lat/long, personal weather station id, city name, IP geolocation, etc).

    Good luck!. If you do something new and interesting, post it back here and I’ll incorporate it into the main line. At some point I’ll get this stuff up on github to make contributions easier…

    #24957

    danimal1228
    Member

    Great program.

    I have the OpenSprinklerPi with 7 zones connected to zones 1-7 and no master valve. I think I read in an earlier post that you have to skip zone 1 if you aren’t using a master. Is this correct? Is there anyway to make the change in software so that i can leave it wired as is?

    I like that you have 1 program that acts as the webserver and the controller.

    #24958

    boz
    Participant

    Sounds great, thanks for your code!
    I’ll check the code but my programing skills are limited but I’ll try my best!

    Sent from my iPad using Tapatalk HD

    #24959

    eddiek2000
    Member

    Very awesome work. Can’t wait for an update. I just received my RPi and am awaiting my OSPi board and expansion board (I have 12 zones) to really get started.

    Long story short is I have always wanted a PC programable sprinkler controller. I even tried to figure out the Rainbird remote protocol, but that went no where. Well, last Friday, my controller was taken out by a lightning storm. I have a temporary replacement on the way, but my long term goal is the Pi version. The OpenSprinkler program got my eye, but when I saw the Pi version, and this software, I was sold.

    Thanks Again!! If you need an expansion card for testing, I just might be able to help.

    #24960

    ndboost
    Participant

    give us some source code on github so we can contribute!!! 🙂

    #24961

    ndboost
    Participant

    @rszimm wrote:

    Ahhh, so the raspberrypi is set to UTC rather than to MDT. I’m also in MDT and this is what I get when I run it:
    pi@raspberrypi1:~$ date
    Thu Aug 1 09:36:21 MDT 2013

    to set the timezone, run

    sudo dpkg-reconfigure tzdata

    This solved so much of my headaches.. thank you so much.

    #24962

    eddiek2000
    Member

    @ndboost wrote:

    give us some source code on github so we can contribute!!! 🙂

    The source code is part of the distribution on page 1. I have been playing with it. I can get more than 7 zones, but can’t activate above #9. I also have an issue save data for zones over 9. There are a few constants that need adjusting and must be another I am missing. A debugger would be great to break on where I am having issues.

    I would like to add a seasonal adjustment too. I have found that setting very useful on my Rainbird.

    #24963

    craigmw
    Participant

    @eddiek2000 wrote:

    @ndboost wrote:

    give us some source code on github so we can contribute!!! 🙂

    The source code is part of the distribution on page 1. I have been playing with it. I can get more than 7 zones, but can’t activate above #9. I also have an issue save data for zones over 9. There are a few constants that need adjusting and must be another I am missing. A debugger would be great to break on where I am having issues.

    I would like to add a seasonal adjustment too. I have found that setting very useful on my Rainbird.

    I’m not sure what you mean by seasonal adjustment, but I believe you can control the watering “budget” using the Water Level field under the device options page. This can also be adjusted using the web app, which is really handy if you have an iPad, iPhone or Android. I love being able to turn on and off different zones while testing my sprinkler setup remotely using my Android phone. Also, I have the expansion board and have not had any problems with scheduling or activating zones 9+. That’s an interesting issue.

    #24964

    eddiek2000
    Member

    @craigmw wrote:

    @eddiek2000 wrote:

    @ndboost wrote:

    give us some source code on github so we can contribute!!! 🙂

    The source code is part of the distribution on page 1. I have been playing with it. I can get more than 7 zones, but can’t activate above #9. I also have an issue save data for zones over 9. There are a few constants that need adjusting and must be another I am missing. A debugger would be great to break on where I am having issues.

    I would like to add a seasonal adjustment too. I have found that setting very useful on my Rainbird.

    I’m not sure what you mean by seasonal adjustment, but I believe you can control the watering “budget” using the Water Level field under the device options page. This can also be adjusted using the web app, which is really handy if you have an iPad, iPhone or Android. I love being able to turn on and off different zones while testing my sprinkler setup remotely using my Android phone. Also, I have the expansion board and have not had any problems with scheduling or activating zones 9+. That’s an interesting issue.

    I must have missed the seasonal adjustment option. Will have to check it out tonight. As far as more than “7” zones, the OP states this about his release:
    @rszimm wrote:

    Wunderground IP: You can get it by resolving api.wunderground.com. It’s 38.102.136.138.

    There’s not currently support for a rain sensor. How is your rain sensor wired up? I don’t have a rain sensor, but adding support should be pretty simple. Anyone know what the optimal logic is w.r.t. a rain sensor? Rain the last 24 hours just don’t run any schedules?

    There’s also not currently support for more than 7 zones (plus a master valve or pump). Shouldn’t be difficult to add in though. Most of the logic is already there and it’s just a matter of changing a constant, but I’ll have to shift some stuff a bit in how schedules are stored because I only allowed room for the 7 zones. Not a big deal really, but some work… Plus I don’t actually own an expansion board so I’ll have to get you to test things out when I’ve got something to test.

    Did you mod the code to add support for more than 7 zones? Wanna share your mods?

    Thanks,
    Ed

    #24965

    cmoore
    Member

    I notice that the github repository has all the individual files under the OSPi tree, but then it also has ospi.tar.gz which seems to contain the same files. Why the two different copies? It seems like it would be really easy for those to get out of sync. In fact if I diff the two versions there are a lot of differences, but at first glance they seem to be trivial (like end-of-line markers being different). Maybe it would make sense to get rid of the ospi.tar.gz and just let people pull the source tree?

    #24966

    eddiek2000
    Member

    @cmoore wrote:

    I notice that the github repository has all the individual files under the OSPi tree, but then it also has ospi.tar.gz which seems to contain the same files. Why the two different copies? It seems like it would be really easy for those to get out of sync. In fact if I diff the two versions there are a lot of differences, but at first glance they seem to be trivial (like end-of-line markers being different). Maybe it would make sense to get rid of the ospi.tar.gz and just let people pull the source tree?

    This thread is about “sprinklers_pi” an alternative control program for the OSPi hardware platform. I think you are confusing the 2. See first post:

    @rszimm wrote:

    Hi there,
    I’ve created an alternative control software module to control the Raspberry Pi OpenSprinkler system. It’s entirely self contained and doesn’t require python, a web server, or any other heavy software to operate. It can also be compiled to run on the Atmel AVR / Arduino platforms, so theoretically it should run on the AVR OpenSprinkler as well.

    I created this a few months back before I had seen the web code created by Samer. The look and feel are pretty similar mainly due to the use of the same mobile web library (jQuery Mobile).

    Here are the features:

    • Fully contained system with control logic and web serving.[/*:3mh2r6lp]
    • Same code can be compiled to run on the Atmel/AVR/Arduino platform.[/*:3mh2r6lp]
    • Web based control (including mobile Android iOS)[/*:3mh2r6lp]
    • Automatic adjustment of intervals based on weather conditions. (weather underground API)[/*:3mh2r6lp]
    • Manual Control[/*:3mh2r6lp]
    • Scheduled Control[/*:3mh2r6lp]
    • Quick Schedule[/*:3mh2r6lp]
    • Named Zones[/*:3mh2r6lp]
    • Full Graphing feature of historic logs[/*:3mh2r6lp]
    • Ability to run with OpenSprinkler module or direct relay outputs.[/*:3mh2r6lp]

    Plus I’m working on a few other things…

    Here are a few screen shots from the software:


    Installation instructions:

    1. Start with a generally clean instance of Raspberry Pi Raspbian system. If you have a web server installed, you’ll want to avoid port conflicts (i.e. make sure it’s not running on 8080— the default for this software). If you’ve already installed the python interval program, disable it while you’re running this.
    2. Install the wiring pi module. Details are here: http://wiringpi.com/download-and-install/
    3. Install the sqlite3 library (technically optional, but why not do it anyway?), and the build tools
      sudo apt-get install libsqlite3-dev build-essential
    4. Download the source tarball here: http://stuff.intelligent-isi.com/sprinklers_pi/sprinklers_pi-1.0.1.tar.gz or type:
      wget http://stuff.intelligent-isi.com/sprinklers_pi/sprinklers_pi-1.0.1.tar.gz
    5. Unpack the source tarball:
      tar -xzvf sprinklers_pi-1.0.1.tar.gz
    6. Build and install the module:
      cd sprinklers_pi-1.0.1
      make
      sudo make install

    That’s it! If you want to start it, simply reboot or just run the following:

    sudo /etc/init.d/sprinklers_pi start

    If something goes wrong on startup you can get some diagnostic information at /var/log/sprinklers_pi.

    Once you’ve started things up, browse to port 8080 with a web browser. The system starts up in demo mode (i.e. it won’t actually switch outputs). To change the output type go to the Settings and change the Output type to “OpenSprinkler” (assuming you’re using the OpenSprinklerPi module).

    For those who are particularly adventurous, the sprinkling logs are stored in sqlite3 database format, so if you really care, you can query them with SQL using the database at /usr/local/etc/sprinklers_pi/db.sql

    I’m going to get the source up somewhere like github over the next couple days…

    #24967

    ogtommy
    Member

    love the program.up and running in no time!!!so straightforward too. quick question though, on the scheduling, when i set the individual zones time length, do they run 1 after the other? or do they all run together? i set all the zones for 1 minute(using it with a pump and drippers in a greenhouse) and 4 different run times during the day.if all 4 zones i have turn on together there will be not enough pressure.is there a way to run them sequentially without running 4 schedudles? thanks for an awesome program

    #24968

    rszimm
    Participant

    ogtommy: they should not run at the same time. They should run sequentially. When you go to the Manual control page, can you turn on each individual zone by itself? If not, you may have a wiring problem or you may not have configured the software to use the opensprinklersPi hardware under the settings page. (or I’ve got a bug!)

    eddiek2000: Getting to 9 zones is pretty straightforward (just setting a constant I believe). Beyond that I’ve got to change all the web pages and the corresponding logic because they communicate through form data with z1-z9 being the individual zones. Beyond 9 it doesn’t work. Easy fix, but it’s in a bunch of different places. However, there’s another limitation a bit farther out. At (I believe) 12 zones, we run out of space in the structure for the schedule, so it can’t be saved. This is a bit of an anachronism in that the code was ported from an arduino based sprinkling system, and I only had 2k of EEPROM space, so I had to use it wisely. Seems a bit silly in the raspberry pi world. Quick fix would be to simply move things around in the settings file to allow for a full 15 zones. Longer fix will be to go to a more user-friendly settings file format. I have this at the top of my to-do list, but I’ve been pretty busy the past few weeks. I should be able to get to it this week for sure…

    #24969

    ogtommy
    Member

    ok. problem solved. thank you again for an awesome program 😀

    one more thing…complete noob question but i got it to here so far…so, i now have this program installed on my raspberry pi and also my brothers. i need to uninstall it off of his before he realizes i was tinkering with his stuff. is there an easy way to do this without having to reinstall raspbian? Im worried about this program auto starting and then there might be a port conflict if he runs a server or something similar.
    Thanks again

    #24970

    rszimm
    Participant

    To remove it, go to the same directory you installed from (i.e. where you typed “sudo make install”), and type “sudo make remove”. It will remove all the program files and data files.

    #24971

    trash007
    Participant

    First off. Great work. Suggestion for wunderground section update is to be able to enter a pws instead of a zipcode query. So the query would look like:

    /api/%s/yesterday/conditions/q/pws:%ws.json where %ws is the name/call sign for the personal weather station. This would allow the weather indicator to be even as accurate as the neighborhood.

    I would be even tempted to get my own wunderground station($100-200) at some point. 🙂

    ~H

    @rszimm wrote:

    The source code is part of the distribution. If you have this running then you already have the source code on your raspberrypi.

    The weather adjustment stuff happens in the Weather.cpp file. That’s where the actual URL request to wunderground is formed and where the results are compiled into a duration adjustment. (look especially at Weather::GetScale() ). Right now it pulls from a zip code using the get string:

    /api/%s/yesterday/conditions/q/%ld.json where the %s is replaced by your API key, and the %ld is the zipcode.

    Using the wunderground API documentation here: http://api.wunderground.com/weather/api/d/docs?d=data/index you can see there are a lot of additional ways to query wunderground beyond just zipcode (e.g. lat/long, personal weather station id, city name, IP geolocation, etc).

    Good luck!. If you do something new and interesting, post it back here and I’ll incorporate it into the main line. At some point I’ll get this stuff up on github to make contributions easier…

    #24972

    mikethechap
    Participant

    @rszimm wrote:

    As a followup, rather than hardwiring a rain sensor to your sprinkler controller, I could actually pull data from your internet connected personal weather station assuming you’ve got one that’s reporting to Weather Underground. That would actually be pretty trivial, and would be MUCH more complete than just a rain sensor because I could do different things based on temperature, humidity and exactly how MUCH rain was received.

    That’s not to say I shouldn’t support hardwired rain sensors anyway… Just a thought…

    I just wanted to follow-up. I am interested in pulling the data from my weather station. It does report to Weather Underground. Which, as you mention, would be better.

    Also, have you been able to add zone extension code to your program? Just wondering.

    Thanks,

    Mike

    #24973

    eddiek2000
    Member

    @trash007 wrote:

    First off. Great work. Suggestion for wunderground section update is to be able to enter a pws instead of a zipcode query. So the query would look like:

    /api/%s/yesterday/conditions/q/pws:%ws.json where %ws is the name/call sign for the personal weather station. This would allow the weather indicator to be even as accurate as the neighborhood.

    I would be even tempted to get my own wunderground station($100-200) at some point. 🙂

    ~H

    A local weather station is my plan. A quick look at the price of components looks to be in the neighborhood of $225:

    $60 for pi with SD card and wifi.
    $120 for weather station
    $45 for radiation shield for weather station

    #24974

    LLMoon
    Member

    For you guys who want to pull data from your personal weather station, you may be able to do that by entering “pws:XXXXXXXXXX” in the ZIP field on the settings screen. (where XXXXXXXX is your personal station ID).

    I have not tried this, but the code appears to place the ZIP directly in the HTML query field. There are a number of different query formats, listed below and in the link. You may need to change the ZIP field type from numeric to text in web.cpp, etc. and then rebuild.

    Here is the format for the query field from wunderground API documentation. I think you could enter any of these query strings in the ZIP field if it is stored as a string.

    from http://www.wunderground.com/weather/api/d/docs?d=data/index
    query
    The location for which you want weather information. Examples:
    CA/San_Francisco (US state/city)
    60290 (US zipcode)
    Australia/Sydney (country/city)
    37.8,-122.4 (latitude,longitude)
    KJFK (airport code)
    pws:KCASANFR70 (PWS id)
    autoip (AutoIP address location)
    autoip.json?geo_ip=38.102.136.138 (specific IP address location)

Viewing 25 posts - 26 through 50 (of 192 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) sprinklers_pi – An alternative sprinkler control program