OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) OSPi Major Update Available

Viewing 21 posts - 1 through 21 (of 21 total)
  • Author
  • #23197

    Dan in CA

    This is a major revision of the program code.
    For upgrade instruction, see the wiki at:
    A simple “git pull” will not work for this update.

    Please note that the version number (2.1.0) refers specifically to the Python project and it is not identical to the micro-controller version of OpenSprinkler with the same number. They just happened to arrive at the same revision number at the same time. However, one goal of this project is to maintain feature parity with the Micro-controller version.

    Many thanks to Rimco Boudewijns (The Netherlands) for his work to clean up and re-organize the code, making it conform to Python standards and improving maintainability. I have learned a great deal from him.

    Rimco is continuing to develop a fork of the project on GitHub. He has renamed his project files from ospi to ospy to avoid confusion. If you are into software development be sure to take a look at his “refactor” branch. His fork is at:

    Here are some highlights of this version:

    1. Martin Pihrt (Czech Republic) has contributed a number of plugins which can be found in the plugins sub-directory. They are disabled by default since not everyone will want to use all of them. You can enable any that you are interested in by logging into OSPi/plugins and changing the group permission to executable on the plugin file of interest:
    sudo chmod 776 ./[filename].py
    (without the [])

    These are his plugins:

      a. – Update the ospi system from within the native web UI
      b. – uses SMS data for modem to control your ospi by phone
      c. – for using a 16×2 LCD display with ospi.
      d. – for using a pcf8591 ADC with ospi
      e. – to monitor water pressure when master station is on
      f. – Sends email messages from ospi to a gmail address of your choice

    See the comments in the python plugin files for more details. If you go to martin’s web page you’ll probably want to use google’s Chrome broswser because it will offer to translate the site’s contents for you. His web site is in Czech.

    Martin has also helped develop a system for translating the web UI into multiple languages. We have created a working system that can easily be switched between English and Czech. The next update will have a language option and a simple text file that anyone can use to translate the UI into their own language.

    2. One unexpected improvement from Rimco’s code changes is faster page loads for the native web UI.

    3. Andrew Radke (Australia) contributed an extension to the CSS for the web UI that allows the program to be used directly on small screen devices such as tablets etc.

    So far this version seems stable and bug free. Samer Albahra (Texas) has tested it with his mobile app and it is good to go. That said, please don’t hesitate to post about any problems you find.

    The plan going forward is to return to incremental updates with added features, UI improvements and of course I look forward to some really great new plugins from the community.




    Cool, very excited to see the new development. The plugins, especially the pressure plugin, are very interesting and I will be checking out them soon. Thanks for the great work!



    Hello, this is a great update!!
    Very faster and perfect for mobile devices!
    Now i have i problem with this release.
    If you want to set the system in off now appear a error message with “internal server error” and you can’t with off the system.

    Thanks in advance!!
    Bye, Pierantonio



    an update..
    the internal server error appear also in stop all stations
    i’ll tried to reinstall entire apache web server, rebooted many times, but the problem persist.
    I tried to delete entire ospi software with it’s folders and reinstalled all but the problem persist.



    Dan in CA

    Thanks for reporting this. I see the problem also.

    I will look into it today.



    Dan in CA

    OK. I just pushed a new rev to GitHub to fix the stop stations bug. If you are running version 2.1.2 you already have the bug fix.

    If you already updated to version 2.1.1 you can use

    git pull

    from the OSPi directory to get the bug fix. Otherwise use the instructions from the wiki mentioned in the original announcement.

    @ pierantonio,
    Just want to mention that the ospi program does not use the apache web server but a server built into the framework.




    Hello Dan!
    Thanks for your support, now i had updated the software to v. 2.1.2 and all is ok! 🙂

    Thanks for your explanation about the built in server, I was not aware.

    Bye, Pierantonio



    I just upgraded version: 2.1.2 (2014-10-08) and I am getting an “internal server error”:

    ~/OSPi$ sudo python
    plugins loaded:
    Starting timing loop
    Checking rain status…
    No rain detected: Mostly Cloudy. No action.
    Monthly Adjust: Setting water level to 100%
    Traceback (most recent call last):
    File “/home/pi/OSPi/web/”, line 239, in process
    return self.handle()
    File “/home/pi/OSPi/web/”, line 230, in handle
    return self._delegate(fn, self.fvars, args)
    File “/home/pi/OSPi/web/”, line 420, in _delegate
    return handle_class(cls)
    File “/home/pi/OSPi/web/”, line 396, in handle_class
    return tocall(*args)
    File “/home/pi/OSPi/”, line 57, in GET
    return template_render.home()
    File “/home/pi/OSPi/web/”, line 1020, in template
    return self._base(t(*a, **kw))
    File “/home/pi/OSPi/web/”, line 881, in __call__
    return BaseTemplate.__call__(self, *a, **kw)
    File “/home/pi/OSPi/web/”, line 808, in __call__
    return self.t(*a, **kw)
    File “templates/home.html”, line 311, in __template__
    <td class=”scheduleTick” data=”2″></td>
    IndexError: list index out of range – – [13/Oct/2014 00:39:34] “HTTP/1.1 GET /” – 500 Internal Server Error



    I was able to resolve my problem by:
    1) In the file OSPi/data/sd.json, replace
    “nbrd”: 2
    “nbrd”: 1
    2) Login and change the number of extension boards back to 1 in the options (I do have one extension board)
    3) In the process I lost the stations names, so I had to re-enter them

    My system now seems to be mostly normal, except for an error when I try to use the weather-based water level plugin, for which the “status” box shows

    Weather-base water level encountered error:
    Traceback (most recent call last):
    File “/home/pi/OSPi/plugins/”, line 85, in run
    history = history_info()
    File “/home/pi/OSPi/plugins/”, line 319, in history_info
    ‘humidity’: float(day_info[‘humidity’])
    ValueError: could not convert string to float:


    Brendan Coupe

    I just moved from 2.0.3 to 2.1.2 and my CPU is maxed out. /usr/bin/python is using 95% of the CPU.

    I was not able to upgrade using the instructions that I found on the wiki.

    The first link appears to be broken (all links may have the same double http problem – using Chrome on Linux):


    BROKEN: http://http//

    After upgrade I got an internal server error. It appears that snames.txt in 2.0.3 has been renamed to snames.json in 2.1.2. Simply renaming the file did not fix the error. I decided to start clean rather than deal with any other upgrade issues.

    The only file that I copied from the 2.0.3 data directory is the programs.json file. The CPU is maxed out with both the clean (no programs) programs.json file and the one copied from the 2.0.3.



    Excellent work! The only issue I have with this app is that its difficult to put it behind a proxy. allot of the links are hard-coded in the python code with links such as /wa or /sn. this means that it will hit instead of

    This makes it difficult to put behind a proxy where I would like to reverse proxy the site to

    Is it possible to make the code slightly more dynamic or if possible make it a variable that can be modified in a conf file or such?

    Any thoughts?


    Dan in CA


    You might find this link useful:

    Also, the python program uses the framework:

    The cookbook > Deployment section has information about using various alternative servers.



    Dan in CA

    Let’s try this one more time since I can’t edit the previous post and there does not seem to be a preview option for posts.



    Yeh I could use a different web server on the PI but How do you solve the issue that alot of the code has hard reference such as:

    jQuery(“button.manual”).click(function () {
    sid = parseInt(jQuery(this).attr(“id”));
    sbit = jQuery(this).hasClass(“on”);
    if (sbit) {
    window.location = “/sn?sid=”+(sid+1)+”&set_to=0″; // turn off station



    so under doing the following would work well:

    gv.baseurl = ‘;

    web.config._session.user = ‘admin’
    raise web.seeother(gv.baseurl + ‘/’)

    that way its compatible with the standard deployment and makes it flexible with more complex ones.



    I am experiencing the same issue as Brendan Coupe. Very high CPU utilization by python (as shown by sudo top from the command line). With OSPi stopped, CPU utilization is negligible. The web UI and even interaction via SSH are so laggy as to be hardly useable.

    The installation was done cleanly from github. My repository is at 8d12fac. I configured the RTC using the instructions here. The only anomaly is 

    pi@ospi ~ $ sudo i2cdetect -y 1
    0 1 2 3 4 5 6 7 8 9 a b c d e f
    00: — — — — — — — — — — — — —
    10: — — — — — — — — — — — — — — — —
    20: — — — — — — — — — — — — — — — —
    30: — — — — — — — — — — — — — — — —
    40: — — — — — — — — 48 — — — — — — —
    50: — — — — — — — — — — — — — — — —
    60: — — — — — — — — UU — — — — — — —
    70: — — — — — — — —

    Which I’m afraid I don’t understand at all. Yesterday, “UU” was 68, but the “48” has been there the whole time.

    I’d appreciate any suggestions. Otherwise, my next step will probably be to start the whole process again from a clean raspbian image.




    A closer reading of the i2cdetect manpage and this stackoverflow answer makes me think the “UU” at 68 is not a problem, in that it’s just indicating that there’s likely a chip (the RTC) at that address, which is already in use by a driver (presumably the one I installed).  So does anyone know if the device found at “48” is indicative of a problem?



    I’ve also seen this happening in the past, and I honestly don’t completely understand the UU mark. But all OSPi boards we sell have passed functional tests, which include RTC test — the tester verifies that the RTC exists, can be programmed with a time and can read back the time correctly.



    For the “email_adj” plugin, would it be possible to add a field in the setup window called “Send Test Email” or something like that? That way, we could test our settings and make adjustments, rather than having to wait until the OSPi started its next cycle.

    I have set it up with my email settings but as it is pouring with rain here in Brisbane, I had turned the whole sytem OFF through the GUI (not at the wall). In order to check my settings, I did a “run-once” but did not receive an email, so I suspect my email settings might be incorrect.

    The plugin asks for “GMail username” – did this mean only email addresses like this work – “[email protected]” – or will email address hosted through Google APPS also work, so an email address like this – “[email protected]” – would work?




    Dan in CA

    The email_adj plugins was originally designed to work with gmail only as far as I know.

    It is in need of some updating. I’ll take a look at it when I get a chance but that may not be very soon.

    Most of the plugins are submitted by users and maintenance can be spotty.




    Where can I find the plug ins by Martin Pihrt? I looked around a bit and can’t find them.

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

OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) OSPi Major Update Available