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

    cannot import name SD

    Scheduled Pinned Locked Moved LoPy
    4 Posts 4 Posters 1.8k Views 5 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.
    • R Offline
      rauburtin
      last edited by

      I try to use an SD Card with the Lopy as I used it with the Wipy, but I can't import the SD module.
      I guess that it is not available for the Lopy at this time.
      Am i correct ?

      X 1 Reply Last reply Reply Quote 0
      • X Offline
        Xykon administrators @rauburtin
        last edited by

        @rauburtin said in cannot import name SD:

        Am i correct ?

        Yes.

        Christian Ehlers

        1 Reply Last reply Reply Quote 0
        • C Offline
          cypereddy
          last edited by cypereddy

          Hello

          in the meantime a new firmeware for the Lopy is available. With some code I can mount a sd card in the boot.py:

          from machine import SD
          sd = SD()
          os.mount(sd, '/sd')

          Unfortunately the "connection" to the sd card gets lost after some time. If I try to mount the sd-card again the Lopy hangs up when I call the command sd = SD() on the pycom console. The access of the Lopy via ftp by means of Filezilla isn't possible any longer. Perhaps there is a conflict with my onewire Sensor on Pin G10?

          from machine import Pin
          from ds18x20 import DS18X20
          d=DS18X20(Pin('G10', mode=Pin.OUT))

          After reboot I get following message:

          Traceback (most recent call last):
          File "<stdin>", line 20, in <module>
          OSError: the requested operation failed

          in line 20 I call the command sd = SD()

          Are there any hints whats going wrong? I already tried different SD-Cards (small old ones with 64 MB and a brandnew Class 4 8GB Sandisk). I format the SD-Cards not with Windows but with SDFormatter.

          I use firmware version firmware release 1.2.0.b1 which seems to be already oldfashioned :-)

          With nice regards!

          A 1 Reply Last reply Reply Quote 1
          • A Offline
            abilio @cypereddy
            last edited by abilio

            Hello @cypereddy, I think you already found the reason for it to stop working, G10 (P23) is the clock for the SD card ;) . Here is the list of pins that are used by the SD card:

            https://docs.pycom.io/pycom_esp32/library/machine.SD.html?highlight=sd card#class-sd-secure-digital-memory-card

            1 Reply Last reply Reply Quote 0

            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