OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › Python Interval Program update Oct. 4 2013
- This topic is empty.
-
AuthorPosts
-
October 4, 2013 at 9:45 pm #22661
Dan in CAParticipantThe October 4 2013 update to the Python Interval Program is now available on GitHub.
EDIT: For users of Samer’s Mobile Web App
The changes in this update are incompatible with Samer’s Mobile Web App. It is recommended that you not update your installation of OSPi to this rev.If you need to download a new installation that is compatible with the Mobile Web app, please use the new GitHub repository at:
https://github.com/Dan-in-CA/For-Mobile-Web-AppFirst off, I would like to welcome a new contributor to the project.
Jonathan Marsh has graciously offered to improve the native UI of the program. His first changes are included in this update.
You will see some improvements to the Options and Stations pages. However, these are preliminary changes that help pave the way for things to come.
If you have ever tried to add something to the options page and looked at the options.txt file in the data directory, check out Jonthan’s new version, I think you’ll be pleasantly supprised.I am delighted to have other developers contributing to this project.
Another important change in this update is that Raspberry Pi specific code has been put into try-except blocks. This allows the program to run unmodified under Windows and Linux. The GPIO capability is disabled on all platforms except the Pi allowing for development and testing on other systems. I have been developing the program on a Win7 system and have kept the GPIO related code commented out until now. (Why didn’t I think of that sooner!)
From the README:
(jonathanmarsh)
Additions, bug fixes:
1. Improved options handling and passing logic
2. Added a “System Name” option to help users distinguish between multiple systems
3. Configurable station name length (increased default to 32)
4. Added logging options to options page(Dan)
Additions, bug fixes:
1. Moved RasPi specific code into try-except blocks allowing program to run on multiple platforms
2. Added “write_options” function to generate/update new style options.txt file in data directory.
3. Fixed a bug in new options code that prevented master station from being selected.
4. Fixed a bug that caused an exception when the number of expansion boards was reduced.Files that were changed in this update:
ospi.py
OSPi/data/options.txt
all JavaScript files in OSPi/static/scripts/java/svc183/
README.mdSee the Wiki for update instructions:
http://rayshobby.net/mediawiki/index.php?title=Python_Interval_Program_for_OSPi#Updating_the_programDan
October 5, 2013 at 2:46 am #25632
mikethechapParticipantJust renamed the stations now that I have room to breath! Thanks a bunch.
October 5, 2013 at 2:07 pm #25633
dennyfmnParticipantHi Dan,
I pulled the update and have a couple of issues.
I only had two small conflicts one in home.js and one in ospi.py with one line of my code in each that referred to the garage door state.
I fixed them up and committed.The home page now only shows the buttons at the top of the screen and nothing below.
The Refresh, Stations, Programs, my Toggle Door, and Log buttons all work.
The Options button only displays the top of the options page down to Show Tooltips. Clicking Show Tooltips does nothing.
I tried commenting out my one line additions in home.js and ospi.py, but that didn’t change anything.
Any ideas?
Thanks,
Denny
October 5, 2013 at 2:57 pm #25634
Dan in CAParticipantDenny,
It looks like there is a problem with OSPi/data/options.txt file on your system.
It should look like the following:var opts=[
["System name","string","name","Unique name of this OpenSprinkler system."],
["HTTP port","int","htp", "HTTP port (effective after reboot)."],
["Location","string","loc", "City name or zip code. Use comma or + in place of space."],
["Time zone","int","tz", "Example: GMT-4:00, GMT+5:30 (effective after reboot)."],
["Sequential","boolean","seq", "Sequential or concurrent running mode"],
["Extension boards","int","nbrd", "Number of extension boards"],
["Station delay","int","sdt", "Station delay time (in seconds), between 0 and 240."],
["Master station","int","mas", "Select master station"],
["Master on adjust","int","mton", "Master on delay (in seconds), between +0 and +60."],
["Master off adjust","int","mtoff", "Master off delay (in seconds), between -60 and +60."],
["Use rain sensor","boolean","urs", "Use rain sensor"],
["Normally open","boolean","rst", "Rain sensor type"],
["Water level (%)","int","wl", "Water level, between 0% and 250%."],
["Enable logging","boolean","lg", "Log all events - note that repetitive writing to an SD card can shorten its lifespan."],
["Maximum log entries","int","lr", "Length of log to keep, 0=no limits."],
["Ignore password","boolean","ipas", "Ignore web password"]
];Check it and let me know.
Dan
October 5, 2013 at 3:38 pm #25635
dennyfmnParticipantHi Dan,
Yes options.txt looks just like you posted above.
My sd.json looks like this:
{"en": 1, "seq": 1, "mnp": 32, "ir": [48], "mas": 0, "htp": 8080, "nst": 8, "rdst": 0, "loc": "Burnsville, MN", "nprogs": 12, "tz": 28, "rs": 0, "tu": "F", "rd": 0, "mton": 0, "lr": "100", "sdt": 0, "rsn": 0, "bsy": 0, "lg": "checked", "wl": 100, "nopts": 13, "pwd": "xxxxxxxxxxx", "urs": 1, "rst": 1, "mm": 0, "mo": [0], "rbt": 0, "mtoff": 0, "ipas": 1, "nbrd": 1}
Denny
October 5, 2013 at 3:45 pm #25636
djagerifParticipantI have the same issue.
Ingo
October 5, 2013 at 4:56 pm #25637
KanyonKrisParticipantI had the same issue, but I’d made some changes to some files so I thought that was what caused the problem, guess not.
I deleted options.txt and restarted ospi.py, didn’t work.
I looked around at some other files but couldn’t see anything that might cause this problem.
Since I’ve only been experimenting with this program, I wasn’t using it to irrigate, I took the nuclear option and deleted the OSPi directory and reinstalled with:
git clone https://github.com/Dan-in-CA/OSPi
Ran ospi.py and everything worked perfectly.
Unfortunately the nuclear option means I don’t know what caused or fixed the problem. If someone would like to do a better investigation I suggest renaming your current OSPi directory and doing a fresh install using the git clone above. Verify the new ospi.py works fully. Then one by one copy your old data files into the new install (after renaming the new data file as a backup) and see if it breaks it. Then compare the old and new files and look for differences.
October 6, 2013 at 4:35 pm #25638
Dan in CAParticipantThe problem has been solved for a couple of users by adding the following key-value pairs to OSPi/data/sd.json.
The file should include:
"name": "OpenSprinkler Pi", "snlen": 32
probably not in that order since it is a dictionary (hash) file
The program contains code to automatically add these when the program starts. So far, it seems to fail in cases where the program has been modified by the user. I’m not sure why that is but will be looking for a cause.
Dan
October 6, 2013 at 10:20 pm #25639
AlanParticipantI just upgraded, and ran into the same problem with the display. I verified that the new additions were in the options.txt file (they already were there). I tried restarted OSPi.py, and everything started working/displaying correctly.
October 7, 2013 at 2:08 am #25640
RobertMemberHi,
I am a new user. I had installed this interval program a few weeks before this update. Today, I started the program, set the options, made a watering program, and was testing it. My test program seems to be working. I decided to update with the latest version. After the update, nothing worked. Most significant was the loss of the “Options” page, which was mostly blank. I have deleted OSPi directory and reinstalled (several times) with the same results.
Best Regards,
Robert
October 7, 2013 at 3:44 am #25641
KanyonKrisParticipantAs I read into what Captn Avenger noted, it may be that it doesn’t work when run the first time but works fine thereafter. If you’d like to test this, do:
sudo python ospi.py
Use your web browser to connect and see if the Options page is there or not. Be sure to force the browser to reload pages, in Chrome, and I think most browser, do this by holding down the Shift key then click on the refresh button/icon/whatever.
If the Options page is blank, stop the sprinkler program by typing Ctrl-C which should dump you back to the command line.
Now run the sprinkler program again by using the same command as above. Tip: press the up arrow to access previous commands, then press enter when you see the one you want.
October 8, 2013 at 12:28 am #25642
RobertMemberHi All,
Just discovered the problem to be the default browser in my Android tablet. I was able to run the interval program in my Linux Chromium browser, Android phone browser, and my iPad. Strange problem with my Android tablet’s default browser. On the same tablet, the interval program works on the Chrome browser,
Best Regards,
Robert
October 8, 2013 at 1:00 am #25643
Dan in CAParticipantRobert,
Welcome to the forum and glad you found the problem. You had me worried for a bit.
Dan
October 16, 2013 at 12:00 pm #25644
BiojardimParticipantHi,
First thanks to all that spend time to this app.
I made the upgrade and still have the related problem, only solved with new install.
But i found another issue, when we have Master Station the programs at program preview only apear once, do not repeat. If i remove the Master Station it repeat with the Every time option.
Best Regards
October 16, 2013 at 8:25 pm #25645
Dan in CAParticipantBiojardim,
I just pushed an update to GitHub. The problem you described should be fixed now.
Dan
October 16, 2013 at 9:58 pm #25646
BiojardimParticipantDan
Thanks, i will try it now.
-
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › Python Interval Program update Oct. 4 2013