K
@peterp The ticks_ms problem test program
import machine, network, time, os; start=time.ticks_ms()
def _t(): t=(time.ticks_ms()-start)/1000; return '%02d'%t
print(os.uname())
print(_t(), 'start')
epoch=1625789769; date=time.gmtime(epoch); rtc=machine.RTC(); rtc.init(date)
print(_t(), 'lte'); lte=network.LTE()
print(_t(), 'attach', end=' '); lte.attach()
while 1:
print('.', end=' '); time .sleep(1)
if lte.isattached(): print(); print(_t(), 'connect'); lte.connect(); break
print(_t(), 'rtc')
rtc.ntp_sync('time.google.com')
while 1:
print('.', end=' '); time .sleep(1)
if rtc.synced(): print(); break
#print(_t(), 'suspend'); lte.pppsuspend()
print(_t(), 'deinit'); lte.deinit()
print(_t(), 'deepsleep'); machine.deepsleep(9000)
and the results
(sysname='GPy', nodename='GPy', release='1.20.2.r4', version='v1.11-ffb0e1c on 2021-01-12', machine='GPy with ESP32', pybytes='1.6.1')
00 start
2292128 lte
2292131 attach . .
2292138 connect
2292139 rtc
.
2295011 deinit
2295018 deepsleep
where the ticks_ms value is changed by rtc.init and rtc.ntp_sync