Forum Replies Created
-
AuthorPosts
-
momanzBlockedThanks! Looks like things are working again. I’ll do more in depth testing later today and let you know if anything comes up.
momanzBlockedThanks for the update, but the fix didn’t quite work. Here’s what the server log has to say.
2013-08-03 06:46:10: (mod_fastcgi.c.2676) FastCGI-stderr: PHP Fatal error: Call to undefined function str_getcsv() in /opt/share/www/sprinklers/main.php on line 168
I’m running version b03d3d3.
momanzBlocked@salbahra wrote:
Speaking of bug fixes I also fixed the unicode issue to support Dan’s changes. I also fixed the bug in my code with commas in station names. This fix does require PHP >= 5.3.0. Hopefully, this doesn’t become an issue but if it is please let me know and I can write an alternative.
salbahra,
The most recent version of PHP in Optware is 5.2.17… After upgrading to the newer version of the app it seems to hang on a number of actions as I navigate through the menus. The developer console reports “HTTP/1.1 500 Internal Server Error.” Are willing to maintain compatibility with earlier versions of php?
-momanz
momanzBlockedLooks like the times are correct now. thanks.
I really like the ability to toggle zones on and off by tapping the legend entry. Nice touch. I think it would be a good idea to have the ability to completely remove a station(s) from the graph (and the legend) through some kind of configuration switch. I have three unused stations that add clutter the legend. Perhaps a row of checkboxes at the bottom of the options menu?
One thing I’ve noticed now is that in IE10 and Firefox the legend color does not appear. Yes I know this a mobile webapp but I thought I’d let you know anyway 🙂
One question, where did the field to enter the number of days to store log info go? I can’t seem to find it.
momanz
momanzBlockedVery Nice! can’t say I was expecting graphing before the logging database overhaul. Good work guys. I think there may be a bug in matching the station names with the numerical data. One of my least frequently used station seems have been assigned the highest runtime. The difference can be seen comparing table vs chart. Let me know if you need more debug info.
-m
momanzBlocked@salbahra wrote:
Yes, there’s three different timeouts. One is in Javascript for AJAX calls and is at the top of main.js.php. The other two are in main.php at the top. One is a socket timeout which is how long file_get_contents can wait when trying to communicate with Yahoo or OpenSprinkler. The third timer is a php execution limit. Let me know if changing any of these helps. Still find it odd only the first one has issues.
Thanks!
Ok. Looks like it’s the AJAX timeout in main.js.php. When I increase the time out to 6000 it works (the timeout is set to 5000). The Firefox developer console shows the specific operation took 5413ms. Viewing the next day preview takes 4555ms I guess this explains why I could see the next day preview and not the current day. I’m guessing the time to include the current time marker on today’s preview chart is the difference between the two operations. When I check resources on my my web server (it’s a Belkin router) loading of that preview page takes me from an idle cpu to 80-95% utilization. So simply put, I think you’re taxing my router! I wonder how my router CPU (Broadcom BCM4716 chipset) compares to the RPi server…
Could we increase the timeout to 8 or 10 sec if you don’t see an obvious inefficiency in the code.
Thanks,
-m
momanzBlocked‘preview programs’ stopped working for me today again. Haven’t had time to try and troubleshoot but since there is another report of the problem by Richp I though I’d let you know. Same exact behavior. I can go forward a day and it works, and I can look back at yesterday’s program and the preview works. Out of curiosity is there a network timeout associated with the preview? If so let me know where it is in the code and I’ll try increasing it to see if it has any impact.
Also, thanks for the followup on the weather and work on timer accuracy when resuming from sleep.
-m
momanzBlockedHi Samer,
I’m just getting back from vacation and I have to say, I like all the changes. I was using and updating the app remotely as you were pushing code revs, gotta love the interwebs.
One thing I noticed is that after a while the weather box seems to just disappear from the main page. Sometimes it happens when I’m moving between pages, and just moments ago caught the section containing the weather information very elegantly slide off the screen while the “Information” group expanded in size to fill up the space. Is this normal / expected behavior? Once the weather disappears it seems the only way to bring it back is to restart the app.
Another issue I saw occurs when I have a zone running and am watching the time remaining in the green dropdown. If I set down my phone and the phone display turns off (phone goes to sleep) and I return to the app after the sprinkler turns off, the countdown timer continues counting from what appears to be the time when the phone went to sleep. Seems like there may be a bit of missing code to check station status when waking from sleep and the green dropdown is present.
I also have a couple of more feature requests for consideration. Is the preference to put those on Git Hub or do we want to continue to discuss here for increased visibility? I like the idea of having a mobile app forum.
-m
momanzBlocked@salbahra wrote:
Thank you! Okay so I will try and address some things and ask for some more information on others. In regards to the rain sensor bug I will look into it but I am starting to think its time to rewrite logging!
I’d love to see a new logging system implemented with entries for the entire system state as recorded entries as well as current weather observations. I think SQLite could be a reasonable choice of database engine if one were to go that route… Don’t read too much into the database statement as I only spent an evening looking around at web forms and data management…
@salbahra wrote:
@momanz wrote:
1) I like having current weather displayed on the main screen, but I wonder if there isn’t a better way to do it. The problem is one of wasted space on either side of the Icon / text. On larger displays it’s probably ok, but on a small phone display (or even a larger phone display) it seems like space could be better utilized. I do like the fact that the Program control and System Information Groups fit perfectly on my screen.
I see your point about the wasted space, I think its worse on larger screens and desktops and actually looks pretty nice on mobile. With that said, do you think showing more information abou the device next to the weather would help offset the dead space? If so, what types of things would you like to see? I know something I want to add to the status page is total program duration remaining (something I just figured out I can calculate) but if there is anything in the status page you deem important enough to pull out and show next to the weather on the top let me know. I could even “style” the weather box as a “quick status” view.
I like the idea of having some kind of system status indication in that space, time remaining on a current program, and if nothing is running the program information can be replaced with the next scheduled program? Another possibility is having weather forecast information. Keep the current weather and then have tomorrow’s forecast next to it. In the third tile you can add additional weather statistics that would help you decide on how to program the system. For example average monthly temperatures, weekly or monthly rainfall totals could be useful in helping one decide on whether or not to increase or decrease watering times.
@salbahra wrote:
@momanz wrote:
2) It seems like the items in the “system control” section may be better placed on a separate page. It’s too easy to hit one of the buttons when swiping up or down. Also, I don’t think there is a need to have quick access to any of these setting. I’ve already accidentally turned off the Operation toggle while swiping. I can easily see my self accidentally hitting one of the toggles and not realizing it. Both will disable automatic operation of the controller.
I agree 100% with this point! They did seem out of place but the darn things stuck with me since my first version and don’t really have a home at this point. They dont fall under status since I label that as an information page. Do you think I should give them their own page or toss them in the side panel?
I think the system control group can be it’s own page with access to the group being a link in the side panel. It would be a good idea to have a status indicator on the main page though. Those sliders also act as indicators telling us if the system is on/off or in Auto/manual modes. Maybe turn the group title bars to a dark red color to signify that the sprinkler system is disabled (either by virtue of being turned off or being in manual mode with no station running).
@salbahra wrote:
Update 2: Doing some thinking and found one idea but needs some fine-tuning. Going to run it here and see what people think. I could turn the homepage into a status page, add a footer with 3 buttons (programs, info, control) and move the appropriate menu’s into each sub page. I think this could make the home page a lot nicer by using icons and other things for the device’s status but would also require some work and a lot of design (which I’m not good at). The only way something like this could happen is if anyone had a true vision of what they think would be best. If this is something you are interested in, sketch up an idea or try and describe it and I can easily implement it. Here is where I am getting this idea from (I obviously don’t mean to copy this but I think the bottom two sections are nicely displayed. Also, I cannot get rain fall data but forecast is no problem.): http://a1.mzstatic.com/us/r1000/092/Purple2/v4/32/12/c7/3212c7aa-318c-b801-2bfa-831c0dd0f5bb/mzl.vovidanb.320×480-75.jpg
What you describe above is interesting, but I’m not sure I’d go after it in such a short timeframe though.
On a slightly different note, take a look at the weatherunderground API. Lots of info / weather stats available, not sure if all of it is free.
momanzBlockedNice job with the updates. This app has come a long way in a really short time. I have a couple of points for discussion and one possible bug to report.
The possible bug first. There may be a problem with how the app is calculating the amount of time the rain sensor has been active. I had a couple of days where my rain sensor had disabled my unit. In the corresponding log entry what I found is that the time stamp was changing for the same rain detection event while rain was detected. Over the course of 2 days I saw the time stamp change to more recent times when I checked the log. This behavior started when the code to calculate rain sensor time, while the sensor was detecting rain, was implemented. Now here’s the complicating factor, I updated the code on my server while the rain sensor was active, and I did NOT clear my log file. I won’t be able to do any more trouble shooting for a couple of weeks, but I thought I’d get this out there in case anyone else has seen similar behavior or is able to test using a rain sensor.
Some feedback on the UI. Most of these points are observations or points for discussion so please chime in and offer counter views. The app works quite well as it is, I look at the items below as opportunities for improvement.
1) I like having current weather displayed on the main screen, but I wonder if there isn’t a better way to do it. The problem is one of wasted space on either side of the Icon / text. On larger displays it’s probably ok, but on a small phone display (or even a larger phone display) it seems like space could be better utilized. I do like the fact that the Program control and System Information Groups fit perfectly on my screen.
2) It seems like the items in the “system control” section may be better placed on a separate page. It’s too easy to hit one of the buttons when swiping up or down. Also, I don’t think there is a need to have quick access to any of these setting. I’ve already accidentally turned off the Operation toggle while swiping. I can easily see my self accidentally hitting one of the toggles and not realizing it. Both will disable automatic operation of the controller.
3) On the program preview screen. I think it would be useful to have arrows on either side of the date to advance the day. I saw that there was some discussion previously on how different browsers handle different date entries in the context of the NaN error, but I don’t think we’ve explicitly requested the arrows to advance the date. Is it even possible? Is that something that others would find useful?
Ok That’s it for now. Keep up the good work.
-m
momanzBlocked@salbahra wrote:
@momanz I just pushed an update to resolve the address/search bar issue along with several other bugs. My suggestion though, is to use the small arrow on the bottom center of Safari to “Add to Home Screen”. This will make the web application behave like a native application (icon, splash screen, and full screen usage).
I know why the rain sensor isn’t calculating the time and will look into a fix!
For the preview links, I can actually easily do this and will look into it!
Ahhhh. That worked. I didn’t think to add a link to home screen. I’ve been using a bookmark all along.
Thanks!
momanzBlockedThe preview is looking good. A couple of more questions / suggestions.
1) Would it be possible to auto-hide the URL and search fields on small displays? Many other websites do this automatically to save viewing space on my iphone.
2) Rain sensor logging seems to be working (it rained today). I did notice that while the sensor is active the corresponding log entry has a run time of 0 mins listed. Can you calculate the cumulative rain sensor runtime while the rain sensor detects rain? It seems like the code is only calculating time after the sensor no longer detects rain.
3) On the program preview graph, it would be really slick if each program bar was a hyperlink to the program edit screen for that program. you would probably need a way to keep attempts to zoom or scroll from activating the hyperlink. Perhaps a tap and hold or double tap? Maybe a configuration switch to disable the feature all together (for those who aren’t interested)?Keep up the great work.
-m
momanzBlockedI reset (deleted the contents of) my logfile and it appears to be working. I’ll run one of my programs this evening and take a closer look at all the entries.
momanzBlockedVery close on the rain sensor logging. The format was pretty much what I was thinking. The time stamps logged are wrong though. It looks like the day and possibly the time are derived from my first log entry 5 days ago. Could mixing an old log file with this new feature be the problem? I haven’t checked yet to see if the normal station logging has been impacted, I’ll do that later this evening.
Thanks for the speedy response!
-m
momanzBlockedAs far as I can tell, the rain sensor is basically a simple switch with felt or foam attached to it. When the felt/foam gets wet the switch is activated. Depending on how your system is configured the switch can be set to be normally open or normally closed. Both wired and wireless units are available and can be had for as little as $15 (wired) or $50 wireless. I have a $15 wired unit and it seems to work well enough. I imagine that you can simulate rain sensor operation simply by shorting the the Rain Sense pins on the OpenSprinkler board. Please verify this last statement as I would hate for you to damage your board if I’m wrong.
On the topic of logging, while I would love to see rain sensor data logged, I can now see the limitations of the current logging system and I wonder if time would be better spent looking at creating more flexible logging system. I believe all machines running a web server (including my router) will be capable of using some kind of database package and perhaps taking the output of the OS device settings command and dumping that into a line in a database file could be the answer. If done correctly I imagine gathering statistics and even generating graphs would be pretty straight forward as that’s a fairly common use of databases. I think how you choose to move on logging and rain sensor data really depends on what your vision is for your webapp. It’s easy for me to come up with ideas unfortunately I can’t offer much coding support.
Cheers,
-m
momanzBlocked@salbahra wrote:
@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.
I took a closer look at the code this morning and while I have no skill with programming I think I could follow enough to see the problem. As far as I can tell we only have access to the rain sensor status when querying the complete device settings and the way the current logger works it only monitors each station through the “sn” command. Thanks for looking at this and I certainly can understand the desire to wait and see what the new OS will bring. I only hope some of the new features will extend to the current hardware version.
Thanks again,
-m
momanzBlockedNice work with this webapp. I really appreciate you taking the time to continue updating and sharing your work.
I do have a couple of feature requests…
1) Would it be possible to add logging of the rain sensor status? I think it could integrate nicely with how you have things formatted in the “View Logs” page. You would basically have a heading for Rain Sensor in addition to the existing zones. Data reporting would be the same, i.e. lines for each date, time and duration the Rain Sensor is triggered.
2) How about incorporating long term logging and the addition of a statistics page? What I’m thinking is something like having each zone listed and how long it has run over a given period of time say Weekly, Monthly, or Yearly statistics. This probably isn’t as useful for users who haven’t integrated a rain sensor, but now that I have one 🙂 I want to know the cumulative run time of each zone in my system. Would anyone else find this feature useful?
Cheers,
-m
momanzBlocked@salbahra wrote:
My best guess regarding the logging is your router does not have crontab installed which is what runs the ‘watcher.php’ script every minute and saves the results to the $log_file and $log_previous files. I think tomato firmware might have an option to turn on crontab. If it does all you need to do is add the watcher.php to it.
To install crontab you should be able to just use:
ipkg-opt install cron
The crontab line for your router should be something like:
* * * * * cd /opt/share/www/sprinklers; /opt/bin/php-fcgi /opt/share/www/sprinklers/watcher.php
In your config.php check that your $log_file and $log_previous files exist and are writable by PHP.
In regard to the tip header, I have updated the CSS to fix the header in IE10 and Firefox but in the long term I do not think I want to spend much time supporting IE or Firefox since both browsers are primarily desktop and the normal interface is sufficient, IMO.
That was it. The command to to run watcher.php never made it into crontab. I manually added the line and now logging works.
Good point on IE and Firefox… the title of this thread is “Mobile Web App…” after all. 😳
Thanks for the quick reply and thanks for this webapp.
-m
momanzBlockedNice work. I installed your code last night and I really like this interface. I do have a couple of questions though as I don’t think I have everything working correctly.
My setup:
Host machine: Belkin Share Max N300 (F7D3301/F7D7301) v1 router
Firmware: TomatoUSB by Shibby 1.28 (Linux kernel 2.6.22.19)
Webserver: lighttpd/1.4.32 (ssl) (I’m not using SSL)any additional packages not installed by firmware flash are managed by optware.
Issues:
1) In my lighttpd error log file I have the following error.2013-06-16 07:39:35: (mod_fastcgi.c.2676) FastCGI-stderr: PHP Notice: Undefined variable: SprinklerPattern in /opt/share/www/sprinklers/main.php on line 437
2) I have no entries in the “View Log” page. Only the statement “Viewing data for the last 15 days.” appears.
3) This last one is cosmetic and occurs on both: Firefox and IE10 (Win8): The top line of text appears behind the “Title” heading on the main menu page. See screenshot.
Thanks for the hard work. It wouldn’t surprise me if I have a problem with a config file so any help would be appreciated.
Cheers,
-m -
AuthorPosts