Forum Replies Created

Viewing 25 posts - 1,576 through 1,600 (of 1,705 total)
  • Author
    Posts
  • in reply to: Mobile Web App with Screenshots (Updated) #24034

    Samer
    Keymaster

    @andrew I removed the swipe gesture for the panel and started re-working the bars icon. I started noticing a lot of accidental openings especially on first page load. I took your advice and removed it. I do need to make the button more noticeable/larger which is what I am working on now. I have pushed the changes so far.

    Edit: I took it a step further and de-emphasized the panel. I was cramming to many things in there. I have since moved out some of the options. That caused the main menu to be cluttered and I re-organized it based on the action it carries. I personally like it better, but would love some feedback. I also made the bars button flatter which seems less out of place now.

    in reply to: Rain delay from Yahoo Weather #24559

    Samer
    Keymaster

    Sure, I should have off the bat but was on my iPhone and being lazy.

    Here is the forum post: http://rayshobby.net/phpBB3/viewtopic.php?f=28&t=148
    He also posted his code on Github: https://github.com/vladbabii/multiweather

    Edit: I never noticed his second commit. Looking through it I think it would be easy to formulate the correct parses to grab the data. But, I am not seeing rain fall and other data needed to implement some of the rules we want.

    Edit 2: Forecast IO seems to report, precipIntensity. Not sure if that is the value we’re looking for?

    in reply to: Rain delay from Yahoo Weather #24557

    Samer
    Keymaster

    Exactly! Check if the predefined conditions are met and if so rain delay. Maybe check at midnight?

    I know personally I start my programs early before its too hot (2AM). Not sure if that’s common practice but I like the idea of one check and 24 hour delay prevents a lot of possible problems (program continually adding a fresh delay every hour when run).

    Let me know if you find the data. I know another user on the forum was parsing a lot of data from weather services but I personally couldn’t decipher all of it.

    in reply to: Rain delay from Yahoo Weather #24555

    Samer
    Keymaster

    I like our implementation for being very simple but I was looking at how other’s have accomplished similar goals and the one that stands out is HydraWise. They set certain paramaters and check against them. Here is an example of what I mean:

    I think we can easily add something like that (very easy). My question is: do you think this is useful or just a lot of extra options?

    in reply to: Rain delay from Yahoo Weather #24554

    Samer
    Keymaster

    @andrew Awesome! I can absolutely increase the maximum interval and will do that now.

    The logging is actually a great idea, I could tack it on to the current logging system fairly easily but not sure if I should just wait until I make a switch to SQL database or not. I feel bad just adding paramaters to the log especially since I fragment user’s each time I do (those with the old log format and those with the newer ones). The last log change went fairly smoothly I believe so I will debate just adding it.

    The other thing, in regard to logging, is distinguishing between automatic and manual rain delay. I don’t think I can. So the log would only show when rain delays were active not what set them. If that makes sense.

    Edit: Pushed the maximum up to 4 days (96 hours).

    in reply to: Mobile Web App with Screenshots (Updated) #24033

    Samer
    Keymaster

    Reworked the automatic weather delay using some of @andrew’s suggestions. The system is much more simplified now! It has two options found within settings below the primary settings. The two options are enable/disable rain delay and how long of a rain delay when adverse weather is found.

    Now that the system is active I will explain exactly how it works. When enabled, the system checks the weather every hour using Yahoo! services. It retrieves a special weather code defined here: http://developer.yahoo.com/weather/#codes. I then compare the current code against a defined list of adverse codes and reset codes. The selected codes are listed below. If an adverse code matches the current code and the system is enabled, a rain delay is automatically set based on the currently configured automatic rain delay setting (default is 24 hours). If a code matches a defined reset code, the rain delay is immediately removed.

    Adverse Codes:

    0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,35,37,38,39,40,41,42,43,44,45,46,47

    Reset Codes:

    36

    If you need any further explanation let me know. Again, this is disabled by default.

    in reply to: Rain delay from Yahoo Weather #24553

    Samer
    Keymaster

    Okay, got the initial version posted 🙂 The options are in the settings panel (under primary settings).

    It works by checking the weather code against known adverse codes/reset codes. The the current code matches the adverse code, it sets a delay equal to the configured auto delay duration. Default is 24 hours. If a reset code matches it removes the rain delay if one is set (used for the hot code). I tried to keep it simple but later we can build on it. Let me know what you think!

    Thanks!

    in reply to: Mobile Web App with Screenshots (Updated) #24032

    Samer
    Keymaster

    @context No problem, glad its working!

    in reply to: Mobile Web App with Screenshots (Updated) #24030

    Samer
    Keymaster

    @andrew Thank you! That is a huge oversight on my part. I will get a fix patched up for that soon.

    Edit: I pushed an update to check crontab before adding a new entry! Thank you!

    in reply to: Rain delay from Yahoo Weather #24551

    Samer
    Keymaster

    I agree! I was struggling to figure out the best way to do that. Do you think 24 hours is a good default value?

    in reply to: Mobile Web App with Screenshots (Updated) #24028

    Samer
    Keymaster

    @context This forum is fine for support. For your issue, you probably left force SSL checked during install and your HTTP server does not have SSL support. The easiest fix is to open config.php and change:

    $force_ssl=1;

    To:

    $force_ssl=0;

    If you are not comfortable doing that, you can delete config.php and start over however make sure to uncheck force SSL. I will push an update to change the “default” behavior, since that is a reoccurring problem.

    Edit: Went ahead and pushed the update to install.php. Force SSL is unchecked by default now.

    in reply to: Rain delay from Yahoo Weather #24549

    Samer
    Keymaster

    I agree with you, I hate that I am calling it each time. But, there is no good way for me to cache it other then writing out to file because watcher.php ends its execution every minute. The best way is to switch to MySQL which will be a large headache for everyone already using my web application. I would need time to smooth out the migration path and a more compelling reason to switch than just automatic weather delays.

    On the positive side, the few seconds do not effect the user at all since watcher.php is a shell run script which won’t block the UI.

    in reply to: Mobile Web App with Screenshots (Updated) #24026

    Samer
    Keymaster

    Excited to say I just pushed an update that adds automatic rain delay! This option is not exposed to the user, yet. To enable this feature all you do is add the following line to your config.php:

    $auto_delay=1;

    However, this is for people who want to beta test. I am now writing the GUI to add all of this into the web application. This option will be disabled by default, even on new installs. Currently, the delays are not configurable via the GUI but soon they will be. This is all based on @andrew’s work who posted his script here: http://rayshobby.net/phpBB3/viewtopic.php?f=28&t=184

    I am planning to incorporate the current weather conditions with the settings page so it becomes a dual-purpose feature. I also run the delay check once per hour. Any feedback is appreciated!

    Thanks!

    in reply to: Rain delay from Yahoo Weather #24547

    Samer
    Keymaster

    @andrew I got the weather code incorporated into my web application. The only thing left is adding a configuration option to enable/disable the feature, add a way to edit the CSV file which contains the code to delays, and decide how often to run the function. My station watcher script (for logging) runs every minute and I intend to piggy back off of it. However, I think I will have it run the specific weather function less frequently for multiple reasons. The main being 1 minute is unnecessary I doubt the weather changes that often and I also don’t want to get IP’s banned from Yahoo’s API.

    I added a regex to parse the data and have pulled all the current weather conditions not just the weather code. I want to incorporate the settings into a “current weather” page on my mobile app.

    Here are my functions I am using so far:

    #Weather functions

    #Resolve location to WOEID
    function get_woeid() {
    $options = get_options();
    $data = file_get_contents("http://query.yahooapis.com/v1/public/yql?q=select%20woeid%20from%20geo.placefinder%20where%20text=%22".$options["loc"]."%22");
    preg_match("/(d+)/", $data, $woeid);
    return $woeid[1];
    }

    #Get the current weather code and temp
    function get_weather_data() {
    $woeid = get_woeid();
    $data = file_get_contents("http://weather.yahooapis.com/forecastrss?w=".$woeid);
    preg_match("/ $weather = array("text"=>$newdata[1],"code"=>$newdata[2],"temp"=>$newdata[3],"date"=>$newdata[4]);
    return $weather;
    }

    #Lookup code and get the set delay
    function code_to_delay($code) {
    $codes = explode("n",file_get_contents("yahoo_weather.csv"));
    foreach ($codes as $line) {
    $data = explode(",", $line);
    if (!isset($data[2])) continue;
    if ($code == $data[0]) return $data[2];
    }
    return false;
    }

    The get_options function is something in my code to pull the options off the OpenSprinkler. I do this to prevent a WOEID configuration from the user. I am using options and not settings because the OSPi does not properly report the location in the settings. Here is an example of how I use these functions:

    #Check the current weather for the devices location, and set the appropriate delay, if needed
    function check_weather() {
    $weather = get_weather_data();
    $delay = code_to_delay($weather["code"]);
    if ($delay === false) return;
    send_to_os("/cv?pw=&rd=".$delay);
    }

    Just wanted to share what I have so far, thanks again!

    Edit: I just saw your comment about WOEID update frequency! I will update my code to take that into consideration, thanks!

    Edit 2: I just checked and the API limits the WOEID lookup to 2k per day. I am checking once every hour in the current implementation so I will not worry too much however it is still an HTTP request which increases latency. Since it is not something the user has to deal with I am keeping it a low priority fix, for now. In the future I might upgrade my web application to use a SQL database rather then files. At that point, I think I will switch the code to set the WOEID and poll the database instead.

    Edit 3: I actually pushed this code into my web application. It is currently working but has no GUI options, yet.

    in reply to: Mobile Web App with Screenshots (Updated) #24025

    Samer
    Keymaster

    @wyone Thank you, glad it is working for you!

    The last run station is something the OpenSprinkler keeps track of which is why that is working. The reason the logging is not working is because the watcher.php is probably not running. I can’t say with 100% certainty however that would be my best guess. The runner up, would probably be permission error for the log file. Regardless, if you want me to help troubleshoot you can manually run the watcher.php from the command line and paste it’s output here. To run it open a terminal and use the following command (substitute your file location if different):

    cd /var/www/sprinklers; php watcher.php

    If nothing is returned that means it is successfully getting the status and updating the log file. If that is the case then attach your log file, if you don’t mind. I will try to further troubleshoot the issue that way.

    Thanks!

    By the way, I am very happy to hear Android 2.3.7 is working because I have tested on Android 2.3.3 and had issues scrolling so at least I know now that 2.3.7 works!

    Edit: Turns out I resolved the issues on Android 2.x completely 😀

    in reply to: Mobile Web App with Screenshots (Updated) #24023

    Samer
    Keymaster

    @momanz I just pushed an update that properly calculates the elapsed time for stations and rain sensors that are currently active.

    in reply to: Works great then becomes unresponsive – overheating? #24571

    Samer
    Keymaster

    If it’s the Raspberry Pi that stops responding that might be odd because the FAQ (http://www.raspberrypi.org/faqs) says the temperature for the AP is qualified from -40°C to 85°C and the LAN9512 is specified by the manufacturers being qualified from 0°C to 70°C. Both, directly from the FAQ.

    Curiously, if you run it indoors for 24 hours do you experience the same lock up?

    Edit: You could try something like this, http://hackaday.com/2012/06/26/adding-heat-sinks-to-a-raspberry-pi/

    in reply to: Rain delay from Yahoo Weather #24545

    Samer
    Keymaster

    Nice! I will start migrating the code into PHP and let you know when I have a working copy with my web application. The goal in the end is to have all the codes modifiable from within the application, use the OS location information, and offer settings to turn on/off the weather based rain delay. I think this will make a wonderful addition to the app, thanks!

    I am thinking it might be okay to forgo setting a rain delay if one is already set? Or maybe only checking the weather once a day, maybe early in the morning or late at night? What do you think?

    Edit: Keep in mind I know nothing about home irrigation and just love programming. So, any advice/feedback on best practices for something like this are always appreciated!

    in reply to: Rain delay from Yahoo Weather #24542

    Samer
    Keymaster

    This is fantastic, thank you!

    Question, is there anything that prevents the script from setting a fresh 24/48/etc hour delay each run (5 minutes)? If not, do you think this is a problem?

    Going to play around with this and see if I can incorporate this into my web application, if you don’t mind. I am hoping there is easy way to programmatically resolve the location on the OpenSprinkler into a WOEID (saving a configuration step).

    in reply to: Mobile Web App with Screenshots (Updated) #24022

    Samer
    Keymaster

    It’s honestly the only way I have been testing which is why I overlooked the Safari bug. By the way, I pushed some changes to page transitions (removed them) because of all the flickering issues. I think the app behaves a lot better this way. I am also scrolling to the page top on each page change now compared to the prior behavior of using the current scroll position regardless of what page you navigate to.

    I also fixed a small bug when changing pages in and out of program previews. The bug displayed a remnant of the timeline from previous view but stripped of data. This is now removed on each page change and refreshed properly. I also added a very nice dialog for confirmations (logout, import configuration, and reboot OpenSprinkler) instead of using the native javascript confirm dialog’s. Other than aesthetic advantages this fixes a bug on iOS where confirm’s (regardless of what choice you made) would trigger again on screen tap.

    Edit: Changed a lot of the code today trying to reduce anything causing flickering. Driving me crazy! I also tried to tidy some things up to make it easier to follow the code. Another thing I did was check the calls made to PHP from the javascript against a set of allowed functions (after all we can never trust the user :P). All the changes have been pushed at this point. Let me know if any new bugs have come up!

    Edit 2: I just tested on Android and bookmarking to the home screen does indeed properly show the custom icon. For Android you save to bookmarks and on the follow up screen you choose home screen for, the last choice, “Add To”.

    Edit 3: Since it appears to be requested a lot I have tested many desktop browsers and fixed some minor bugs across all of them to ensure compatibility. The browser’s that worked well were Chrome 27, Firefox 18, IE 10, and Safari 6. For mobile browsers, I have tested Firefox, Chrome, and Android browser on Android, with no problems. On iOS I have tested Chrome and Safari and both of them render everything correctly.

    The only browser with some issues on desktop is Opera. The drop down’s do not render correctly in Opera and the date selection on the page preview is also a bit off looking.

    in reply to: Mobile Web App with Screenshots (Updated) #24020

    Samer
    Keymaster

    @maddox Two ways: you can export your configuration using my web application and import after the upgrade (this has been tested a lot). Or you can keep the data folder inside OSPi which is your settings. Glad it ended up working though!


    @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!

    in reply to: Mobile Web App with Screenshots (Updated) #24015

    Samer
    Keymaster

    Okay this means the OSPi is the one throwing the error:

    [Mon Jun 24 21:43:13 2013] [error] [client 192.168.1.113] PHP Warning: file_get_contents(http://192.168.1.131:8080/cv?pw=opendoor&en=0): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Errorrn in /var/www/sprinklers/main.php on line 372, referer: http://192.168.1.127/sprinklers/index.php

    I read you updated but I am suspicious something went awry in your upgrade to the latest OSPi because the internal server error 500 means the OSPi is looking for something and not finding it. I can tell you precisely what is going on with your OSPi logs, but without them I would ask you to delete the current Python files and update to the latest, once again. If you open ospi.py what does the second line say? It should read:

    """Updated 22/06/2013."""

    Edit: I just tested the latest copy straight from Ray’s Github and can confirm it is working great. Let me know what the second line says and we can proceed from there.

    Thanks!

    in reply to: Mobile Web App with Screenshots (Updated) #24013

    Samer
    Keymaster

    @kenbob 😀 fantastic! Was worried it might only work for me, very reassuring, thanks!

    in reply to: Mobile Web App with Screenshots (Updated) #24011

    Samer
    Keymaster

    @maddox That is odd! Usually nothing works or it all works. Can you provide any logs? In particular the PHP logs from /var/log/apache2/error.log.

    Are you using OSPi or OS? If your using OSPi can you provide the log files from it? This can be done by running ospi from console: python ospi.py

    This used to be an issue on the OSPi before the Dan updated to the latest version. You need to be using OSPi >=June 22, 2013.

    in reply to: Mobile Web App with Screenshots (Updated) #24009

    Samer
    Keymaster

    @Vaughano Thank you!

    I pushed a version out now, like the commit states it has a lot of work to be done. Especially, on mobile devices. The initial zoom on mobile is just to large to provide any instant feedback of what is happening. When zoomed out the bar is too narrow and thus cuts off the program ID. I have ideas on how to fix most of these issues but for now please let me know how it is working for everyone in case I need to troubleshooting issues I cannot foresee.

    Thanks!

    Update: I finally addressed the bug when first opening the preview page. Got it loading perfectly now (at least for me). For the narrow iPhone’s screen I made a small modification where I check the time range of the scheduled programs and then narrow it down if its beyond a certain range. At the very least, the program ID now properly displays inside the bar. Since the graph is moveable and zoomable it is up to the user to navigate around on the small screen to fully see the program for the day. On a larger screen this should be much easier. Also, on smaller screens I purposefully cut off the station names on the left to give more viewing space to the time ranges. I do this because 16 characters of text can take up half the width of the iPhone normally, which was way too much. This is done via @media queries on CSS so simply rotating the iPhone, for example, will change the text back to full width.

    Update 2: At a later point, I want to do what Ray does with his preview and give programs unique colors to help differentiate them. I also want to stylize programs that will NOT be run due to rain delay. Lastly, I want to add master stations to the visual representation. All of these are on the to do list for a later date. I am happy I finally got this data to be more visual in nature which is more in line with the overall theme of the app. Look forward to everyone’s feedback!

Viewing 25 posts - 1,576 through 1,600 (of 1,705 total)