Forum Replies Created
-
AuthorPosts
-
SamerKeymaster@momanz in regards to your first bullet, I don’t think I can poll the OpenSprinkler for rain sensor information directly. I could be wrong though and will look into it.
For the second point I will see what I can do however I would really want to make a more robust logging system before trying something like this. Right now the logging system is based on David’s code posted on Ray’s Github. It works great for what we have now but runs a lot of loops to process the data and doing long term analysis might be difficult. I would have to restructure it completely and honestly I think with Dan’s work on the Raspberry Pi interval program combined with the increased memory allotted on the OpenSprinkler 2.0 I might hold off to see if the OS might help in that transition.
@kenbob I am surprised the upgrade did not go smoothly. I just checked the files I posted on Github and the index.php does in fact point to the 1.3.1 jQuery files. Sorry about that. How did you upgrade? Did you use the Github command to pull the update? Just want to try and prevent these kinds of things in the future.Also, in regards to the sequential mode on the preview, technically the interval program does not contain a sequential option. As a result, the web app assumes its unchecked and processes the program data as such. It turns out on the interval program the lack of that option just means thats the only method of execution. I have debated patching my code to reflect that but the problem arises if someone just has that option unchecked. I could check for the lack of it as well but I am really hoping the interval program gets updated soon to include that option. I have been working closely with Dan to get the interval program as close as possible to 1.8.3/2.0.0 and have come a long way! I am hoping for a fix on that end soon, will keep everyone updated as soon as I know anything.
SamerKeymasterBy the way, for anyone who has noticed, there are some graphical glitches on iOS and I have finally fixed all of them. I am still testing however expect a push by today!
SamerKeymaster@Vaughano I agree with you however the limitation on the OpenSprinkler was memory. That has been resolved in hardware 2.0 and hopefully Ray can incorporate this feature now. Also, Dan has added this feature into the OSPi which is functional however my web app cannot use it yet and I am holding off until there is a compatible logging system in both versions.
@wyone The desktop version will work just as well as the server version! Use what is comfortable since it will help get you up and running quicker.Also, the hosted web app might not be working because you need to use your routers WAN IP. To find this goto http://wimi.com. Another requirement is port forwarding the port used by the OpenSprinklet. For more information consult this guide: http://www.computerhope.com/issues/ch001201.htm
SamerKeymaster@Ray, that is awesome that it could be an easy fix! Also, I am setting it using my web app which is why I am not getting an error about a value of 0. I should probably add that check until a fix is in place.
Thanks!
SamerKeymaster@sco3tt Thank you for the elaborate workaround and sorry you had to go through that! Turns out I do a very stupid check on authentication, one that rejects anything non-alphanumeric. This check isn’t place when adding a new account. Also, although the authentication accepts multiple accounts your very right, I did not add an option to add multiple accounts. I was lazy and will absolutely add it to the to do list!
I will use your feedback to update the authentication scheme. I will also remove the silly alphanumeric restriction!
I am glad everything is working for you now!
By the way, I have a special version of my web app up now. It requires no install! All it needs is internet access to the OpenSprinkler by opening a port on your router. The app is hosted on rayshobby.net and saves the configuration in the browser’s local storage. Since the information is read off the local storage it has no messy authentication to deal with (none needed since all sensitive data is in your browser). Ray plans on blogging about it soon but for anyone eager to try it out it is available here: http://rayshobby.net/apps/sprinklers/ 😀
The one downside of the hosted web app is the lack of logging. Unfortunately, there is no way to poll data from the OpenSprinkler without saving the password on the server, which I want to avoid for security reasons. Also, I don’t want to poll the OpenSprinkler over the Internet as this would cause a bit of traffic/latency which some user’s can’t afford. However, everything else is the same.
I will maintain both copies of the web app since each one has a particular application depending on the user. So, this is not a replacement but rather another option for users who do not have a Raspberry Pi or another server to host the web application and are okay with the OpenSprinkler having a port forwarded on their router.
If you have any questions feel free to ask, and above all enjoy!
Huge thank you to Ray for hosting the web app!
Edit: I pushed an update on Github for the alphanumeric problem. Complex password should work fine now! Another update will follow to support adding/deleting users.
SamerKeymaster@guylior I am glad it is working for you now!
At the moment the application is merely a website that acts as an application. If you just bookmark the link to your home screen it should act very similar to an actual app, if that makes sense.
Here are some instructions for pinning a web app to the home screen: https://www.mavenlink.com/community/blogs/785-add-to-home-screen-for-iphone-ios-and-android
SamerKeymasterThank you Ray! I went ahead and updated my older post with the information you just posted. That should help notify users who are directly linked to the post.
June 19, 2013 at 11:04 am in reply to: OpenSprinkler Interval Program now available for OSPi! #24409
SamerKeymasterI have noticed a bug that is now confirmed by another user. While a program is running the OSPi will not update the status of the stations using sn0. The status is only updated during manual mode or run-once mode. However, the program does correctly show a station running on the home screen. Basically, it’s properly updating the ps variable on the home page to reflect station status during program mode but it’s not updating the HTTP GET API, /sn0, during a program running.
Thanks!
SamerKeymaster@Vaughano Fantastic! Glad it’s finally working!
In regards to the required interval setting I have also experienced this problem with setting interval to 0 and really wish it worked differently. This is true not only on the OSPi but the OpenSprinkler as well. You will notice the program preview, fortunately, also accounts for this requirement.
In regards to the station status during programs this is a bug on the OSPi that I discovered the other day but blamed my odd setup. But after you have pointed it out I am certain this is an actual bug. I will let Dan know (maker of the OSPi interval program) and we will see what happens from there.
Edit: I have also noticed the OSPi interval program won’t fire master stations in program or manual mode even with them set, but again I haven’t said anything thinking it might be my setup.
SamerKeymasterThank you so much, I am an idiot! I added UTC to the main.php but forgot to push it to watcher.php. I just pushed that change now. Hopefully, that is what we needed!
Edit: I also remember why I left UTC in config.php now 😛 So I only define it once. But this way is better in the long run, if it works.
Edit 2: To summarize for anyone reading this. The timezone problem was fixed a while back however anyone who was using my program before the timezone fix got hit with a new problem. This program applied timezone offset calculation while still using local timezone (because the config.php was not updated). Earlier I decided to move the timezone declaration out of config.php (since it is no longer user configurable) and move it into main.php. I decided to put it after requiring config.php that way I overrode the user setting (effectively moving everyone over to the new format). However, I forgot to update the watcher.php which runs every minute and this was still using the local time to update the log files. This has now been fixed. Anyone with problems at this point is advised to update to the latest version and delete the old log entries.
If any further issues persist please let me know!
SamerKeymaster@JBinkley Thank you for the suggestion! I could launch a few more VMs off my hypervisors but I am hoping it wouldn’t be needed. I have had some wonderful feedback of this running on routers and some NAS appliances so at this point I think the code is getting pretty stable and no VM I make will be unique enough to test a new environment. I am really depending on the odd situations I cannot predict from everyone here!
Hope the weekend update goes well!
Edit: I do actually own a Raspberry Pi just not an OpenSprinkler for it. I might try and hook it up to the network and test the OSPi directly on it instead of through a Linux VM and see if I can troubleshoot issues quicker/easier that way. Probably attempt that tomorrow since where it is located now it has no internet access.
SamerKeymaster@Vaughano wrote:
Yes, my server times on the Pi are all over the place! Here are the results:
pi@raspberrypi:~$ date
Wed Jun 19 15:07:21 CST 2013
pi@raspberrypi:~$ php /var/www/OpenSprinkler-Controller/test.php; echo
Wed, 19 Jun 2013 14:37:27 +0900
Wed, 19 Jun 2013 05:37:27 +0000
pi@raspberrypi:~$
That is the problem! So, your RPi has the wrong timezone set. It is using CST for some reason. PHP is using GMT+9 by default but because the RPi time is off its not able to make the proper calculations. Regardless, this needs to be fixed for my web app to work correctly.
First start with this in the terminal:
sudo dpkg-reconfigure tzdata
Follow the prompts and set the correct timezone. After this, re run those commands and tell me if they are lined up correctly with your local time, specifically the “date” command. If they are, check the web app against a new run.
SamerKeymasterNow I suspect the time is off on the server running the PHP code. Can you run commands from the terminal? If so run the following:
date
If not make a file named test.php that contains the following and open it:
echo date(DATE_RSS)."n
";
date_default_timezone_set('UTC');
echo date(DATE_RSS);
?>Just so I can try and understand the server’s situation. You could also do both in case they are different, etc.
The reason I suspect the time is off is because if your PHP is being told to use UTC time and is saving as 13:51 when in fact the UTC time now is 5:09 something is wrong.
Edit: Sorry this is taking a bit to work out, I am new to truly understanding timezones in programming and really only have my two computers which are both in central to experiment with. With that said they work fine which is what’s making it hard to grasp the problem. Thanks!
Edit 2: Using the OSPi code I just ran a run-once program and this is what I see:
01000000--2013-06-19 05:22:01
My web app displays:
Wed, 6/19/2013 12:22 AM Running Now
The interval program has a timezone set of -05:00 (central time but adjusted for daylights saving time)
SamerKeymasterThat’s the problem. I made a change in the code to change the timezone to UTC. I also removed this option from the installer. The problem is people who had the old software still have the old timezone configuration. I made the situation worse by not defining UTC right into main.php but left it into config.php.
The line inside your config.php can be safely deleted after updating to the latest version (however you really don’t have to since I now define UTC inside main.php after importing the config):
date_default_timezone_set('Australia/Adelaide');
Anyways, pushed an update that should resolve the problem for everyone. The only problem left are your old log entries (inside /var/www/OpenSprinkler-Controller/SprinklerChanges.txt). You will have to dump them and start fresh.
The long-term sequele is all user’s logs will be in UTC and a timezone offset (set via the OpenSprinkler) is used to change the display. This works better for the main reason that user’s dont need to set two timezones (one on the OpenSprinkler and one in the web app).
Let me know if this helps!
SamerKeymasterI’m typing this out using Siri so sorry for the mistakes but if you don’t mind let me know what time zone is configured in the mobile web config.php. Thanks!
Edit: Completely irrelevant but looking back Siri did a decent job here, haha!
SamerKeymasterFortunately, this will become a thing of the past (consider this growing pains). Dan has reviewed my patch and plans to incorporate it into the main OSPi code. He’s also working on a fix for the last run code and maybe the sequential code as well. So, starting with the next OSPi interval program update there should be no reason to patch/modify the code and should work out of the box with my mobile web app.
Thanks!
SamerKeymasterAre you using the OSPi version of the OpenSprinkler? If so, the sequence option doesn’t exist and this is what’s throwing the warnings. From my understanding you can safely ignore them because the app will still function fine (notices shouldn’t be displayed to you, if they are your using a very old version of PHP or need to change your php.ini to hide notices).
This is what you need to change in your php.ini to hide the errors:
error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
display_errors = Off
Source: http://stackoverflow.com/questions/10160859/turn-php-error-reporting-off-in-xampp
As the discussion on Stack Overflow suggests, bugs should be fixed not suppressed however in this case I am expecting something to be reported and unfortunately it isn’t supported yet. I could write some code to handle that properly but I am hoping it will be fixed on the OSPi side soon and find it redundant to add checking for this particular event.
The very first error you pasted from the View/Change program screen I am not sure about (because your version at this point differs from the latest on Github) however I venture to guess a station is not named or something weird like that. If you could update to latest code and run again let me know.
SamerKeymasterUbuntu is a great introduction into Linux especially if you need a GUI. Because its based on Debian you can use the exact instructions available on the Github page. You would run those commands in a terminal window.
SamerKeymasterAwesome, I won’t worry about using a minute crontab anymore.
Thanks.
SamerKeymasterNot using a slider, no. I could change the entire scale to hours though.
Edit: I also just realized I could remove the small text input to the left of the slider, add my own text that reads the slider minute input and translates it into HH:MM. I will play with this option and get back to you. I also could use a select input but that might be too limiting.
Edit 2: The reason I am using slider’s and other unique inputs is because on the iPhone typing HH:MM is annoying. Even on the desktop its a bit cumbersome compared to just sliding something over. I agree it is hard to quickly interpret what 240 minutes is however I do think minutes scale provided more flexibility in the long run as do the slider inputs.
SamerKeymaster@Oasiz37 and @Vaughano thank you for the detailed information! Your feedback was invaluable and I was able to hunt down and fix the specific bug. Turned out I wasn’t doing the decimal to binary conversion correctly. That has been fixed now. Please try the new push on Github and let me know if this fixes your problem.
Also, @Vaughano, has the timezone issues been resolved at this point?
Thanks!
SamerKeymaster@Oasiz37 I haven’t dealt with unused stations personally. The first thing to mind would be, are all the stations named? Is there anything in particular in your program that you think would trigger this? Do you use a master valve (something I do not use)? Need more information to help debug. I only have one example I am able to work with and that is a 16 station and no master setup. Is it showing up incorrectly persistently? Or does it fix if you close/reopen the web app?
Also, are you using the RPi version or the normal OS?
SamerKeymaster@slobrewer you might have a good point! I really don’t know much about how often the disk would be accessed. I personally use an SSD and am not worried about spin up/down. Maybe I will wait until @Oasiz37 gets back to me about his Synology and we can go from there.
1) In regards to the time zone problem. Just to make sure are you using the newer files or the older ones? Reason I ask is I made some changes to the code, and also to the configuration that would require some hand editing if you were using the old one (mainly changing the config timezone to UTC and removing the old log data). If all of that is done, then let me know and I can look further into the problem.
Edit: I think I am noticing the problems as well now in regards to the time being saved incorrectly. I have some traveling to do tomorrow but when I get some time I will sit down and think this through because the date’s are a mess now, since the recent change. My goal is to eliminate setting a timezone in the web app and in the OpenSprinkler. I feel like we could set it once and use it twice. Obviously, I don’t think I implemented it very well, yet. Hopefully soon though!
2) So, the problem with this bullet is, my preview script interprets the sequential variable from the OS and since the OSPi does not return one, it assumes its checked off and displays the preview in that fashion. This one has been communicated to Dan who ported the interval program to the RPi and told me he would take a look when he got some time (might be a bit though, tied up from my understanding). I might take a look and see if I can solve this because I spoke with Ray about this and I was told sequential option was taken out in 1.7 and returned in 1.8.3. The code base used for OSPi interval program is 1.8.2 so the relation might make it easy to port. I will keep you guys posted on this one.
@wyone I will honestly say despite the jargon this app is somewhat easy to deploy if you have any Linux server laying around or use a Raspberry Pi OpenSprinkler. If you need any assistance I would be happy to help and I am sure most of the people who have gotten this working at this point could chime in as well. I have had a range of responses from worked instantly to a lot of work to get it started. So, with some luck, I am sure you could get this running in no time.
SamerKeymasterI honestly hate running that script every minute and if you have any alternatives I am all ears.
The watcher script runs every minute and gets the current status, then compares that to last minutes status. This is the only way to properly log data from the OpenSprinkler since it keeps no logs of its own.
I suppose it might be better to just have watcher run on @reboot, store the current value in memory, and sleep 60 seconds in between runs. This way the HD isn’t woken up to read the script file, isn’t reading the old values off HD each minute, and is only writing new changes to disk (which should only happen when sprinklers are actually run).
I will look into this and get back to you.
-
AuthorPosts