Feed on
Posts
Comments


Update: OpenSprinkler new mobile app (native version) is now available on all platforms. Search ‘opensprinkler’ in iOS App Store, Android Play Store, or Windows Phone Store, then download and install the app. Additional details can be found in this blog post.


In this blog post, I will walk you through the basic steps to set up and use the OpenSprinkler mobile web app developed by Samer Albahra. I’d like to thank Samer for making this app available, and credits should be attributed to him. Initially I was planning to write a long post with textual instructions. But then I felt this app is such a significant contribution that it deserves its own video tutorial. So please take a look at the video below first. As the video is already quite long, I will keep the textual information short, with only a summary of the necessary steps, download links, and pointers to resources. Since the app is a work in progress, feel free to leave your comments and suggestions at the Rayshobby Forum.


Prerequisites

In order to use this app, you will need a working OpenSprinkler setup, such as

  • OpenSprinkler 1.x running firmware version 1.8.2 or above (note: firmware 1.8.3 preferred);
  • or OpenSprinkler 2.0 running firmware version 2.0.0 or above;
  • or OpenSprinkler Pi any version running Dan’s interval_program (equivalent to firmware 1.8.2).

If you have OpenSprinkler 1.x with firmware earlier than 1.8.2, please follow the Firmware Update Instructions to re-flash the microcontroller with the latest firmware.

Also, if you are not familiar with the concept of a mobile web app, please take a look at my previous post about the app. Simply speaking, it’s an app that runs in a browser. It’s somewhat slower than a native app, but the biggest advantage is that it’s cross-platform (i.e. same app runs on both iOS, Android, etc., even desktop browsers). By adding the web link to home screen, the app will appear like a true native app.

NOTE to keep in mind: the app provides an alternative front end to the OpenSprinkler controller. The default front end, which is the controller’s webpage (accessed by typing in the controller’s ip in a browser), is still available and functioning. Any operation you apply through the app will also be reflected in the default front end.


Version 1: Hosted App on Rayshobby.net

Samer made the app available in two versions. The first is a hosted app available at the following url:

http://rayshobby.net/apps/sprinklers/

Type this in the browser on your smartphone, tablets, or even desktop computer, and you can start using it immediately. However, before you proceed, make sure you have port forwarding set up on your router. See below.

Port Forwarding: because the hosted app needs to communicate with your OpenSprinkler through HTTP commands, your controller must be accessible by the rayshobby server. To do so, you need to set up port forwarding on your router, so that an external HTTP request to your router will be mapped to your OpenSprinkler controller. This requires knowing your OpenSprinkler’s IP address and port number (default is 80). Please refer to your router’s user manual for instructions. In addition, you can use dynamic DNS service (such as dyn.com, freeDNS etc.) to set up a DNS name for your router (i.e. an easy-to-remember name such as rayshobby.dyndns-web.com instead of the router’s IP). Most routers support dynamic DNS service as well.

Logging in: going back to the app, on the log-in page, type in your router’s IP (or dynamic DNS), optionally followed by the port number (if it’s not the default 80), and your OpenSprinkler’s access password (the default password is ‘opendoor’). Then click on the button.

Add Link to Homescreen: most mobile browsers support adding (or bookmarking) a link to homescreen. This creates a homescreen icon, which you can simply click to start the app each time.

Features: the app has implemented all features available on the latest OpenSprinkler firmware. It provides a more stylish and intuitive interface than the default front end. For example, you can use slidebars to set values, there is a status bar that shows the currently running station with count-down timer, the app’s program preview provides an easy way to switch to a different day, everything is optimized for mobile viewing experience, and finally since the app is a front end itself it does not require external Javascript as required by the default front end. Please follow the video tutorial above and try out the app yourself. Most of the features are self-explanatory.

Donation: Samer wrote the app and shared it for free. I can’t thank him enough for making this app available and so polished. If you like the app, please consider donating some money to support his work. The donation link is available on the app’s ‘About’ page (accessible by clicking the control panel button at the upper-left corner of the app).

Summary: to summarize, in order to use the hosted web app, all you need is to set up port forwarding on your router, and use the hosted web app’s url above. That’s it!


Version 2: Self-Installed App on A Local Web Server

The second version is a self-installed app that requires using a local web serer. Most of the features in the second version are shared with the hosted web app above, however, by using a local web server you gain two additional features that may be very useful: logging, and weather-based rain delay.

Installation: for installation, simply follow the instructions on my previous post about the web app, particularly the How to Set it Up (using Raspberry Pi as example) section.

Logging Feature: the self-installed app records stations runs and keeps the history of station runs in a log file. On the app’s homepage you will see a button. Clicking on it brings out the log view, which categorizes log data by station names.

Weather-based Rain Delay: having a local web server also allows weather-based rain delay. This feature is developed by Andrew Shilliday (thank you, Andrew!). Basically, it’s a script that periodically pulls data from Yahoo Weather API (using your location information), and enforces rain delay if certain weather conditions are met. Technically, the data from Yahoo Weather contains a condition code that tells the local weather condition (e.g. showers, thunderstorm etc.). The script is associated with a data file that defines the amount of rain delay hours when a certain condition code is detected. For installation and setup instructions, please refer to Andrew’s GitHub page:

https://github.com/andrewshilliday/OpenSprinkler-WebRainDelay

This is a work in progress, and we are planning to integrate this feature into the OpenSprinkler firmware so that in the future it will not need installation any more.


Resources and Links

I am really glad to see these wonderful user contributions. They tremendously help make OpenSprinkler a better product, and I learned a lot through the forum discussions, which in turn inspired new ideas. Below I list the currently active forum threads that are related to the mobile web app development and the weather feature:

We are actively working on making the weather-based control a firmware feature. If you have ideas and suggestions, please feel free to leave them at the forum. Thanks!


10 Responses to “OpenSprinkler Mobile Web App Instructions (with Video)”

  1. Hello there! I just wish to give you a big thumbs up for your excellent info you have here on
    this post. I’ll be coming back to your blog for more soon.

    My webpage; make mobile app

  2. Donald Brichford says:

    Hi Ray, I cannot find (How to Set it Up (using Raspberry Pi as example) previous post. Just an error . I have ordered the Raspberru Pi and would like your instructions.

    Don

  3. Rob says:

    Hi Ray,
    I am unable to log on to the app hosted on your site. I enter the dynamic dns with the port number and password and the arrow just spins and spins. When I go to my browser and enter the same dynamic dns with the port, I am connected instantly and ready to go. Is there a problem with the app on your site?

    Thanks,

    Rob

    • ray says:

      If you open a browser, and type in your dynamic dns following by the port number (such as rayshobby.dyndns-web.com:8080), do you see a valid webpage? If not, you should check if your port forwarding is set up correctly.

      • Rob says:

        Yes, I do see a valid web page when I enter in my dynamic dns followed by the port number. Thats why I was a little confused when I was unable to log onto the app hosted on your site. The arrow just spins and spins. What am I doing wrong?

      • ray says:

        I don’t know. Maybe it’s a browser cache problem. Try to clear browser history and try again. Also, it’s better to post the question in the forum. Samer, who wrote the app, will be able to help you with it there.

  4. mike says:

    I’m encountering a similar issue as Rob. I have set up the external port forwarding and tested from outside the my network which is working well. However, when entering this on http://rayshobby.net/apps/sprinklers/ the system keep returning (Check IP/Port number). I have tried lots of time and variations (ip / dns Name etc) but doesn’t appear to accept my ip:port.

Leave a Reply to caleb