Hallo,
when I use the TimeSerial eample of the Time.h library i can sync my Arduino Uno with my Linux system time by entering:
"date +T%s\n > /dev/ttyACM0" in the Linux terminal.
This works quiet well but there is a delay of exactly one houre (I guess it has something to do with time-zones?)
Can you help me formating a terminal command to sync time with the SetSerial example of the DS3232RTC.h?
/*----------------------------------------------------------------------*
* Display the date and time from a DS3231 or DS3232 RTC every second. *
* Display the temperature once per minute. (The DS3231 does a *
* temperature conversion once every 64 seconds. This is also the *
* default for the DS3232.) *
* *
* Set the date and time by entering the following on the Arduino *
* serial monitor: *
* year,month,day,hour,minute,second, *
* *
* Where *
* year can be two or four digits, *
* month is 1-12, *
* day is 1-31, *
* hour is 0-23, and *
* minute and second are 0-59. *
* *
* Entering the final comma delimiter (after "second") will avoid a *
* one-second timeout and will allow the RTC to be set more accurately. *
* *
* No validity checking is done, invalid values or incomplete syntax *
* in the input will result in an incorrect RTC setting. *
* *
* Jack Christensen 08Aug2013 *
* *
* Tested with Arduino 1.0.5, Arduino Uno, DS3231/Chronodot, DS3232. *
* *
* This work is licensed under the Creative Commons Attribution- *
* ShareAlike 3.0 Unported License. To view a copy of this license, *
* visit http://creativecommons.org/licenses/by-sa/3.0/ or send a *
* letter to Creative Commons, 171 Second Street, Suite 300, *
* San Francisco, California, 94105, USA. *
*----------------------------------------------------------------------*/
"date +T%s\n > /dev/ttyACM0"
+T is no longer important because of the "year,month,day,hour,minute,second," format.
When I enter date to terminal it says: Mi 16. Nov 12:35:27 CET 2016
Is there a way to split this whith "," ?
Thanks for your help ![]()