cannot import name SD



  • 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 ?



  • 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



  • 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!


  • administrators

    @rauburtin said in cannot import name SD:

    Am i correct ?

    Yes.


Log in to reply
 

Pycom on Twitter