OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) OpenSprinkler Pi demo scripts might need to be edited

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #22362

    ricm916
    Member

    I received my OpenSprinkler Pi module yesterday (Yay!!!!), and have been working today to get the Google Calendar demo working, with a little frustration. I thought I’d share my experience with anybody else lucky enough to get one of these early boards.

    I found that the ospi_selftest application worked perfectly to turn on and off my sprinkler valves, but neither the ospi_gc.py nor the ospi_manual.py scripts would work… the screen output made me believe that I had all dependencies working, but the sprinklers would not turn on.

    With a little help from “The Oracle” (ummm… to the uninitiated, that means “www.google.com”), I discovered that there are two different GPIO pinouts on the Raspberry Pi — and I had version 2. It appears that the python demo scripts are setup for version 1 pinouts:
    # OSPI PIN DEFINES
    pin_sr_clk = 4
    pin_sr_noe = 17
    pin_sr_dat = 21
    pin_sr_lat = 22

    Since I have a version 2 board, I needed to change the PIN DEFINES to the following (just one change – pin_sr_dat):
    # OSPI PIN DEFINES
    pin_sr_clk = 4
    pin_sr_noe = 17
    pin_sr_dat = 27
    pin_sr_lat = 22

    Once saved, everything worked fine. I can’t wait to get this linked with OpenWeather’s API, too!

    I hope this saves any of you the frustration I experienced!

    -Ric

    #23391

    Ray
    Keymaster

    Hi Ric,

    Thanks for pointing this out. Indeed I had no idea there are two versions. I suppose this is a Python library/software thing (since you said the c program worked). I will post about this on my blog.

    #23392

    ricm916
    Member

    Happy to help… 🙂

    I LOVE the product…

    I am getting the following error at script startup, but otherwise it runs fine:
    /home/pi/ospi_gc.py:132: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
    GPIO.setup(pin_sr_dat, GPIO.OUT)

    -Ric

    #23393

    Ray
    Keymaster

    That’s probably because the program did not clean up the GPIO when it terminated during the last run. I think I’ve added code to call GPIO.cleanup upon pressing CTRL+C, but maybe the program terminated in some other way.

    #23394

    noticz
    Member

    I am getting the same error:

    /home/pi/demo/gcalendar/ospi_gc.py:120: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
    GPIO.setup(pin_sr_lat, GPIO.OUT)

    I am not 100% sure but it might have something to do with running this script while the sprinklers_pi program is running?

    So I have came to the conclusion that the gcalendar addon needs to be combined with the sprinklers_pi/mobile app. I love the interface and ease of the mobile app but when it comes to scheduling I find it more of a pain to add and change stuff. Possibly an option with a checkbox for bypassing the program mode with the google calendar_id and if enabled the app can do an API call to get the schedules. Since all the code is there it would be easy to do another API call to save the information to google….Just a thought!

    I want to see if I can get a reply here before I attempt to crack open the sprinklers_pi/mobile app.

    Thanks fellas and thanks for such a kick ass/inexpensive house MOD. Took me an hour to set up from start to finish (download, burn, plug in, turn on, hook up, configure, change password, forward router) and I was all done setting up the coolest sprinkler system on the block.

    #23395

    Ray
    Keymaster

    /home/pi/demo/gcalendar/ospi_gc.py:120: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
    GPIO.setup(pin_sr_lat, GPIO.OUT)

    if you are using the pre-configured SD card image, it’s set to run Dan’s interval_program by default, which is written in Python. Since ospi_gc.py is also a Python program, if you run it without disabling interval_program first, you will get a GPIO conflict as the warning message you see. What you can do is to stop interval_program first. You can check the Wiki page here for instructions:
    http://rayshobby.net/mediawiki/index.php?title=Python_Interval_Program_for_OSPi#Check_status.2C_start.2C_stop.2C_and_restart_ospi.py

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

OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) OpenSprinkler Pi demo scripts might need to be edited