1
  1. Connect the ESP-12F to the Linux machine on USB0 port
  2. From Linux console login into the ESP-12F
    $ picocom /dev/ttyUSB0 -b115200
  1. Try to set the clock under micropython
>>> import utime
>>> import machine
>>> time=(2021, 11, 21, 23, 42, 0, 6, 325)
>>> machine.RTC().datetime(time)
>>> utime.localtime()
(2021, 11, 22, 18, 0, 11, 0, 326)

As you can see, the time changed and consequently the day as well. If I understand ~19 hours was added to the time what I wanted. Can you tell me what did I wrong here? Is not the right way to set the time? (I do not want to syc, I just want to set)

akoel
  • 151
  • 8

1 Answers1

0

I found the answer for my question.

...The documentation is wrong... Parameter 4 is the day of week..."

The 8-tuple has the following format: (year, month, day, weekday, hours, minutes, seconds, sub-seconds)

(0) year includes the century (for example 2020)
(1) month is 1-12
(2) mday is 1-31 or yday 1-365/366
(3) weekday is 0-6 for Mon-Sun ***Set to 0, being Auto Set by machine
(4) hour is 0-23
(5) minute is 0-59
(6) second is 0-59
(7) sub-seconds

akoel
  • 151
  • 8