Having error wipy 3.0 with mircoSD module using ATOM (pymakr package)
-
Hi guys, I'm newbie in micropython. I'm trying to use wipy 3.0 connecting with mircoSD Card Adapter using SPI. I downloaded sdcard.py and import to my main.py. Below is my code:
from machine import Pin, SPI
import sdcard, osspi = SPI(0, pins=('P10', 'P11', 'P14'))
sd = sdcard.SDCard(spi, Pin('P4'))
os.mount(sd, '/sd')
with open("/sd/test.txt", "w") as f:
f.write("Hello world!\r\n")#-------------------------
I'm having error when uploading the code to wipy 3.0.
Here's the error message:Pycom MicroPython 1.20.2.r4 [v1.11-ffb0e1c] on 2021-01-12; WiPy with ESP32
Type "help()" for more information.Reading file status
[1/1] Writing file main.py (0kb)
Upload done, resetting board...
OKTraceback (most recent call last):
File "main.py", line 5, in <module>
File "sdcard.py", line 54, in init
File "sdcard.py", line 80, in init_card
File "sdcard.py", line 156, in cmd
TypeError: extra positional arguments given
Pycom MicroPython 1.20.2.r4 [v1.11-ffb0e1c] on 2021-01-12; WiPy with ESP32I could not configure how to fix.
-
@edgar-bacaltos MicroPython is a little bit picky on SD cards. The SD card has to be FAT formatted with a single partition. Brand new SD cards have sometimes a second partition.
And: not all SD cards work. I have good results with cards from sandisc, transcend or samsung, in sizes between 8 and 64 GB.
-
I already tried this code also got error.
-
@edgar-bacaltos
Why you do not use build in sdcard module?
https://docs.pycom.io/firmwareapi/pycom/machine/sd/#app