fredlcore / BSB-LAN

LAN/WiFi interface for Boiler-System-Bus (BSB) and Local Process Bus (LPB) and Punkt-zu-Punkt Schnittstelle (PPS) with a Siemens® controller used by Elco®, Brötje® and similar heating systems
225 stars 84 forks source link

[BUG]?: calculation of free space in filesystem #652

Closed DE-cr closed 4 months ago

DE-cr commented 4 months ago

I understand there's the possibility to include an SD card in an ESP32 system, and BSB-LAN allows to choose whether to use an ESP32's internal flash memory or an included SD card for file storage. In BSB-LAN.ino, there's a couple of locations where the available filesystem space is calculated like this:

#ifdef ESP32
    totalBytes()-usedBytes();
#else
    SDCard.vol()->freeClusterCount() * SDCard.vol()->bytesPerCluster();
#endif

Is this correct in all configurations?

fredlcore commented 4 months ago

It should as it has been correct all this while on both NodeMCU and Olimex. Now that you can use SD_MMC and SPI-based SD-card readers on NodeMCU, the former case should still be working because it is the same as the Olimex, so the only issue could be with NodeMCUs using SPI-based card readers. Since compilation works fine, I would assume it's not an issue. I don't have time to check if the libraries are the same, but feel free to do so. Unless there is an actual bug here, I'd close this for now.