Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Mmiscool
#34700 Removed the & symbol:
Code: Select allFunctions_and_var_management.ino: In function 'String GetMeThatVar(String)':
Functions_and_var_management:147: error: no matching function for call to 'fs::FS::info(GetMeThatVar(String)::FSInfo&)'
Functions_and_var_management.ino:147:24: note: candidate is:
In file included from ESP8266Basic.ino:31:0:
C:\Users\user\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.0.0-rc1\cores\esp8266/FS.h:105:10: note: bool fs::FS::info(fs::FSInfo&)
     bool info(FSInfo& info);
          ^
C:\Users\user\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.0.0-rc1\cores\esp8266/FS.h:105:10: note:   no known conversion for argument 1 from 'GetMeThatVar(String)::FSInfo' to 'fs::FSInfo&'
no matching function for call to 'fs::FS::info(GetMeThatVar(String)::FSInfo&)'
User avatar
By martinayotte
#34701 Maybe you should show your latest piece of code, because I don't understand where this "GetMeThatVar(String)::FSInfo" comes from. Is your "FSInfo fs_info;" a local variable ?
User avatar
By Mmiscool
#34707 Finally figured it out. :D

What you said about it being local got me thinking.

Thank for bearing with me. Still trying to figure this stuff out.

Had to put
Code: Select all FSInfo fs_info;
at the top. Not inside the function.

Code: Select all#include "spiffs/spiffs.h"
#include <FS.h>


 FSInfo fs_info;


void setup() {
  // put your setup code here, to run once:
  SPIFFS.begin();
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.println(GetMeTheRemainingSpace());
  delay(1000);
}


String GetMeTheRemainingSpace()
{
  String MyOut;
  struct FSInfo {
    size_t totalBytes;
    size_t usedBytes;
    size_t blockSize;
    size_t pageSize;
    size_t maxOpenFiles;
    size_t maxPathLength;
  };



 
  SPIFFS.info(fs_info);
  int Flashfree = fs_info.totalBytes - fs_info.usedBytes;
  MyOut = String(Flashfree );
  return MyOut;
}