Hello!
I'm developing an irrigation system for my father, controlled from browser.
I have 2 forms in one page:
1 for switching on and off relays (currently working)
1 for setting start and stop times for sectors. (currenly not parsed)
one form sends http get request like:
192.168.0.77/?RELAY0=ON or ?RELAY0=OFF
i had no trouble in parsing this, thanks to the example in arduino library.
the other form, sends this kind of http get:
192.168.0.77/?sector=1&enabled=true&onhour=0&onminute=0&offhour=0&offminute=0
these are the parameters i need to parse.
First question:
is get better than post in arduino? Should i switch to post for easier parsing?
Second question:
how should i manage parsing?
since i have 2 standard types of message, should i add another parameter at first, turning request like:
?page=manage&RELAY0=ON
?page=settings§or=1&enabled=true&onhour=0&onminute=0&offhour=0&offminute=0
all parameters are uint8_t except enabled, boolean.
I use:
Arduino Mega 2560
Ethernet Shield (WizNet 5100)
DS3231 RTC
4 Channel Relay
Timing works ok for all channels, hardcoding start and stop times worked for test purpose. This is the last brick to see the system at work!
Thanks for any tip!