- This topic is empty.
May 31, 2013 at 7:35 am #22451
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:
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…May 31, 2013 at 7:20 pm #23789
Have you checked this section of the user manual:
http://rayshobby.net/?page_id=730#httpgetJune 1, 2013 at 12:48 pm #23790
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?June 1, 2013 at 1:37 pm #23791
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 theJune 1, 2013 at 9:01 pm #23792
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?June 2, 2013 at 3:24 am #23793
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:
shows how to use browseurl to periodically get a webpage and send the content to serial.
- You must be logged in to reply to this topic.