ESP32 machine.rtc datetime tuple parameters don't match documentation
Micropython documentation: http://docs.micropython.org/en/latest/wipy/library/machine.RTC.html
Shows machine.rtc.init documented with tuple like this:
RTC.init(datetime)
Initialise the RTC. Datetime is a tuple of the form:
(year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])
However, the code suggests a different order is used: https://github.com/micropython/micropython/blob/master/ports/esp32/machine_rtc.c
timeutils_seconds_since_2000(mp_obj_get_int(items[0]), mp_obj_get_int(items[1]), mp_obj_get_int(items[2]), mp_obj_get_int(items[4]), mp_obj_get_int(items[5]), mp_obj_get_int(items[6]))
Likewise with machine.rtc.datetime actually returns this order of parameters in the tuple:
r.datetime()
(2018, 3, 21, 2, 6, 8, 19, 258907)
r.datetime()
(2018, 3, 21, 2, 6, 8, 22, 828728)
r.datetime()
(2018, 3, 21, 2, 6, 9, 31, 888997)
r.init((2018,3,19,0,7,5,0,0))
r.datetime()
(2018, 3, 19, 0, 7, 5, 4, 368663)
r.datetime()
(2018, 3, 19, 0, 7, 5, 16, 608804)
r.datetime()
(2018, 3, 19, 0, 7, 5, 38, 98816)
Update documenation of machine.RTC
The documentation has incorrect signature. There is no RTC.init method. The RTC.datetime method has a different signature: it has no tzinfo parameter, and the "day of week" parameter follows the day parameter (instead of the hour).
For details see: https://stackoverflow.com/questions/49757733/micropython-on-esp8266-rtc-does-not-have-an-init-method/49758737#49758737