AttributeError: 'RTC' object has no attribute 'init' WARNING: Could not sync device's clock: 'RTC' object has no attribu
-
- Posts: 4
- Joined: Sat May 15, 2021 10:12 am
AttributeError: 'RTC' object has no attribute 'init' WARNING: Could not sync device's clock: 'RTC' object has no attribu
I have been running my Pico in MicroPython v1.16 in Thonny on my Raspberry Pi 4.
I have an issue that started today where on powering up and connecting the Pico I get a Warning message.
Traceback (most recent call last):
File "<stdin>", line 10, in <module>
AttributeError: 'RTC' object has no attribute 'init'
WARNING: Could not sync device's clock: 'RTC' object has no attribute 'init'
I had a look through the MicroPython documentation on the stdin file but couldn't find this particular error. If I run a program it runs okay. But if I click on Stop/Restart backend, the error returns. I am just learning MicroPython so I am not trying to change Real Time Clocks, etc. just driving LCD's and stuff.
I have tried reloading the rp2-pico-20210618-v1.16.uf2 file and re-selecting Micropython (Raspberry Pi Pico) in Thonny but I get the same warning.
Does anybody know what causes this warning and how I can get rid of it?
I have an issue that started today where on powering up and connecting the Pico I get a Warning message.
Traceback (most recent call last):
File "<stdin>", line 10, in <module>
AttributeError: 'RTC' object has no attribute 'init'
WARNING: Could not sync device's clock: 'RTC' object has no attribute 'init'
I had a look through the MicroPython documentation on the stdin file but couldn't find this particular error. If I run a program it runs okay. But if I click on Stop/Restart backend, the error returns. I am just learning MicroPython so I am not trying to change Real Time Clocks, etc. just driving LCD's and stuff.
I have tried reloading the rp2-pico-20210618-v1.16.uf2 file and re-selecting Micropython (Raspberry Pi Pico) in Thonny but I get the same warning.
Does anybody know what causes this warning and how I can get rid of it?
Re: AttributeError: 'RTC' object has no attribute 'init' WARNING: Could not sync device's clock: 'RTC' object has no att
use rtc.datetime(datetime_tuple) instead, like:
rtc.datetime((21,07,11,0, 17,26,0, 0))
note that the datetime tuple requires 8 entries.
rtc.datetime((21,07,11,0, 17,26,0, 0))
note that the datetime tuple requires 8 entries.
-
- Posts: 4
- Joined: Sat May 15, 2021 10:12 am
Re: AttributeError: 'RTC' object has no attribute 'init' WARNING: Could not sync device's clock: 'RTC' object has no att
Hi
Thanks for the reply.
I think the problem is that I am not actually trying to set the RTC. This warning appears as soon as I initialise the Pico.
Where would I use the rtc.datetime(datetime_tuple)?
Why would this warning suddenly appear?
Thanks for the reply.
I think the problem is that I am not actually trying to set the RTC. This warning appears as soon as I initialise the Pico.
Where would I use the rtc.datetime(datetime_tuple)?
Why would this warning suddenly appear?
Re: AttributeError: 'RTC' object has no attribute 'init' WARNING: Could not sync device's clock: 'RTC' object has no att
You use rtc.datetime(datetime_tuple) to set date / time, and rtc.datetime() git get date & time.
Somewhere in your code is a call to rtc.init() which you should remove.
Somewhere in your code is a call to rtc.init() which you should remove.
Re: AttributeError: 'RTC' object has no attribute 'init' WARNING: Could not sync device's clock: 'RTC' object has no att
Thonny try synchronizing the RTC when it connects to the Pico. To do this it sends a short piece of code to the Pico, the problem is probably there.
Maybe @aivarannamaa can confirm.
Maybe @aivarannamaa can confirm.
- aivarannamaa
- Posts: 171
- Joined: Fri Sep 22, 2017 3:19 pm
- Location: Estonia
- Contact:
Re: AttributeError: 'RTC' object has no attribute 'init' WARNING: Could not sync device's clock: 'RTC' object has no att
MicroPython 1.15 acccepted 7 for Sunday, when synchronizing RTC (which Thonny assumed up to 3.3.10), MicroPython 1.16 does not, therefore Thonny received error and tried alternative approach (some devices have RTC.init)
The solution is to upgrade Thonny to 3.3.11. If you can't (RPi-s apt repo doesn't have 3.3.11 yet), then ignore the message for now. Tomorrow it should work again.
The solution is to upgrade Thonny to 3.3.11. If you can't (RPi-s apt repo doesn't have 3.3.11 yet), then ignore the message for now. Tomorrow it should work again.
Aivar Annamaa
https://thonny.org
https://thonny.org
-
- Posts: 4
- Joined: Sat May 15, 2021 10:12 am
Re: AttributeError: 'RTC' object has no attribute 'init' WARNING: Could not sync device's clock: 'RTC' object has no att
Thanks @fdufnews and @aivarannamaa.
It dissappeared after a day or two but it comes back occasionally. I can see from the Thonny website that there are later versions than 3.3.10 available. Isn't it possible to download one of the packages for 3.3.13 from the Thonny website and install that on my RPi?
It dissappeared after a day or two but it comes back occasionally. I can see from the Thonny website that there are later versions than 3.3.10 available. Isn't it possible to download one of the packages for 3.3.13 from the Thonny website and install that on my RPi?
- aivarannamaa
- Posts: 171
- Joined: Fri Sep 22, 2017 3:19 pm
- Location: Estonia
- Contact:
Re: AttributeError: 'RTC' object has no attribute 'init' WARNING: Could not sync device's clock: 'RTC' object has no att
It comes back on Sundays
I'll notify Raspberry's people about newer versions.
I'll notify Raspberry's people about newer versions.
Aivar Annamaa
https://thonny.org
https://thonny.org
Re: AttributeError: 'RTC' object has no attribute 'init' WARNING: Could not sync device's clock: 'RTC' object has no att
Many possible solutions:
1) as Aivar suggested, switching to Thonny 3.3.11
2) taking on living with this error from time to time
3) taking a rest on sunday, so you 'll never encounter the problem
1) as Aivar suggested, switching to Thonny 3.3.11
2) taking on living with this error from time to time
3) taking a rest on sunday, so you 'll never encounter the problem
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: AttributeError: 'RTC' object has no attribute 'init' WARNING: Could not sync device's clock: 'RTC' object has no att
<chuckle> "On the seventh day He rested."
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.