Current Lua downloadable firmware will be posted here

User avatar
By Majestry
#64102 Hello.

I try to mount external microSD to nodeMCUv3 and receive next:
spi.setup(1, spi.MASTER, spi.CPOL_LOW, spi.CPHA_LOW, 8, 8)
volume=file.mount("/SD0", 4)

stdin:1: attempt to call field 'mount' (a nil value)
stack traceback:
stdin:1: in main chunk

Firmware was built using last versions from master branch for nodemcu-firmware, used modules:
LUA_USE_MODULES_ADC
LUA_USE_MODULES_BIT
LUA_USE_MODULES_CJSON
LUA_USE_MODULES_DHT
LUA_USE_MODULES_FILE
LUA_USE_MODULES_GPIO
LUA_USE_MODULES_HTTP
LUA_USE_MODULES_I2C
LUA_USE_MODULES_NET
LUA_USE_MODULES_NODE
LUA_USE_MODULES_OW
LUA_USE_MODULES_SPI
LUA_USE_MODULES_TMR
LUA_USE_MODULES_UART
LUA_USE_MODULES_WIFI

Thanks.
User avatar
By Majestry
#64122 #define BUILD_FATFS -> uncommented in user_config.h

From fatfs_config.h
Code: Select all#define NUM_LOGICAL_DRIVES 4
PARTITION VolToPart[NUM_LOGICAL_DRIVES] = {
  {8, 1},   /* Logical drive "0:" ==> SS pin 8, 1st partition */
  {8, 2},   /* Logical drive "1:" ==> SS pin 8, 2st partition */
  {8, 3},   /* Logical drive "2:" ==> SS pin 8, 3st partition */
  {8, 4}    /* Logical drive "3:" ==> SS pin 8, 4st partition */
};


Also, even with example from nodeMCU doc i receive the same error.
User avatar
By ank
#66217 Same thing - built firmware for the Wemos mini, ticked FAT FS and included the SPI module among others (done it twice to be sure, tried both integer and float builds)

Flashed using ESPflasher - the existed LUA files were found intact

Wemos SD card mini shield used, verified all the connections from the card holder to the headers.

examples from neither http://nodemcu.readthedocs.io/en/latest/en/sdcard/
nor http://www.instructables.com/id/NODEMCU ... lay-WS281/ worked (the same codes which use different volume names "/SDO" and "SDO:" respectively; do not think this difference mattered too much though)

Tried to mount 10 times after 1 s delay:
Code: Select allif not vol then
  for i=1,10 do
    print("retry mounting, attempt =",i)
    vol = file.mount("/SD0", 8)
    tmr.delay(1000000)
    if vol then
        print("mount sucess")
        break
    end
  end
end

if i==nil then
    print ("")
    print ("MOUNT FAILED")
    print ("")
    return
end


Thank you for reading this reply, will be very grateful for any suggetoions how to move forward.