OpenSprinkler › Forums › OpenSprinkler Mobile and Web App › Mobile Web App with Screenshots (Updated)
- This topic is empty.
-
AuthorPosts
-
June 25, 2013 at 3:21 am #24013
SamerKeymaster@kenbob 😀 fantastic! Was worried it might only work for me, very reassuring, thanks!
June 25, 2013 at 3:54 am #24014
maddoxMember@salbahra wrote:
@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.
1.1 500 Internal Server Errorrn in /var/www/sprinklers/main.php on line 372, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:29:45 2013] [error] [client 192.168.1.113] PHP Warning: file_get_contents(http://192.168.1.131:8080/cv?pw=opendoor&en=1): 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
[Mon Jun 24 21:30:35 2013] [error] [client 192.168.1.113] PHP Warning: file_get_contents(http://192.168.1.131:8080/cv?pw=opendoor&en=1): 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
[Mon Jun 24 21:33:55 2013] [error] [client 192.168.1.113] File does not exist: /var/www/favicon.ico
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 1 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 2 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 3 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 4 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 5 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 6 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 7 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 8 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 9 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 10 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 11 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 12 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 13 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 14 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 15 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 16 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 17 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 18 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 19 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 20 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 21 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 22 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[Mon Jun 24 21:34:39 2013] [error] [client 192.168.1.113] PHP Notice: Undefined offset: 23 in /var/www/sprinklers/main.php on line 495, referer: http://192.168.1.127/sprinklers/index.php
[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
[Mon Jun 24 21:44:12 2013] [error] [client 192.168.1.113] PHP Warning: file_get_contents(http://192.168.1.131:8080/cv?pw=opendoor&mm=1): 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
[Mon Jun 24 21:44:36 2013] [error] [client 192.168.1.113] PHP Warning: file_get_contents(http://192.168.1.131:8080/cv?pw=opendoor&mm=1): 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> 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
OSPi – I’ll work on getting the OSPi log files
> 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.
I updated to Dana’s latest today.
June 25, 2013 at 4:01 am #24015
SamerKeymasterOkay 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!
June 25, 2013 at 4:51 am #24016
maddoxMemberThe update text is not there:
#!/usr/bin/python
import web, re, os, json, time, base64, thread
#### GPIO #####
import RPi.GPIO as GPIO
GPIO.setwarnings(False)…
I’ll work on updating the python files now
June 25, 2013 at 5:05 am #24017
maddoxMemberHow can I update to Dan’s new code and preserve my sprinkler settings?
June 25, 2013 at 5:38 am #24018
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
June 25, 2013 at 6:03 am #24019
maddoxMemberI have eventually loaded Dan’s new software (could not preserve my old settings 🙂
My problem was that I would wget the tar file, but since it already existed, it named it incrementally, so I had been reinstalling his old code…duh.
Thanks for the help and for innovating masterfully! Awesome.
Maddox
June 25, 2013 at 11:30 am #24020
SamerKeymaster@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!
June 25, 2013 at 2:16 pm #24021
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!
June 25, 2013 at 2:29 pm #24022
SamerKeymasterIt’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.
June 26, 2013 at 4:53 am #24023
SamerKeymaster@momanz I just pushed an update that properly calculates the elapsed time for stations and rain sensors that are currently active.
June 26, 2013 at 1:58 pm #24024
wyoneParticipantSo just thought I would fill you in. Still working on getting Ubuntu to work on my older system. Not sure why it won’t open.
On a positive side though. I have been able to make the webapp work on my desktop, laptop, Galaxy Nexus phone and HP Touchpad running Android 2.3.7 They all seem to work flawlessly. I have noticed the logging does not function completely, but it does tell me the last station that was watered and the details on that watering.
Again, thanks for all the great work you all have put in. I really appreciate it!
June 26, 2013 at 2:53 pm #24025
SamerKeymaster@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 😀
June 26, 2013 at 4:39 pm #24026
SamerKeymasterExcited 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!
June 26, 2013 at 5:05 pm #24027
contextMemberWhat is your preferred method for support discussion?
I get here: Once the install is done a popup will come up notifying you of an error or success. There isn’t much info if it fails at this point but most likely a permission error somewhere.
I’ve installed it, get the success popover, and then am taken to a “can’t open page”/can’t connect to the server. In Safari. Any ideas?
Chrome gives me some more details: Error 102 (net::ERR_CONNECTION_REFUSED): The server refused the connection.
June 26, 2013 at 5:07 pm #24028
SamerKeymaster@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.
June 26, 2013 at 5:52 pm #24029
andrewParticipant@salbahra I was going to mention this anyway, but your response to @context gave me the perfect transition. With respect to deleting the config.php file (which I have done a few times now), you get the added benefit of having the watcher script installed into the crontab multiple times (as in, there will be multiple rows to execute the watcher script). I’d recommend checking for the line’s presence in the $output string before adding a new one.
June 26, 2013 at 6:27 pm #24030
SamerKeymaster@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!
June 26, 2013 at 6:42 pm #24031
contextMemberThanks for the quick response it works perfectly now.
June 26, 2013 at 6:48 pm #24032June 26, 2013 at 8:36 pm #24033
SamerKeymasterReworked 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.
June 26, 2013 at 11:43 pm #24034
SamerKeymaster@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.
June 27, 2013 at 12:33 am #24035
ZappParticipantHi!
Looks like we have a typo in main.php on line 64:
aray -> array/Jonas…
June 27, 2013 at 1:05 am #24036June 27, 2013 at 1:28 am #24037
ZappParticipantOne more thing!
I can’t work out what ‘rs’ is in sd.json. Do you know?
/Jonas…
-
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › OpenSprinkler Mobile and Web App › Mobile Web App with Screenshots (Updated)