SpotlightKid / micropython-ftplib

An FTP client library for MicroPython.
34 stars 17 forks source link

Trouble installing this on rpi pico 2 w #12

Closed rickavila closed 2 years ago

rickavila commented 2 years ago

When I run setup.py on a new pico 2 W it gives an "ImportError: no module names 'setuptools'". I get stuck here. I am unable to find setuptools for micropython. Any assistance is appreciated.

SpotlightKid commented 2 years ago

setup.py is only for CPython/PyPI or the unix port . For micropython on microntroller boards, just copy ftplib.py and optionally ftplibtls.py and ftpupload.py to the flash file system of your board. You can also compile them with mpy-cross first and copy the resulting *.mpy files instead.

nivaneram commented 2 years ago

1) Traceback (most recent call last): File "", line 13, in File "ftplibtls.py", line 59, in init File "ftplib.py", line 216, in init File "ftplib.py", line 274, in connect File "ftplib.py", line 252, in _create_connection Error: Could not connect to ('...', 21)

Note :-(ip is hidden with *) testing on Raspberry pi pico w

2) Traceback (most recent call last): File "", line 22, in File "ftplib.py", line 723, in storbinary File "ftplib.py", line 589, in transfercmd File "ftplib.py", line 538, in ntransfercmd File "ftplib.py", line 511, in makepasv AttributeError: 'FTP' object has no attribute 'af'

SpotlightKid commented 2 years ago

Please use .set_debuglevel(2) on your FTP instance before connecting - i.e. don't pass a host/IP on instantiation use .connect(host). Then report the output here.

The second error is likely a result of the first one, because there is no connection, the instance does not have an af attribute yet.

SpotlightKid commented 2 years ago

BTW, I don't have a Rasperry Pico W, so I haven't tested this library on the pico port and I am not able to at the moment.

nivaneram commented 2 years ago

@SpotlightKid Thanks for the reply it is working properly