Forum Replies Created
-
AuthorPosts
-
SamerKeymasterFantastic news!
Thank you for this information, I will update the install instructions on the Github page for Synology soon!
SamerKeymaster@ubestbsteppin If i remember correctly, you are presented a login screen just lack credentials (doing a manual install). I would suggest continuing down this path by adding a username:password as suggested before trying the installer again. Otherwise, I am not quite sure what is needed other than permissions. If you can edit the php.ini are you sure you cannot get any Apache/PHP error logs?
Edit: In order to debug could you private message me your config but remove any sensitive information, please (password and IP). Then do a detailed file list on your log/password files so I may ascertain their permissions to try and pinpoint the issue. Send the file list via PM as well.
SamerKeymasterOkay, I had some sloppy coding that worked on my particular setup but clearly isn’t the best way to do things. I updated the code try now please.
SamerKeymasterOkay, great news! The reason installer is failing is because it cannot add the watcher/logger to crontab. This is not a huge problem at all. You can manually add it. The reason it is failing is because you have PHP Safe mode on (again, this is not a problem).
Even if you do not add the watcher to crontab, the web app will work.
To add the watcher to the crontab do the following:
crontab -e
And add:
* * * * * cd /volume1/web/sprinklers; php /volume1/web/sprinklers/watcher.php >/dev/null 2>&1
As for the final error: I cannot determine what line 419 in main.php is because I have pushed several updates to the code recently. If you could copy paste line 419 from main.php I could further debug the cause of that (or update to the latest version out now, 18 minutes old, and paste any new errors).
As a final summary, based on your Safe Mode error I suspect everything up until then went fine which means your config.php, user files, and log files should be created and saved properly. From here, update to the latest, add your watcher to cron manually like instructed above and give me any new errors you may receive.
Thanks.
Edit: I updated the installer to catch crontab failure and show the proper error message. It will also take you to the login screen after this error since it is non-critical.
SamerKeymasterAnother update, for the Raspberry Pi users: The last run is now hidden as is the sequential option. As soon as they are working on the interval program they will reappear :D!
At this point I think I will break on features and focus on specific bugs so @Oasiz37 let me know your progress so we can ensure the program works in most situations.
So far, I have gotten reports of a successful install on a Debian Linux machine, Raspbian Raspberry Pi machine, a OpenSprinkler Raspberry Pi (running both the interval app and my web app off the same device), and a Tomato firmware based Belkin router. Would love to add Synology to that list.
SamerKeymasterJust posted an update to my web app with options to export and import the configuration. The export and subsequent import occur in localStorage on the browser itself. At the very least this will let you muck around with settings and programs and allow a quick restore point. Later, I plan to add file export/import for non-iOS devices but for now I am satisfied.
SamerKeymasterThe website should auto navigate you to the install.php if a config.php is not found in your directory. If it is not I would venture to guess something is going very wrong and unexpected. If you could please supply some PHP error logs I would love to further help. Not sure where on the Synology Apache setup however typically these errors are sent to /var/log/apache2/error.log
The only files that need to be writable after install are the 2 log files defined by $log_file and $log_previous. During the install they are the bottom two file paths requested.
Thanks
SamerKeymaster@Oasiz37 The instructions are sparse because this is a work in progress project that I am doing for fun. With that said you did the right thing so far in extracting the files to the web directory. The next thing you need to do is open your browser and navigate to said directory. All you do now is fill in the requested fields and off you go. Since you already changed the permissions for the directory you should have no problems letting PHP generate the config.php and other log files.
The “user” field your referring to, I assume, is the username. The program has an authentication system in place to help prevent unwanted/unauthorized access to your sprinkler system. You can put whatever username / password you want as this is what will be used to log you in.
Not having a password set or using ignore password is NOT a problem for my web app. The file permission error is a very generic “guess” at what could be wrong so don’t go crazy trying to figure that out but again, its the most likely issue (or for some reason PHP can’t write out).
You can try to “install” the web app your self by renaming the provided config example to config.php and filling in the variables there. Then you will need to generate a .htpasswd file in the format described here: http://rayshobby.net/phpBB3/viewtopic.php?f=2&t=154&start=40#p775
Please let me know if this helps.
SamerKeymasterI am actually working on a web app for the device and just got the same suggestion (export/importing) programs/settings. I will be looking into this and if I develop anything I will let you know.
The reordering is probably easily done if you export, reorder manually, and then import the file like you suggested.
Update: My application currently supports exporting/importing but does so to local storage using JSON. It would be some what technical to reorder but can be done if you have any experience with the web console. The item name is “backup”. I am still looking into adding this as a feature on the web application.
SamerKeymaster@slobrewer I appreciate that! My PayPal is [email protected]
I am glad everything is working for you now!
SamerKeymasterThat’s actually an awesome feature! Let me look into the best way to do it.
The only problem is the iPhone does not allow any real file manipulation (export/import) but every other browser would. I could also backup to device using localStorage but not sure that is exactly what we are trying to do.
I will do some more research because I do like this idea. I would try to export/backup all the settings not just the programs because that would make recovering from some situations a whole lot easier.
Edit: I have a backup/import already working using localStorage now. The benefits from this are cross-browser compatibility especially on iOS 6 which saves localStorage in a sandbox like a native app. This information is saved to iCloud/iTunes backups and restored from backups. The down side is the data is not user editable/accessible and stuck on the specific device your using. I could send out a file for download but on an iPhone the best this would do is open Safari (would require re-login) and then a manually email file from there. Of course, a file would work perfectly in every other browser but my primary device for this operation is the iPhone. With all that said I will be playing with it a bit further and post my results.
SamerKeymaster@djagerif I tried to debug Android 2.3.3 but unfortunately the emulator provides no good way to interact with the javascript console. I suppose I could send out console.log’s and eventually figure out how to get it supported on Android 2.3.3 however I am not sure if there is much demand supporting such an old OS nor am I proficient enough to do so. However, just to note I am experiencing the same thing as you on Android 2.3.3. The header is on top of the page content on the home page and I am unable to scroll.
If you don’t mind rooting your HTC Desire I believe you can update to ICS+ using a guide such as this: http://frenchtouch.pro/tutorial/android-ics-for-your-htc-desire/2
If you or anyone else has any suggestions I would love to incorporate them into my web application.
SamerKeymasterThe updated scripts still require an equal sign for getting the station status but a quick change allows it to work properly. I also posted other changes to bring the API closer to the documentation here: http://rayshobby.net/phpBB3/viewtopic.php?f=2&t=154&start=40#p781
(Sorry for posting this all over the place just trying to make sure it’s documented and seen.)
SamerKeymasterCross-posting my findings here in order to bring the interval program closer to the HTTP GET API documentation of the normal OpenSprinkler I made the changes documented here: http://rayshobby.net/phpBB3/viewtopic.php?f=2&t=154&start=40#p781
These allow my webapp to work almost 100% with the interval program. The patch file is designed for the latest version of the OSPi posted on Ray’s Github (Commit #5f1042f9ad68d679ac1eacdb38762894c46614a3). I am hoping these changes can be incorporated into the live version of OSPi interval program.
Couple of other notes: I do not find a sequential option in the program (which causes problem’s if that setting is checked in my web app). Is this something that is planned to be incorporated? Also, I noticed the last run information is not updated on the OSPi, is this something I am doing wrong or just not working yet.
Thanks!
SamerKeymasterGood to hear your setup is working all from one Raspberry Pi!
Unfortunately, I am not the best with timezones however I have pushed an update to help address the timezone issues. There is no longer a choice of timezone during the install and will now default to UTC. So long the server’s time is set correctly, I believe this will work just fine. I did some more testing and the program preview seems to be working well. The logging is now fixed by applying the timezone difference before displaying the time. This is done against the OS timezone setting.
This change will mess up old log entries. The best thing to do if you update would be to empty the two log files defined by $log_file and $log_previous. Also, if you are updating please change your config.php timezone to UTC otherwise the calculations will be off as well. There was no good migration path hence the manual interventions needed. Just to be clear the manual changes are only needed if you are upgrading to the new files and does not affect new installs.
@Vaughano and @djagerif please let me know if this helps address your issues. I am sure more work needs to be done for this issue but need to see where we stand before proceeding. Thanks!
SamerKeymasterThe officially published support list is available here: http://jquerymobile.com/gbs/
Your scrolling is probably due to the lack of ‘-webkit-overflow-scrolling: touch;’ This is supported on Android (3.0+) and iOS (5+). A workaround for older devices is using two fingers to scroll (possibly an iOS only workaround) or for Android grabbing Chrome for Android from the Google Play store.
I will consider adding a reset to the web app deleting all the accessory and config files but to be honest I do not expect users to keep their web directory writable/deletable from PHP so this might be a limited use scenario.
Glad everything is working out now!
SamerKeymaster@djagerif That is something I am toying with and hopefully can even enable auto updates on supported platforms. That feature will be downstream of other bugfixes though.
As for the manual mode and run-once pages they have been updated and are now AJAX loaded. Meaning renaming stations will reflect instantly on both those pages.
Also, the location should now support commas like in your situation. Please update and let me know if the issues are resolved. The timezone fix will come soon, hopefully. In the meantime, please refer to this list for valid timezones: http://www.php.net/manual/en/timezones.php
SamerKeymaster@djagerif Great question! From my experience the best way would be to navigate to the directory where the files are stored and run the following command (if your using git):
git pull
If you are not simply re-download and extract/overwrite all the files. I do not provide a config.php in the repository nor do I provide the pass_file, log_file, or log_previous file so they will never be overwritten on an update/overwrite.
SamerKeymaster@djagerif The timezone selection in the installation screen is used by the program preview and the logger. Unfortunately, there is no easy way to translate the value from the OS to PHP and that is why it exists.
As for the location information, my regex is cutting off the name because it doesn’t allow commas, but that will now be fixed in the next update, expect it soon.
As for the station names: that’s very weird. My only guess is that the manual mode page doesn’t update between each page load (I assumed not much changes and one less Ajax call is better/faster). So my first recommendation is to refresh the entire site and see if the page updates. If it does, than I will simply Ajax call a new manual mode page, just in case, and will post this update soon.
@anthonywebb I just tried it on Chrome in iOS 6 and experienced no problems. My best guess is this is an iOS 7 beta issue which I honestly do not have or know how to isolate. Best recommendation is wait until iOS 7 is final or use mobile safari.
SamerKeymaster*** UPDATE ***
This has been patched into the offical version of the OSPi code. This patch is no longer needed. Please download the latest version of OSPi from: https://github.com/rayshobby/opensprinkler/tree/master/OpenSprinkler%20Pi/software/demos/interval_program
*** UPDATE ***
Great news for Raspberry Pi users! I have found all the problems in the python script and made the modifications needed to allow my web app to work properly (and also bring the HTTP GET implementation closer to that of the OpenSprinkler).
Below are the changes required. Hopefully Dan sees this (or Ray can tell him) and updates his code if he approves of these changes. All of these changes occur in ospi.py.
I have created a patch file so you can quickly make the changes. The file is available at http://albahra.com/journal/wp-content/uploads/2013/06/rpi.webapp.patch_.txt
To apply the patch simply place it in the same directory as the OSPi files and run the following command:
patch < rpi.webapp.patch_.txt
If you do not want to or cannot use the patch then make the following changes manually:
Find:
'/sn=(d+?Z)', 'get_station', # regular expression, accepts any station number
Replace with:
'/sn(d+?Z)', 'get_station', # regular expression, accepts any station number
Find:
if qdict !='' and qdict == qdict: sd = base64.b64encode(qdict)
Replace with:
try:
if qdict !='' and qdict == qdict: sd = base64.b64encode(qdict)
except KeyError:
passFind:
if qdict == '':
qdict = '1' #default
elif qdict == '0':
srvals = [0]*(sd) # turn off all stations
set_output()
if qdict == '0': self.clear_mm()
if qdict != '0':
sd = ((time.time()-(time.timezone-(time.daylight*3600)))
+(int(qdict)*3600))
else: sd = 0
if qdict == '1':Replace with:
if qdict.has_key('en') and qdict == '':
qdict = '1' #default
elif qdict.has_key('en') and qdict == '0':
srvals = [0]*(sd) # turn off all stations
set_output()
if qdict.has_key('mm') and qdict == '0': self.clear_mm()
if qdict.has_key('rd') and qdict != '0':
sd = ((time.time()-(time.timezone-(time.daylight*3600)))
+(int(qdict)*3600))
elif qdict.has_key('rd') and qdict == '0': sd = 0
if qdict.has_key('rbt') and qdict == '1':To summarize the changes listed above change how the station status is retrieved from using sn=1 to sn1, for example. The other changes check to see if a variable was supplied and if not continue without error instead of halting.
The last thing remaining is the sequential option which is missing from the interval program for the Raspberry Pi. If you attempt to set this option it will fail. For now avoid it until I can speak with Dan and find a fix.
SamerKeymasterThat’s fantastic to hear! Glad it worked out!
Let me know if you have any suggestions as you use the app or if you find any bugs.
The one bug I have experienced so far is the time selection on new programs (and sometimes editing current programs). What happens is the content view scrolls up and the underlying gray background is exposed over half the screen. It is purely a cosmetic bug but should be fixed soon!
SamerKeymasterOkay perfect. Using the file path defined in config.php by $pass_file add one line using the following format:
username:hashed_password
In order to get the hashed password copy the following code into a file named test.php and navigate to it:
echo base64_encode(sha1('PASSWORD'));
?>
Replace PASSWORD with whatever you want to login with.
As a side note I suspect the directory housing your files is not writable by PHP or your server’s php.ini is preventing file operations.
Hope that helps!
SamerKeymasterThere are two things you can do to help debug the situation. First, check you web server error log for any relevant information and post it here: typically /var/log/apache2/error.log.
Also, rename the provided config-example.php to config.php and fill it out manually. After try to navigate to the main page and report any errors you may get.
Thanks!
SamerKeymasterThe status for all stations now works correctly on the RPi (assuming you applied the fix to the python code, posted here: http://rayshobby.net/phpBB3/viewtopic.php?f=2&t=154&start=30#p759).
The problems I am experiencing now are related to switching manual mode,enable mode, and rain delay because the RPi code submits all the variables each time (and requires them even if not changed…). The problems could also be related to the interval program being based on firmware 1.8.2 which is older than the firmware that this web app was written for.
I will try and find a fix in the python code for this since I do not want to send all the options each time (since the HTTP GET documentation for the interval program says they are optional). I might cross-post this issue to the RPi forum and hope Dan can issue a fix.
I have tested everything else and some of the settings work (all the checkboxes and station renaming), most of the status info shows up properly (except last run time), all of the station status shows up, run once programs work, turning off/on stations in manual mode works, stop all stations works, editing and adding programs is working, and preview programs is working!
We are getting very close at this point just not 100% there.
SamerKeymasterI found why you are getting an index out of range error. It is because it expects a t value to be given, like so:
http://IP_ADDR/sn1=1&t=0
The t variable is how long to keep the zone on, and 0 means indefinitely. Basically, there are a few syntax differences that need to be addressed.
I have updated my code to issue a t=0 now which works fine on both versions (the RPi and the OS).
Let me know if this works better now!
-
AuthorPosts