pycom / pycom-micropython-sigfox

A fork of MicroPython with the ESP32 port customized to run on Pycom's IoT multi-network modules.
MIT License
198 stars 167 forks source link

v1.20.0.rc2: machine.RTC.synced() always returns False (LoPy) #238

Closed noahwilliamsson closed 5 years ago

noahwilliamsson commented 5 years ago
(sysname='LoPy', nodename='LoPy', release='1.20.0.rc2', version='v1.9.4-ecfa670 on 2018-12-17', machine='LoPy with ESP32', lorawan='1.0.2')
>>> import machine, os
>>> rtc = machine.RTC()
>>> rtc.now()
(1970, 1, 1, 0, 0, 11, 396241, None)
>>> rtc.synced()
False
>>> rtc.ntp_sync('ntps1-1.eecsit.tu-berlin.de')
23:54:29.551138 IP (tos 0x0, ttl 255, id 6, offset 0, flags [none], proto UDP (17), length 76)
    192.168.2.38.49154 > ntps1-1.eecsit.tu-berlin.de.ntp: [udp sum ok] NTPv4, length 48
    Client, Leap indicator:  (0), Stratum 0 (unspecified), poll 0 (1s), precision 0
    Root Delay: 0.000000, Root dispersion: 0.000000, Reference-ID: (unspec)
      Reference Timestamp:  0.000000000
      Originator Timestamp: 0.000000000
      Receive Timestamp:    0.000000000
      Transmit Timestamp:   0.000000000
        Originator - Receive Timestamp:  0.000000000
        Originator - Transmit Timestamp: 0.000000000
    0x0000:  4500 004c 0006 0000 ff11 652f c0a8 0226  E..L......e/...&
    0x0010:  8295 1108 c002 007b 0038 c594 2300 0000  .......{.8..#...
    0x0020:  0000 0000 0000 0000 0000 0000 0000 0000  ................
    0x0030:  0000 0000 0000 0000 0000 0000 0000 0000  ................
    0x0040:  0000 0000 0000 0000 0000 0000            ............
23:54:29.591036 IP (tos 0x0, ttl 48, id 62633, offset 0, flags [none], proto UDP (17), length 76)
    ntps1-1.eecsit.tu-berlin.de.ntp > 192.168.2.38.49154: [udp sum ok] NTPv4, length 48
    Server, Leap indicator:  (0), Stratum 1 (primary reference), poll 3 (8s), precision -21
    Root Delay: 0.000000, Root dispersion: 0.001129, Reference-ID: GPS^@
      Reference Timestamp:  3754079661.064495854 (2018/12/17 23:54:21)
      Originator Timestamp: 0.000000000
      Receive Timestamp:    3754079669.567783415 (2018/12/17 23:54:29)
      Transmit Timestamp:   3754079669.567796885 (2018/12/17 23:54:29)
        Originator - Receive Timestamp:  3754079669.567783415 (2018/12/17 23:54:29)
        Originator - Transmit Timestamp: 3754079669.567796885 (2018/12/17 23:54:29)
    0x0000:  4500 004c f4a9 0000 3011 3f8c 8295 1108  E..L....0.?.....
    0x0010:  c0a8 0226 007b c002 0038 01f0 2401 03eb  ...&.{...8..$...
    0x0020:  0000 0000 0000 004a 4750 5300 dfc2 b5ad  .......JGPS.....
    0x0030:  1082 cce7 0000 0000 0000 0000 dfc2 b5b5  ................
    0x0040:  915a 40f9 dfc2 b5b5 915b 22a3            .Z@......[".
>>> rtc.synced()
False
>>> rtc.now()
(2018, 12, 17, 23, 54, 39, 961028, None)
>>> rtc.synced()
False
>>> os.uname()
(sysname='LoPy', nodename='LoPy', release='1.20.0.rc2', version='v1.9.4-ecfa670 on 2018-12-17', machine='LoPy with ESP32', lorawan='1.0.2')

I expected rtc.synced() to return True after the RTC was synced from NTP like in the most recent stable release.

rtc.synced() returns False despite the RTC being synced from NTP.

eflorent2020 commented 5 years ago

I confirm the issue,this looks like a regression, LOPY : v1.20.0.rc2 have the issue (does not sync, report unsynced) LOPY: 1.19.0.b4 does not have the issue LOPY4: 1.20.0.rc2 does not have the issue

iwahdan88 commented 5 years ago

Issue Fixed on latest release candidate v1.20.0.rc7