My use case is to save sensor data as files to a microSD card. Periodically, connecting to wifi and sending the data files back to a remote MQTT broker.
I am using a Wemos D1Mini and have a shield attached. The SPI connections are standard. The latest version of micropython 1.9.3 is installed. The microSD card is a decent brand, has been checked as OK and has been formatted.
-On initial boot the microSD card is not added to the filesystem; of course.
-Adding the MicroPython driver for SD cards using SPI bus returns an error at the unmount function when trying the suggested sample code
Code: Select all
import machine, sdcard, os
sd = sdcard.SDCard(machine.SPI(1), machine.Pin(15))
os.umount()
os.VfsFat(sd, "")
os.listdir()
Code: Select all
TypeError: function takes 1 positional arguments but 0 were given
the excellent esp8266 tutorial also fails at the same point of unmounting.
The micropython UOS module for the ESP8266 does not contain mount/unmount functions so I am not sure what to do. Should I be creating a SPI object ?