Page 1 of 1

RTC in ESP8266

Posted: Fri Apr 16, 2021 8:19 pm
by cyrano1960
I'm kind of at a loss at the moment... :oops:
usually it's like you need the RTC time and somehow it's not right, with me it's the other way round. My ESP8266 knows exactly what time it is, but I have no idea how it knows. I don't have wifi configured and it's only connected to the PC via the USB port, but after:

Code: Select all

from machine import RTC
rtc = RTC()
rtc.datetime()
he displays the correct data. How does it know? Could anybody help me... :roll:

Re: RTC in ESP8266

Posted: Fri Apr 16, 2021 8:45 pm
by kevinkk525
If you use rshell to connect to the esp8266 then rshell sets the rtc to the PC time.

Re: RTC in ESP8266

Posted: Sat Apr 17, 2021 6:56 pm
by cyrano1960
Hi Kevin,

you hit the bull's eye. I tried it with putty and HTerm and there is a default start time displayed. I work with Thonny and that probably also sets the RTC from ESP to PC time. Thanks for your help.