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

  • This topic has 20 replies, 9 voices, and was last updated 5 years ago by JimS.
Viewing 21 posts - 1 through 21 (of 21 total)
  • Author
    Posts
  • #23197

    Dan in CA
    Participant

    This is a major revision of the program code.
    For upgrade instruction, see the wiki at:
    http://rayshobby.net/mediawiki/index.php?title=Python_Interval_Program_for_OSPi#From_an_earlier_version
    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:
    https://github.com/Rimco/OSPy

    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. system_update.py – Update the ospi system from within the native web UI
      b. sms_adj.py – uses SMS data for modem to control your ospi by phone
      c. lcd_adj.py – for using a 16×2 LCD display with ospi.
      d. pcf_8591_adj.py – for using a pcf8591 ADC with ospi
      e. pressure_adj.py – to monitor water pressure when master station is on
      f. email_adj.py – 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.

    Dan

    #28443

    Ray
    Keymaster

    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!

    #28444

    pierantonio
    Participant

    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

    #28445

    pierantonio
    Participant

    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.

    thanks

    #28446

    Dan in CA
    Participant

    Thanks for reporting this. I see the problem also.

    I will look into it today.

    Dan

    #28447

    Dan in CA
    Participant

    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 web.py framework.

    Dan

    #33185

    pierantonio
    Participant

    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

    #33851

    hespanha
    Participant

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

    ~/OSPi$ sudo python ospi.py
    plugins loaded:
    mobile_app
    monthly_adj
    relay
    weather_adj
    weather_level_adj
    Starting timing loop

    http://0.0.0.0:8080/
    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/application.py”, line 239, in process
    return self.handle()
    File “/home/pi/OSPi/web/application.py”, line 230, in handle
    return self._delegate(fn, self.fvars, args)
    File “/home/pi/OSPi/web/application.py”, line 420, in _delegate
    return handle_class(cls)
    File “/home/pi/OSPi/web/application.py”, line 396, in handle_class
    return tocall(*args)
    File “/home/pi/OSPi/webpages.py”, line 57, in GET
    return template_render.home()
    File “/home/pi/OSPi/web/template.py”, line 1020, in template
    return self._base(t(*a, **kw))
    File “/home/pi/OSPi/web/template.py”, line 881, in __call__
    return BaseTemplate.__call__(self, *a, **kw)
    File “/home/pi/OSPi/web/template.py”, 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

    192.168.1.114:54115 – – [13/Oct/2014 00:39:34] “HTTP/1.1 GET /” – 500 Internal Server Error

    #33852

    hespanha
    Participant

    I was able to resolve my problem by:
    1) In the file OSPi/data/sd.json, replace
    “nbrd”: 2
    by
    “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/weather_level_adj.py”, line 85, in run
    history = history_info()
    File “/home/pi/OSPi/plugins/weather_level_adj.py”, line 319, in history_info
    ‘humidity’: float(day_info[‘humidity’])
    ValueError: could not convert string to float:

    #33870

    Brendan Coupe
    Participant

    I just moved from 2.0.3 to 2.1.2 and my CPU is maxed out. /usr/bin/python ospi.py 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):

    WORKS: http://rayshobby.net/mediawiki/index.php/Python_Interval_Program_for_OSPi#From_an_earlier_version

    BROKEN: http://http//rayshobby.net/mediawiki/index.php?title=Python_Interval_Program_for_OSPi#From_an_earlier_version

    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.

    #33964

    Crusader998
    Participant

    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 https://mydomain.com/wa instead of https://mydomain.com/opensprinkler/wa

    This makes it difficult to put behind a proxy where I would like to reverse proxy the site to https://mydomain.com/opensprinkler

    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?

    #33972

    Dan in CA
    Participant

    Crusader998,

    You might find this link useful:

    Also, the python program uses the web.py framework:

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

    Dan

    #33973

    Dan in CA
    Participant

    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.

    http://rayshobby.net/mediawiki/index.php?title=Secure_Remote_Access

    #33989

    Crusader998
    Participant

    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

    #33990

    Crusader998
    Participant

    so under webpages.py doing the following would work well:

    gv.baseurl = ‘https://mydomain.com/opensprinkler&#8217;

    else:
    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.

    #34163

    asprunt
    Participant

    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.

    Thanks

    #34171

    asprunt
    Participant

    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?

    #34202

    Ray
    Keymaster

    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.

    #35619

    Stephen
    Participant

    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?

     

     

    #35629

    Dan in CA
    Participant

    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.

    Dan

    #59956

    JimS
    Participant

    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