Forum Replies Created
-
AuthorPosts
-
SamerKeymasterThis issue has come up enough and I decided to help resolve it by modifying the installer. It now detects if an interval program is running on the same machine. If so, it auto fills in the IP:port and password (default: opendoor). All you have to do now is enter a username / password.
To help delineate, when an interval program is found the OS IP/password renames to Interval Program (detected) and collapses. It’s header turns black (similar to advanced configuration) instead of the normal blue.
This combined with the new auto detection for config and log file location the install process should be a lot easier for Raspberry Pi users, hopefully!
SamerKeymasterHey @daver! Fortunately, this is a very easy fix. You don’t need to port forward anything. Just use the IP 127.0.0.1 and the port 8080 for the OpenSprinkler IP:Port in the web app.
The 127.0.0.1 is your loopback interface which routes traffic back to the same machine. Since you are using the same Raspberry Pi for the interval program and the web app we can use the loopback.
The port 8080 is what the interval program uses by default. My web app is asking about this IP:port. This is because my web app communicates with the interval app.
Hope this makes sense and helps.
Update: Well, if you want to access the mobile web app outside of the home you port forward 80.
SamerKeymasterAlso, Ray did open a sub-forum for this app. Please do submit new issues there so we can have focused, threaded conversations rather than everything being in one thread.
Thank you!
SamerKeymasterBy the way @Zapp I pushed another update for the logging system just let me know if everything is still working for you, thanks!
SamerKeymaster
SamerKeymaster@Zapp multiple things are happening. First, on the graph view you have multiple zones that are being graphed and have no data (S03-S07). If you tap them on the legend you will see what I mean.
Also, the way the log data extraction works it attaches the end time to the data point but while the station is running it returns the start time.
I plan on fixing both of these issues by the way just explaining the current state.
SamerKeymasterI had a pretty serious bug in the logging and I have since revised it. I no longer loop through the file to get the last line and instead kick the request out to the shell function tail. I did this because I do not have my laptop or any tools to fix this and had to make this fix using Github. The reason I am telling you this is because this breaks compatibility with Windows user’s. This is most likely a very small subset of people however I plan on fixing this later today.
I also fixed a bug in the watcher script that was resulting in every minute check to output a newline to the log file. This has been fixed as well.
Please let me know if this resolves the issue. Thanks!
Update: The reason these bugs cropped up is because I recently removed the requirement for SprinklerPrevious.txt file (this file can now be safely deleted). Instead, I read the last line of the main log. I do this in a way that doesn’t push the entire file into memory, so no performance cost. The first problem described above is related to the method of reading the last line (my first way would cause an infinite loop if the file was empty). The second problem was the SprinklerPrevious format was slightly different than the main log file (specifically no date/time wasn’t added).
SamerKeymaster@Zapp I think I found the problem and will post a fix soon. Based on what you said, this is a new install and the readLastLine function I added is looping indefinitely because no last line is found (there isn’t one).
SamerKeymasterUpdate: Ray below is right.
SamerKeymasterI think the issue is this:
#PSU: Output 24V 1.1A (From an old EPSON Printer)
Which is most likely a DC PSU. I believe that needs to be an AC PSU.
SamerKeymasterThat configuration option is omitted now in favor of the new window selection in the logging page. It defaults to 7 days on first load but can be changed quickly from the option collapsible. The changes are monitored and after a 500ms delay the log page will reload with your new window and any sorting you might have selected. The purpose for the delay is if you are still typing/scrolling your date selection.
I just discovered the annoyance with unused station since adding Rain Delay and Rain Sensor (effectively the same things). I was planning on automatically unchecking the stations with 0 log data so they don’t even render on the graph’s, on load.
I’ll check out IE10 and Firefox because I committed myself earlier to supporting everything, haha.
Update: I found the problem in IE 10 and Firefox. Should be fixed now.
SamerKeymaster@momanz Thanks 😀 I think I found your problem and fixed it. Let me know.
Updated screenshot:
[attachment=0:3krng6rn]iOS Simulator Screen shot Jul 27, 2013 3.21.45 PM.png[/attachment:3krng6rn]Update 2: This is actually really awesome on a larger display (iPad/desktop). But also works very well on the iPhone. Playing with the ability to define the window down to the minute (using datetime instead). I also want to add momentum scrolling, if I can. Very excited with this new view!
July 27, 2013 at 8:05 pm in reply to: sprinklers_pi – An alternative sprinkler control program #24939
SamerKeymasterYou should check out this thread for hardware/hardwire rain sensor method without any software: viewtopic.php?t=218
SamerKeymaster
SamerKeymasterThat’s the next thing I plan to work on. For now, you can tap the legend to dismiss/hide it.
SamerKeymasterFront end for the log graphing is up now! Huge thanks to Richard Zimmerman for sharing his program!
There are a lot of bugs and I’m aware of most of them. I plan on sanding it down over the weekend. As I do, I will make it easier to access the graph and also let the log page remember which one you used last (table/graph).
In the meantime a screenshot:
[attachment=0:2cjmmv4p]IMG_0707.PNG[/attachment:2cjmmv4p]Update: I’ve pushed over 12 updates since this post which address a lot of the issues. Please check out the Github change log for details. At this point let me know if you experience problems with the new graph view.
July 26, 2013 at 6:15 pm in reply to: sprinklers_pi – An alternative sprinkler control program #24933
SamerKeymasterVery impressed with this solution, I have to admit! I have never even looked at code in C so this is exciting since I am now going through your code to learn 😛
Thanks again for sharing this!
July 26, 2013 at 1:06 am in reply to: sprinklers_pi – An alternative sprinkler control program #24931
SamerKeymasterThe logging is absolutely impressive! I am actually learning flot now and hoping you wouldn’t mind if I try to incorporate the graph logging into my app. Still trying to figure out how to convert my data into the appropriate JSON but hoping I can make it work!
July 26, 2013 at 12:24 am in reply to: sprinklers_pi – An alternative sprinkler control program #24930
SamerKeymasterFirst of all, awesome work! I am trying to get started with this but unfortunately can’t seem to. Here is what I have done and where I am:
I don’t have a Raspberry Pi so I am just compiling on my MBP. I commented out all the digitWrite calls, OUTPUT and pushpin call. I also commented the reboot call. I removed the -lwiringPi in the Makefile, as well. After all of this it compiled successfully:
$ make
Building target: sprinklers_pi
g++ -o "sprinklers_pi" build/Event.o build/Logging.o build/Weather.o build/core.o build/port.o build/settings.o build/sprinklers_pi.o build/sysreset.o build/web.o -lsqlite3
Finished building target: sprinklers_piAfter that I ran the program and it seems to run fine:
$ ./sprinklers_pi
2013/07/25 19:19:29 Starting v1.0.1..
2013/07/25 19:19:29 Turning Off All Zones
2013/07/25 19:19:29 Listening on Port 8080
2013/07/25 19:19:29 Turning Off All Zones
2013/07/25 19:19:32 Got a client
2013/07/25 19:19:32 Page:
2013/07/25 19:19:32 Serving Page: /web/index.htm
2013/07/25 19:19:32 Got a client
2013/07/25 19:19:32 Page:favicon.ico
2013/07/25 19:19:32 Serving Page: /web/favicon.icoAs you can see, it even sees connections coming in! However, all I get in the browser is: “NOT FOUND”
Any advice? I tried changing permissions and also running as sudo.
Update: I understand this environment is very unique and I have VERY little experience with C and portability. With that said, I am going to try this on Debian instead since that is a closer environment it might work better.
Update 2: Same thing with my Debian 7 box.
Update 3: Figured out it is checking absolute path so I moved /web there and it works now.
Update 4: Haha we went with the same Day/Interval switch 😛
Update 5: In case anyone cares I changed web.cpp so the prefix is web/ not /web/ and changed the appropriate memcpy length.
SamerKeymasterMore updates!
Today I pushed some much needed updates IMO.
The first thing I want to address is the mobile web app (the one hosted by Ray at http://rayshobby.net/apps/sprinklers). I increased some of the timeouts. Also, I fixed some problems specific to this version (forgot to migrate parts of the last few days of commits).
Overall, I added a running clock in the status page. Also, I now show the total program time (added in the total station delay). The status page will also auto update if opened during a station delay now. I also tweaked the about page however the firmware version is still missing but the groundwork has been laid for that.
I also tweaked the timeout for the status header that comes down which should now show up more consistently after a new program has started.
As usual, please let me know if any bugs have cropped up or something needs some tweaking.
Update: Some welcome improvements are coming to the log viewer! Instead of using the timeViewWindow variable (deprecated) I will add a range selector into the app. Also, the app will support outputting the data in JSON (already added) which will allow me to graph the data! The next step (the frontend grapher) will be done using flot (should be out by this weekend). This is the technique used by Richard Zimmerman so huge thanks to him!
I plan on keeping both logging formats, the table version and the graphing version. I will add an option to switch between the two as well as the start/end date selection which will work for both versions.
SamerKeymasterI actually do like the idea about putting it in settings! On second thought though, the settings page is a little clustered at the moment. I still think maybe pulling the web app version (short sha hash) from the background tab and placing it in the header of the about page along with the OS firmware version. My goal is to provide a single place for version information and also to use the version information for debugging purposes. Having a web app that’s hosted vs installed and having OS vs OSPi is starting to make things hard to troubleshoot. If I can place the important information in a consistent location across versions I think that would help greatly in troubleshooting.
Also, the S## notation in program preview is something I do on purpose. The station name can be too long in portrait mode for an iPhone so I abbreviate the station names automatically. It’s not perfect and needs some work potentially but for now it’s better than allowing all 16 characters to show up, using half the screen width.
If you unlock screen rotation on your iPhone and rotate it you’ll notice your station names magically reappear (and rotating back will hide them).
Thanks!
Update: I want to elaborate some on the program preview page. The station name replacement is done using CSS so there isn’t much logic to it however it is FAST. The only logic I have in place is distguishing master station from the normal stations (if you are using one).
The problem with this system is a program preview which only uses S1,3,5 for example. My CSS will label them S1,S2,S3. Hopefully, I can find a way around this however in the meantime I think this system works nicely by fitting everything on the screen.
SamerKeymasterYet another status page update. This time I added the running program name and total program time remaining to the status page header.
The program’s remaining time is updated with all the station timers and pauses during station delay. The only thing left to update dynamically is the device time. Hopefully, that will be another update soon.
At this point, I might want to focus on something other than the status page. If anyone has any suggestions please let me know. The one thing I want to avoid (right now) is MySQL transition and anything that is linked to it. This is a huge undertaking and I just don’t have the time right now. But if you have any minor/quick changes or even a new feature that doesn’t require an entire re-working of the code base please let me know because I am out of fresh ideas at this point.
SamerKeymasterI actually think it should be possible using Github since Ray has kept the OSPi extracted folder. I will play with it some and see what I can do.
SamerKeymasterThat’s done for logging purposes. It’s checking for changes in station status, rain delay, and rain sensor.
SamerKeymaster@kkpwr&h2o wrote:
Couple of questions:
Should my port be 8080 if I want to use Samer’s Sprinkler web app?Yes. For the sake of clarity, it can be anything except what Apache is using (port 80). With that said, 8080 is a great port to use.
@kkpwr&h2o wrote:
How do I determine ospi is running?
The best way is navigating to the web interface. If you are not greeted by the usual home page of the firmware then it’s not running. Seems like the simplest, most reliable test.
-
AuthorPosts