Forum Replies Created
-
AuthorPosts
-
SamerKeymasterVery nice diagram, looks like a fun project!
I believe, you want to understand how the program preview is rendered so you can adapt it to logging. If that is the case, understanding the PHP will be difficult due to the data generation used. To simplify it here is what the data structure should look like:
Line 402 in main.php:
echo "{'start': ".$start.",'end': ".$end.",'className':'".$class."','content':'P".$pid."','group':'".$data["stations"][$sid]."'},";
For each object you append a list to an array. The list contains start and end time, content, a group name (station) and optionally a classname.
Line 762 in js/main.js shows how the data is retrieved from the server and rendered.
Github allows making changes and pushing them upstream. It is very easy, all you do is fork my code, push changes to your repository. Once you have a working feature make a pull request and I will approve the merge.
Right now, I show many data points on a graph. Using the preview method you can group them by type (instead of station), maybe?
Personally, I use Sublime on OSX to edit any scripts. For Windows, I believe I used to use Scite.
SamerKeymasterI think you touched on the easiest solution which is tying together the pump/master into one station. From there you only need to differentiate between pump 1 vs 2.
You could hook up your zones to the OS as follows:
1 – Pump 1 + Master 1
2 – Pump 2 + Master 2
3 – Zone 1
4 – Zone 2
5 – Zone 3
6 – Zone 4Programs based on your example:
Program 1 – Station 1 and 3
Program 2 – Station 1 and 4
Program 3 – Station 2 and 5
Program 4 – Station 2 and 6You would then put the controller in concurrent mode. You also want to make sure the time window for each program does NOT overlap, the duration is less than the time window, and the interval is much greater than the time window.
In the above setup the master valve is not set using the OpenSprinkler (since it can only handle one master).
Each program would only handle one zone and the pump/master would have to be selected in each program.
I hope I understand your problem correctly and maybe this helps. If I am off base let me know and I will rethink this problem.
SamerKeymasterAs a general trick, you can ping the broadcast and after a few replies check the arp cache.
ping -b 192.168.1.255
arp -aReplace 192.168.1 with your network leaving the .255 (broadcast).
Of course, this assumes you know it’s IP.
Update: The reason you are pinging the broadcast is most devices will reply (instead of targeting one IP). If you know the OpenSprinkler IP you can use that instead.
SamerKeymaster@Oleengr I was also confused about “water level” and had to read the manual to figure it out.
I wrote the app before that moment and therefore I used the same wording. Thank you for the suggestion! I am updating the app now.
August 31, 2013 at 4:14 am in reply to: Manual operation with count down timer feature request #25478
SamerKeymaster@wyone The original program was constrained by memory and therefore to make programs use less space a shared duration was used. This code was then mirrored to the Raspberry Pi version. Then I built a mobile front end for both (shared API).
I think in your situation, ironically, it would probably be taking up more space than individual station timers, haha. We will see how this evolves now that space issues are changing. If change does occur, so long the mobile front-end can delineate v2.0 and below versus 3.0(?), I can append my mobile app for support in either situation.
SamerKeymasterI’ve mentioned this before but deleted it because it threw a wrench into things. However, I found a well written how-to for crontab and therefore bringing it up again.
First off the guide is available here: http://www.raspberrypi-spy.co.uk/2013/07/running-a-python-script-at-boot-using-cron/
Second, this method is dead simple once you know how crontab works, I believe crontab is installed by default, sciprts are run late enough in the boot sequence to execute without conflict, etc. To recap the link all you do is:
sudo crontab -e
Add the following line:
@reboot python /home/pi/OSPi/ospi.py &
August 29, 2013 at 11:07 pm in reply to: Manual operation with count down timer feature request #25475
SamerKeymasterI think @wyone and @ray are right about run-once being preferred. I personally use manual mode for debugging purposes (testing sprinkler head, water line, wiring, etc). Otherwise, run-once can handle the timers per station.
With all of this said, like @ray said, the OpenSprinkler has the option for timers in manual mode. So, I can add this feature, if people are interested. Just let me know.
SamerKeymasterDan has posted instructions for updating OSPi to the Github hosted version:
SamerKeymasterIt also might be easier putting the configuration in a file that is not included in the distribution. Therefore, there is no way to accidentally overwrite the configuration. The program can just check if the file exists and if not, create it.
You can then combine the above system with Github making upgrades as easy as: git pull
SamerKeymasterI agree with Dan, the effort needed to accomplish what you are asking might not be worth the savings you would yield. Don’t forget the power supply will inherently draw some power just being plugged in. Here is some data (http://www.raspberrypi.org/phpBB3/viewtopic.php?f=63&t=6050&p=291334&hilit=watts+power#p291334) on the power draw of the Raspberry Pi with and without a wifi dongle. The power draw at idle was half a watt which is what a power supply will draw with the Pi being off. I really don’t think you would see ANY real world savings doing what you are discussing.
With all of that said, you could argue having it turned off most of the day might reduce heat damage if the controller is outside. However, the Pi can handle a fairly high temperature from my understanding without failing.
More data: http://www.kaibader.de/my-new-raspberry-pi/
SamerKeymasterI actually already put most options into an “Advanced Config” on the installer. I understand which title you are referring to but trying to figure out the best way to accomplish your goal. I think it is a good feature and something multiple people are having to deal with. I know some users are using the new theme system to distinguish between various locations but of course that only gives you two varieties and no way to distinguish from a bookmark or from a browser tab.
Would using the location from the weather help? For example, “Dallas OpenSprinkller: Run-Once Program.”
SamerKeymasterThanks for the suggestion. This actually used to be an option but was removed since I switched to the logo for the header on the main page. I understand people have multiple sprinklers and are trying to differentiate between them. I kind of want to avoid adding another configuration option unless needed. With that said, is there any information on the OS or the server hosting the web app that could identify the OS? In other words, can I show an IP in the page title that would alleviate this problem? Doesn’t have to be the IP, I am just making a suggestion.
Right now, I modify the title already so this is not a difficult thing to add. Also, I don’t think I am too worried about people using an OpenSprinkler for non-sprinkler reasons since my web app is 100% tailored for that use scenario. I understand the OS/OSPi is a very diverse piece of hardware however it would be almost impossible to design a UI that kept that in mind, that also provided the functions needed for a sprinkler system.
SamerKeymaster1) I do not believe the device stores any logs, mainly because of storage limitations
2) The hardware reset is outlined in the user manual:
Reset: hold B2 while starting the controller, until you see the Reset screen. Select yes and then hold B3, a hardware reset will be triggered, and the controller will recover to default settings.
3) Using my mobile app you can export and import your configuration. This backs up everything except the HTTP port and device password (prevent setting them to something you don’t know).
4) I have never heard of this nor experienced this however I suppose anything can happen.
SamerKeymasterI think this would be a cool project if you could provide suggested modules to attach to the Raspberry Pi + OSPi. I know I would be interested in this but I know nothing about the various hardware used to accomplish what you are suggesting nor do I know how I would hook them up.
Is this something that would make managing a pool easier? Or just a way to give you extra information? If so, how?
I think if you can find a way to make some instructions and get the hardware working properly I would be open to making a mobile front-end for it.
Thanks!
SamerKeymaster
SamerKeymaster@Michael Legacy is a great fit! I will change the wording tonight, thanks!
I am going to add @nate’s border suggestion the only reason I haven’t yet is because I want to apply it not only to lists on the homepage but to all lists in the app. However, the current status page already has a border and adding this CSS causes a double border making the line too thick separating stations. Once I find an elegant way to get around it I will have the code pushed out. Should be soon!
SamerKeymasterI have recently added a new theme as many of you may have noticed and today I added the ability to switch themes. This option can be found in the side panel accessed from the top left icon (bars) on the home page.
I also fixed several bugs including a nasty current status page that sent you back into current status every time the timer drifted. I also fixed a bug rendering program preview for IE8 and below.
Let me know if any new bugs have cropped up or just any general feedback.
SamerKeymaster@nate When I resize the PNG you provided it ends up looking the same as my copy. My copy is 159×37. I am using Preview on my Mac which is probably not the best tool? I don’t have a clue about images but maybe it isn’t worth pursuing if no one notices. Am I the only one who thinks the text could be sharper or is this just a limitation of the image size?
Thanks!
Update: Nevermind my old copy was cached! I see the difference now and going to use this instead, thanks again!!!
SamerKeymasterTheme selection has been added to the web app! You can now select your theme via the side panel (top left button, bars icon). The two themes are default (the old theme) and flat (the new default). I know someone will say, why not call the new default, default. Well, I am referring to jQuery Mobile default and I also don’t have a good short name for it.
Anyways, enjoy!
Update: I am noticing the quick flicker between themes if your selected theme is default, on app startup. I am working on a fix now.
SamerKeymasterThe user can be found inside /var/www/sprinklers/.htpasswd
The file is a hidden file which is probably why you don’t see it. From the Raspberry Pi you can dump the contents of this file to your console using:
cat /var/www/sprinklers/.htpasswd
SamerKeymaster@kenbob that seems to be some people’s opinion so I decided I will add an option to switch between themes and should have it added soon. Maybe today will update this thread as soon as I do!
Update: I already got this working and is pretty awesome! I should have this pushed out today. I think I will keep the new flat design as the default because it is the new trend going forward. jQuery Mobile is dropping the default theme in the next version hence why I started looking at themes. They will only provide two swatches a and b which are dark (black) and light.
Update 2: I do still plan on incorporating @nate’s suggestion to the flat theme. Been fairly busy lately and haven’t had time to incorporate all the changes.
SamerKeymaster@Avery Good idea. Well the warnings you are receiving are just that. They shouldn’t be preventing the app from functioning.
As for the permissions, you don’t need 777 just anything that allows you to make 3 files (you can also make the files yourself and ensure PHP has the right to modify them). The 3 files are:
– SprinklerChanges.txt (logging file)
– .htpasswd (used for the username/password database, named .htpasswd to help prevent Apache from serving it)
– .cache (used to cache tokens for the rememeber me option)In order to add a user manually to .htpasswd you can use the following syntax: “user:passwordn”. The user name is just that but the password is hashed using SHA1. Just generate a hashed password and put it in that file. The “n” is just a line return not really needed but could cause problems adding users down the road if a line return is missing.
In order to hash a password you can use the following command:
/usr/bin/php -r "echo base64_encode(sha1('PASSWORD'));"
Hope that helps and please let me know if you need further assistance.
SamerKeymaster@nate thank you! I agree and the reason I suggested it is because that’s how the theme comes by default. I actually removed them immediately haha!
SamerKeymasterIn regard to the list divider, would underlining links be helpful? So that the main page for example looks like this:
SamerKeymaster@Avery There is a much easier solution! Using Ray’s hosted version of the web app. Just goto http://rayshobby.net/apps/sprinklers and put the IP for your OpenSprinkler and the password set on the device (default: opendoor). You should be logged right in.
If you really want to install the copy yourself we can proceed from there, let me know.
-
AuthorPosts