Library in SD Card

hello! in the case of a webserver, i would like to include and use in my code a library from a sd card in a sd card reader connected to my nodemcu. Any help would be great :grin: !

If by a library you mean code that is #included in your sketch when it is compiled then why does it have to be on an SD card connected to the NodeMCU ?

to save flash memory space :+1:

yea i knew that, but what about a compiled file in the sd card ?

A microcontroller is different from a OS-based computer.
And a library is different from a *.DLL-file like used in windows
Your code must provide all libaries at compile-time.
You can not load a library source-code at run-time into the flash.
It might be possible with a HUGE amount of development to write a code that is able to load a compiled library from an SD-card. But this has a lot of hurdles your code inside the flash would have been aware of where in the flash there is free space to load the compiled binary.

It might be different for python as python is interpreted language. I don't know much about the details how micropython works but as microcontrollers (or at least most of them) have very limited RAM the code wil be optimised which means all things that are not used are kicked out.

best regards Stefan

You mentioned a webserver. Well html and CSS-files can be put into flash or onto an SD-card.

Also there are ESP32's available that have up to 8 MB flash-memory.

I'm feeling dumb asking that question now :no_mouth:
Guess i will have to manage a lot more my card's memory .

Thanks for you guys' time!

the Nodemcu can be used with a built in filesystem. So you can upload the HTTP, CSS, JS Files to the fileystem and use it in your code.

The IDE gives you several options for the Filesystem Size:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.