https://www.adafruit.com/products/3013
Before connecting the DS3231 to the esp8266 I used an Arduino Uno to set and read back the time without issue. On the esp8266 I have version 1.2 of urtc.py downloaded from here:
https://github.com/adafruit/Adafruit-uRTC
The firmware on the esp8266 is CircuitPython 0.8.3:
Code: Select all
PYB: soft reboot
#6 ets_task(40100164, 3, 3fff8488, 4)
network config: ('192.168.1.113', '255.255.255.0', '192.168.1.1', '192.168.1.1')
could not open file 'main.py' for reading
Adafruit CircuitPython 0.8.3 on 2017-01-18; ESP module with ESP8266
Code: Select all
>>> import machine, urtc
>>> from machine import I2C, Pin
>>> i2c = I2C(scl=Pin(5), sda=Pin(4))
>>> i2c.scan()
[104, 112]
>>> rtc = urtc.DS3231(i2c)
>>> rtc.datetime()
DateTimeTuple(year=2017, month=1, day=20, weekday=4, hour=0, minute=1, second=0, millisecond=0)
>>> mytuple = (2017, 1, 21, 6, 14, 17, 0, 0)
>>> mytuple
(2017, 1, 21, 6, 14, 17, 0, 0)
>>> rtc.datetime(mytuple)
>>> rtc.datetime()
DateTimeTuple(year=2017, month=1, day=21, weekday=4, hour=0, minute=7, second=0, millisecond=0)
Thanks,
J