Forcing a date change

Related to the development libraries, released by Curt Binder
Post Reply
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Forcing a date change

Post by rimai »

How to construct the url to force a time change through wifi directly, instead of Client?
Roberto.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Forcing a date change

Post by binder »

rimai wrote:How to construct the url to force a time change through wifi directly, instead of Client?
Here's how to update date/time without using the client:

Code: Select all

http://CONTROLLER_IP:2000/dHHMM,MMDD,YY
The format is as follows:
  • HH - hours
  • MM - minutes
  • , - comma
  • MM - month
  • DD - day
  • , - comma
  • YY - year (since 2000)
Everything MUST be in 2 digit format. So single digits (like 8) must have a 0 prefix. Here's an example:

Set the date to August 8th, 2011 at 9:30am

Code: Select all

http://CONTROLLER_IP:2000/d0930,0808,11
The controller will respond with OK and set the date/time on the controller. If there was an error, the controller will respond with ERR. The actual output will be like this:

Code: Select all

Success -  <D>OK</D>
Error - <D>ERR</D>
NOTE: Type this in the URL box in your web browser to set the date/time.

curt
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Forcing a date change

Post by rimai »

The library is missing some code after line 536 on ReefAngel_Wifi.cpp
It needs this:

Code: Select all

now();
RTC.set(now());
This is to save the values into the RTC chip. Otherwise the data goes right back to where it was on the next RTC sync or when rebooted.
Let me know if you need a pull request or this is sufficient.
Roberto.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Forcing a date change

Post by binder »

rimai wrote:The library is missing some code after line 536 on ReefAngel_Wifi.cpp
It needs this:

Code: Select all

now();
RTC.set(now());
This is to save the values into the RTC chip. Otherwise the data goes right back to where it was on the next RTC sync or when rebooted.
Let me know if you need a pull request or this is sufficient.
Ok, thanks. I can add this in no problem. I've got a handful of changes in my dev branch that aren't reflected on github yet. :)

I'll make this change tonight.

curt
Post Reply