Page 1 of 1
SD Card, can't write from another module or async tasks.
Posted: Tue May 26, 2020 9:37 pm
by prem111
Why when I mount the SD in start boot.py or main.py I can't write to a file from another module or from task async? Do I have to grant any permissions?
main.py
Code: Select all
import os
import machine
os.mount(machine.SDCard(slot=3,width=4), "/sd")
Re: SD Card, can't write from another module or async tasks.
Posted: Tue May 26, 2020 10:38 pm
by dhylands
You should be able to. Make sure you're using a filename like "/sd/filename.txt" (it's the /sd part that's important, not the filename)
Re: SD Card, can't write from another module or async tasks.
Posted: Wed May 27, 2020 6:31 am
by prem111
Yes, I do it exactly, it works when I start from one class, but when I do mount in main.py, while open and write in async def doesn't work anymore.
Re: SD Card, can't write from another module or async tasks.
Posted: Wed May 27, 2020 10:48 am
by prem111
Ok sorry, my mistake. Its work fine !