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

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
Dishank_patel
Posts: 1
Joined: Wed Jul 20, 2022 3:24 pm

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

Post by Dishank_patel » Mon Aug 08, 2022 1:41 pm

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

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

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

Post by Roberthh » Mon Aug 08, 2022 2:28 pm

That looks like a bug in Thonny, trying to upload incompatible code at the connection. IDE fun!

likith1268
Posts: 15
Joined: Thu Aug 04, 2022 10:46 am

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

Post by likith1268 » Tue Aug 23, 2022 10:51 am

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??
Attachments
Screenshot (114).png
Screenshot (114).png (204.41 KiB) Viewed 3482 times

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

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

Post by jimmo » Tue Aug 23, 2022 2:20 pm

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

Post Reply