OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) Got logging working on Raspberry Pi

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #22322

    Dan in CA
    Participant

    I have been able to get David Gustovson’s php logging script working on the Raspberry Pi.

    I had a problem getting the SprinklerWatcher.php script to load and run in the background and it seems that the cron program in the Linux distro (Raspbian wheezy) I am running on the Pi has a minimum time delay if one minute. To solve these problems I wrote a python script that runs as a deamon and uses an infinite loop to check the state of OpenSprinkler every ten seconds. It loads automatically when the Pi is powered on and runs quietly in the background. It updates the same text files as the SprinklerWatcher script did so the Sprinklers.php script which displays the log data works without modification. This should work with the unmodified OpenSprinkler firmware.

    As mentioned in my previous post I modified one line of the OpenSprinkler firmware so that it would load the Javascript and icon files from the Raspberry pi instead of fetching them form the rayshobby server. This allows the web interface to work locally even if a connection to the internet is not available. I recently had to go a day without DSL due to a problem with the phone company’s lines. The down side to this is that the Raspberry Pi must be running and connected to the local network in order for the OpenSprinkler interface to work. I wonder if it would be possible to add a field to OpenSprinkler’s Preferences page to switch between default behavior (using rayshobby server) and another URL (e.g. the server on the raspi)?

    I am working on documenting the process of setting up the Raspberry Pi to work with OpenSprinkler and will post here when i have something useful. I am also willing to share the image file for the configuration I have on the Pi but it would be about a two gigabyte download. If enough people are interested, perhaps we could convince Ray to sell SD cards with a pre-installed configuration (hint, hint). One other thing I did was to modify the local copy of home.js, replacing the Weather button with a Logger button that opens the log page when clicked.

    I’ll report back as soon as I have the set up info ready.

    Dan

    #23219

    Ray
    Keymaster

    Hi Dan, thanks for sharing.

    Regarding your question

    if it would be possible to add a field to OpenSprinkler’s Preferences page to switch between default behavior (using rayshobby server) and another URL (e.g. the server on the raspi)?

    this can be done by adding an string option that stores the prefix to the Javascript path.

    If you have a write-up, I would be happy to post it on my blog. Is it possible to share just the changes/files you made, instead of the entire linux image file? I assume a user would want to install the default Raspi image first, and then follow the change you made.

    #23220

    dman
    Participant

    The Raspberry pi idea sounds good, but I was wondering if anyone knows a simple webserver that would run on a windows box to do the logging. I have a small netbook runnning logging software for my solar panel array – has to be windows. I am currently running moongoose server on this box that handles PHP, but not cron jobs. I’d like to use this box to host the opensprinkler javascript files and run the logging scripts. Its relatively underpowered, so I don’t really want the full XAMP thing – any ideas?
    I may actually be better off just using the Raspberry Pi idea in the end, so looking forward to trying this method when Dan uploads the image.

    #45607

    Mike
    Participant

    Where is David Gustovson’s php logging script , isn’t the unified version a single binary? I have yet to find any system logs and have no clue how to debug why my programs are not being run.

    #45614

    ShawnHarte
    Participant

    Mike you have posted a question regarding a 5 year old version of the firmware. The logs are built in to the firmware now for all versions of OS. They can be accessed directly from the app, however they won’t necessarily tell you why something didn’t work. The logs show run times and weather adjustment information. Lots of times this information will explain a situation where something didn’t run, but in some cases it won’t.
    For the times when logs don’t help first check all of your settings again. If you find it necessary to make changes be sure to save them prior to moving to the next setting.
    If none of that works find the API document on the support pages and post your settings from /ja. Just be sure to remove personal information like your weather key, and remove the decimal component of your location. This will help others help you.

    Also I would suggest starting a new topic as this one has very old information which will lead to confusion for others with similar issues.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) Got logging working on Raspberry Pi