Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Having error wipy 3.0 with mircoSD module using ATOM (pymakr package)

    Scheduled Pinned Locked Moved WiPy 2&3
    4 Posts 3 Posters 25 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E Offline
      edgar bacaltos
      last edited by

      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, os

      spi = 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 ESP32

      I could not configure how to fix.

      L robert-hhR 2 Replies Last reply Reply Quote 0
      • L Offline
        livius @edgar bacaltos
        last edited by

        @edgar-bacaltos
        Why you do not use build in sdcard module?
        https://docs.pycom.io/firmwareapi/pycom/machine/sd/#app

        think about people first, then computers

        1 Reply Last reply Reply Quote 0
        • E Offline
          edgar bacaltos
          last edited by

          I already tried this code also got error.
          error.JPG

          1 Reply Last reply Reply Quote 0
          • robert-hhR Offline
            robert-hh @edgar bacaltos
            last edited by

            @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.

            1 Reply Last reply Reply Quote 1

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 1 / 1
            • First post
              Last post

            Pycom on Twitter

            Pycom