DS3231 - stodev-com-br/Tasmota GitHub Wiki

This feature is not included in precompiled binaries.
To use it you must compile your build. Add the following to user_config_override.h:

#ifndef USE_DS3231
#define USE_DS3231          // DS3231 external RTC (+1k2 code)
//    #define USE_RTC_ADDR  0x68                   // Default I2C address 0x68
#endif

If you use a DS3231 with a different I2C address, uncomment and change to your address:

#define USE_RTC_ADDR  0x68                  

Tasmota requires that its time be set in order to use timers. Usually, when the device boots, it gets the time and date from an an NTP (Network Time Protocol) server located somewhere on the Internet. When there is no Internet connection, Tasmota is not able to request the current date and time. The DS3231 is an external Real Time Clock (RTC) component used for keeping the time and date set in the device when it cannot establish an Internet connection.

##Configuration

Wiring

DS3231 ESP8266
GND GND
VCC 3.3V
SDA GPIOx
SCL GPIOy

Tasmota

In the Configuration -> Configure Module page assign:

  1. GPIOx to I2C SDA (6)
  2. GPIOy to I2C SCL (5)

Wiring on Wemos D1 mini

Tasmota

Any time your device has an NTP connection, the DS3231 internal clock will be set automatically. The first time RTC is used, you must have an Internet connection. From that point forward, the time is stored in the RTC and the device time will be restored from the RTC when there is no Internet connection.

(You can use your mobile phone hotspot for your device in a location where it can't get a Wi-Fi connection

Check that the time is set correctly by inspecting the log in the Console. You should see messages that Tasmota read or wrote the time from and to the DS3231. Make sure that the time is set correctly even when you do not have Internet connection.

⚠️ **GitHub.com Fallback** ⚠️