OpenSprinkler Forums Comments, Suggestions, Requests Client-Mode for embeded version

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #22451

    aleatorvb
    Member

    Is there a way to just supply a url for the embeded version to check if it needs to open/close any valves?
    I already have a few servers at home and i’d like to make the opensprinkler into a ‘dumb terminal’ – it should fetch a url and parse a binary list, for example for 8 valves:
    00000100
    and it should open the 6th and keep others closed.
    If the url can’t be parsed or there is a connection error it should have a default value (only zeroes in the firmware by default).

    From what i’ve read there is no such way, but i could modify the code to make it do this?
    – url to grab binary values
    – interval to check (seconds/minutes/hours)
    – default value in case of error
    – maybe a mask to allow only some valves to be set (for example 11000000 for only the first two)

    I plan on doing a nicer interface for this and would like opensprinkler to fetch the command from somewhere else, once every X seconds.

    Thank you for your time and any advice regarding this matter…

    #23789

    Ray
    Keymaster

    Have you checked this section of the user manual:
    http://rayshobby.net/?page_id=730#httpget

    #23790

    aleatorvb
    Member

    Yes, i did read that when researching this.
    What i was asking about was doing the reverse, polling a http url for the input, not sending the data to the opensprinkler.

    In manual mode, with http requests being done from another server to the opensprinkler, can more than one station be opened at one? do the stations need to be configured with the http interface before using the api?

    #23791

    Ray
    Keymaster

    That is possible but clearly you have to modify the source code. Basically you can modify the code to periodically retrieve information from a server and perform actions accordingly. In fact, the firmware already has a component, namely the NTP sync, which is similar to what you want to do: it periodically retrieves the current time from an NTP server.

    Alternatively, you may want to check out the OpenSprinkler Pi, which has a demo program that makes use of the Google Calendar for scheduling sprinkler events. It’s a polling-based method, and the

    #23792

    aleatorvb
    Member

    @ray wrote:

    It’s a polling-based method, and the

    I think your reply got cut in the last message.

    Anyway, i will look at the code for ntp.
    Another question: is the ntp server configurable? Is it auto-detected? If dhcp supplies a ntp server, does the open sprinkler system run it?

    #23793

    Ray
    Keymaster

    The ntp server ip is currently hardcoded in the firmware (you can change it by recompiling the firmware and then uploading it to the microcontroller).

    To implement what you need, you can use the EtherCard::browseurl function. The EtherCard library has a few examples to demo this, for example, the webclient example:
    https://github.com/jcw/ethercard/blob/master/examples/webClient/webClient.ino
    shows how to use browseurl to periodically get a webpage and send the content to serial.

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

OpenSprinkler Forums Comments, Suggestions, Requests Client-Mode for embeded version