I’ve got an Interstate 75W and I loaded up the clock example, and configured my wifi settings and it works great when connected to my laptop. However, when I disconnect it doesn’t seem to connect to Wifi. It takes a little while, which suggests it is attempting to connect, but then the clock appears starting at midnight, which is the fallback behaviour if it can’t synchronise the time over NTP… As it’s not connected to my laptop debugging options are obviously quite limited…
To clarify, is the Pico connected via Wi-Fi in this state? I’ve not used one of these devices, but I assume that when connected to your laptop your debugging works over the USB bus, and a separate network connection is not necessary.
When connected to the laptop, the time will be synced from Thonny over the serial connection. It gets the time from the host PC.
I have an Interstate 75, mine has an RV3028 attached via i2c. The RV3028 has an onboard battery to maintain the time. And I haven’t setup the WIFI on it, wasn’t needed.
If need be I can pull the QWICC plug and try and setup the WIFI. If your issue is a typo in one of your files, it won’t prove much.
I’d say your time sync issue is a WIFI connection issue.
EDIT: I used notepad++ to create my wpa_supplicant.conf for my Pi’s. If I use Windows Notepad, or Word, it gets formatted wrong and won’t work.
Thanks both. @alphanumeric, you are correct - Thonny was setting the RTC, which was confusing me. There’s also a bug in the example code where it prints “Connected”, even if there has been a problem connecting to the Wifi. I didn’t spot it wasn’t printing “Time Set”, which it does when the NTP time is set properly.
I have a typo in my Wifi password, which I’ve fixed and now everything works fine.