Page 1 of 1

Raspberry Pi Pico Error ! || function takes 0 positional arguments

Posted: Mon Aug 08, 2022 1:41 pm
by Dishank_patel
Hello there,

I am new to this forum. Basically, I have two Raspberry Pi Picos both of them giving me the same error without even running the code. As the error occurs straight-up after connecting the pico.

Below is the error: -
Traceback (most recent call last):
File "<stdin>", line 7, in <module>
TypeError: function takes 0 positional arguments but 2 were given
WARNING: Could not sync device's clock: function takes 0 positional arguments but 2 were given
MicroPython v1.19.1 on 2022-06-18; Raspberry Pi Pico with RP2040

Type "help()" for more information.

/////// See attached picture as well /////
https://drive.google.com/file/d/1VbsHyK ... sp=sharing

I have tried to reset the Picos using the below link, but have the same error.
https://www.okdo.com/project/raspberry- ... 9960217694

I am unsure what the problem is, as they ran perfectly fine a few days ago.
Can someone please help me?

Thanks,
Dishank

Re: Raspberry Pi Pico Error ! || function takes 0 positional arguments

Posted: Mon Aug 08, 2022 2:28 pm
by Roberthh
That looks like a bug in Thonny, trying to upload incompatible code at the connection. IDE fun!

Re: Raspberry Pi Pico Error ! || function takes 0 positional arguments

Posted: Tue Aug 23, 2022 10:51 am
by likith1268
hello there,

I have two Raspberry Pi Picos, both are giving me the same error without even running the code.

Traceback (most recent call last):
File "<stdin>", line 7, in <module>
TypeError: function takes 0 positional arguments but 2 were given
WARNING: Could not sync device's clock: function takes 0 positional arguments but 2 were given
I'm attaching the screenshot of the error below.

can anyone help me with that??

Re: Raspberry Pi Pico Error ! || function takes 0 positional arguments

Posted: Tue Aug 23, 2022 2:20 pm
by jimmo
likith1268 wrote:
Tue Aug 23, 2022 10:51 am
can anyone help me with that??
Thonny is trying to inject some code to set the RTC, but that is failing. The injected code does

Code: Select all

from machine import RTC as __thonny_RTC
__thonny_RTC().datetime({datetime_ts})
I'm not sure why this is failing and saying that datetime() takes no arguments. Since the Pico port for MicroPython was first released, it has always taken a tuple (plus self, which makes two).

I think you'll need to follow this up with Thonny - see https://github.com/thonny/thonny/issues