Forum Replies Created
-
AuthorPosts
-
SamerKeymasterThank you for the report! I guess I’m not properly handling Unicode characters. I will see what I can do to fix this.
Thanks!
SamerKeymasterThank you for the update and I am glad it’s working!
SamerKeymasterHello mlorch,
Sorry your having this issue however I don’t have enough information to tell much. First, it sounds like a javascript error since the body is hidden at start and shown after the javascript is run. With that said, which browser are you using?
If it is in fact a javascript issue than you should have errors in the browser. If you are using Chrome for example, you can right click and push Inspect to view the console (anything in red is an error).
It also might be a missing PHP extension. If that’s the case, you will have errors in your apache log (in /var/logs/apache2/error.log).
If you find any errors in either location please share them with me so I can track down this issue.
Thanks!
SamerKeymasterSure, so long the web server has proper write permission it’ll be fine.
SamerKeymasterYes, even currently you can place these files outside of the hosted directory (except config.php itself). Just put the correct absolute path in config.php
SamerKeymasterThis has me thinking, I could just make a config folder instead of requiring the main directory to have 777 and change the permissions to a safer level after installation.
Hopefully I can get this implemented to avoid future headaches.
SamerKeymasterHey John,
You and your host are correct that 777 is a security risk. The only reason this is done is to create the config.php, .cache, SprinklerChanges.txt, and .htpasswd.
If you create these files manually (using config-example.php) and give the .cache and .htpasswd appropriate permissions it’ll work fine. Furthermore, you can move these files outside of the web root and just tell the config.php where they are.
If you need further assistance please ask.
SamerKeymasterHello Garry,
Going to try to address your issues sequentially. First, the app doesn’t open because it’s code is on a web server. It is possible within a webapp to build a manifest list and force the phone to cache the code however the HTML files contain dynamic PHP code thus caching is somewhat difficult.
As it stands, the OpenSprinkler does not log anything. My mobile app (the PHP version) polls the OpenSprinkler every minute and logs changes. When you open View Logs, that log is parsed for the selected date range and values are returned. This means the data is not interpreted but rather actual logged data. The data is therefore stored with the html/php files such as config.php (SprinklerChanges.txt). The watcher script can be found here: https://github.com/salbahra/OpenSprinkler-Controller/blob/master/watcher.php. The installer attempts to add the script to crontab otherwise alerts you it couldn’t.
Which import button are you referring to because that is only used for the configuration. If the device is down what good what that do? Just curious here.
The OpenSprinkler HTTP API is documented here: http://rayshobby.net/wordpress/wp-content/uploads/2011/10/Firmware1.8HTTPGETcommands.pdf. With a few exceptions of course.
The following new options are available since 1.8:
o2 – NTP On/Off
o14 – Auto Reconnect On/Off
o26 – Device ID (0-255)Hope this clears up some of the confusion.
SamerKeymasterI pushed some changes to manual mode code however I noticed the specific error message you mentioned only shows up during submission of a new site/device. Not 100% sure this will fix your issue but I have a more permanent solution in the works.
SamerKeymasterAre you using manual mode to turn on zones? If so, there might be a bug in manual mode that hasn’t been fixed on the hosted app on rayshobby.net/apps/sprinklers. I will take a look tonight and let you know what I find.
If you don’t mind me asking: which firmware version are you using for the OpenSprinkler?
SamerKeymasterThanks! Glad to hear the issue is resolved. Appreciate your logs, made it a lot easier.
SamerKeymasterI believe this issue should be fixed now. Can you please try now and let me know.
Thanks!
SamerKeymasterI believe this has been fixed. Let me know how it works now if you don’t mind.
Thanks!
Update: The problem was two fold. One you don’t have gettext and I have a bug for users without gettext. This has been fixed. Secondly, I had a start tag in sprinklers.php instead of a
SamerKeymasterYea there was a change to attempt to help @guylior but it made it worse for him and yourself. I will try and track this down soon.
SamerKeymasterOkay I’ll just install WAMP (latest) and try this out. Seems it should instantly present itself. From there should be easier to test and fix. I’ll let you know.
SamerKeymasterThis is an interesting error and the same one posted by @guylior earlier. Let me use your logs to try and find a solution. It seems to be isolated to WAMP users or at least Windows Apache stacks.
Update: I posted an update, could you please try it and let me know?
SamerKeymasterHello Gary,
The logging feature currently is separate from the OpenSprinkler and thus handled externally. I chose to handle it with a PHP script on crontab logging the status. I then parse this log and render a graph for users via the mobile app. As for the firmware side of things, I can’t comment as I only develop the mobile application. As for the host it can be any OS however Windows seems to have the most issues (currently hammering them out). In regard to the log file, if that becomes something stored on the SD card then a simple HTTP request would retrieve it. Additionally, the mobile app would be able to parse it and graph it for you.
I have basic weather checking to activate rain delay if raining however past that I currently do not have plans on making the system more robust (ex: precipitation, etc).
For the backup and import functions on my mobile app, you will notice the button is split. Clicking the longer side saves it to your browser. The smaller button on the right with the icon does actual file export/import.
Hope this helps!
Update: Now that you mention it thought I suppose that export/import situation is a bit misleading. I will see what I can do to improve that.
SamerKeymasterThat was perfect! Thank you! I just pushed a fix please let me know if this helps.
SamerKeymasterOkay good, now we know it’s my code 🙂 I reviewed the lines of code in question and nothing stands out as a culprit.
It has to be a Javascript error and not a major syntax one. Some function isn’t available on Android 2.2 and the program is just stopping. This can be seen in the console log however I am unsure on how to get that information from you. If you can, it would be ideal to use the Chrome remote debugging tools combined with Android’s USB debugging to get the specific error message. That way I can resolve it. Otherwise, I might have to come up with a way to get error’s to me since this is the second bug I can’t really put a finger on.
Thanks.
SamerKeymasterI will have to test against android 2.2 and let you know. I will get back to you soon.
Update: I fired up an Android 2.2 Froyo emulator and tried this out. Seems the run-once ran without issues. Based on your description I am a bit confused when the error is occuring. Are you able to change into the runonce page? If so, is the error occuring after you hit submit?
If it’s the second one (error submitting), it seems like a jQuery mobile issue since I don’t show a spinner on submission only on page request. If it happening during the opening of the runonce page then most likely some incompatible javascript on my part. Let me know which end so we can dive deeper into this issue. Thanks!
SamerKeymasterCan you please provide me with error logs. You need to locate where your apache logs are and get the relevant data out of error.log please.
Thanks!
SamerKeymasterSorry it took me so long to get back to you on this however I couldn’t find a better solution than just increasing the maximum. For now, I changed it from 50 to 240 minutes (4 hours).
I am still working on a design that allows an infinite range but until then hopefully this works. Thanks!
SamerKeymasterI have added language localization to the hosted web app, finally. If anyone would like to, I would appreciate it very much if you updated a few specific strings for the languages that are almost complete (Spanish, Italian and Hungarian).
I put the project on it’s own getlocalization found here: http://www.getlocalization.com/openSprinkler_hosted/. Currently, it is missing only 8 strings that manage multisite support on the hosted web app.
Thanks!
SamerKeymasterI just tried to implement something like this and ran into every obstacle outlined in this blog post (in this order): http://jondavidjohn.com/blog/2012/10/git-pull-from-a-php-script-not-so-simple
So, I have another idea. We already have a script in crontab running every minute, watcher.php. So, I can add an option to automatically install updates and have the watcher install them periodically. But, do I need to expose this as an option or would everyone be okay if this just happened? I would first do a `which git` for the binary location and if nothing is found abort there. I would then check the install location for a .git/HEAD file and if missing abort. The only issue would be a bad update but nothing that could possibly break git pull from updating/fixing itself.
Let me know what you think and we can easily implement something like I mentioned.
SamerKeymasterVery odd, I guess I will merge your suggested fix but I am still bothered by why this is happening. It seems very isolated and the fix only avoids one session_start(), which makes me believe its the root of the problem. With that said, I have no good way to debug and test this, especially without error logs.
I will have your changes merged later today and hope the issue goes away permanently.
Update: I pushed this change out now. Let me know if this helps.
-
AuthorPosts