OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) Sensor input support

  • This topic has 3 replies, 2 voices, and was last updated 9 years ago by Ray.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #36707

    Scott
    Participant

    I have searched the forum and read that others were connecting sensors for temp moisture etc.   has there been anything added to the code to support sensor input? Or does it have to be written in?

    #36738

    Ray
    Keymaster

    Since there are many different sensors, and they may use different communication protocols, there doesn’t exist one procedure that can universally handle all sensor inputs. What type of sensors do you have in mind? Analog? Digital? I2C, SPI?

    The firmware has built-in support for rain sensor, which can be thought of as a simple digital sensor. It basically checks the rain sensor status inside the inner loop and performs actions accordingly. You can use this as a starting example to add additional sensors.

    #36741

    Scott
    Participant

    I am looking at using 1-wire. Currently I use 1-wire for all other sensors in my home, would like to continue it outside. Temperature humidity and soil moisture is what I am looking at. I’m assuming the weather is read through xml from weather underground? I can output an xml file from my server, Can ospi be setup to read the sensor data from xml?

    #36751

    Ray
    Keymaster

    Sure, OSPi can parse XML. If you are using Dan’s Python interval program, it should be pretty easy to add a module to parse XML data from your server. If you are using the unified firmware, it’s a bit tricky because that program is written in C++ which means it’s not as easy as Python to parse XML.

    The way the unified firmware parses weather data is that it queries the opensprinkler.com cloud server which runs a Python script. So the cloud server serves as a middle man between OS and WUnderground. If you can modify your server to return data in simpler format, that should work a lot better. You can take a look at weather.cpp in the unified firmware code to see the format of the output data from the weather script.

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

OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) Sensor input support