user33723: I'm working on a webserver on ESP32 in Arduino IDE and would like to load an html-file. Tried to use SPIFFS.open from the library FS.h from github. 
Errormessage says SPIFFS was not declared in this scope. (As far as I can see, there's no bracket in the wrong place.)
I did not find any example for ESP32 and FS.h and desperately hope for some help. Thanks in advance. 
Here is my code:
     
    #include "FS.h"
    #include "WiFi.h"

/Wifi Access data/
const char* ssid_ap = "AccessPoint";
const char* password_ap = "12345678"; 

const char * ssid_sta     = "";
const char * password_sta = "";

/* set global variables */
byte WiFiMode = 0;  // WIFI_STA = 1 = Workstation  WIFI_AP = 2  = Accesspoint
int request_counter;
String sHTML;
String sHTMLRequest;

/* Create instance of server on Port 80 */
WiFiServer server(80);
WiFiClient client;

/*
 * ******SETUP*******************************************************
 */
void setup() {

/initialize GPIO/

/*start serial communication */
  Serial.begin(115200);
  SPIFFS.format();
  Serial.println("Spiffs formatted");

/* start WiFi as workstation (STA), if not possible 
   start as Acess Point
   initialize server */ 
  WiFi_Start_STA();
  if (WiFiMode == 0) WiFi_Start_AP();
}

/*
 * **LOOP*************************************************************
 */
void loop() {

/* Check if a client has connected */
  client = server.available();
  if (!client) 
  {
    return;
  }

/*Wait for the client to send data */
  Serial.println("neuer Client verbunden");
  /*Count Aufruf der Seite: */
  request_counter ++; 
  unsigned long clTimeout = millis()+250;
  while(!client.available() && (millis()clTimeout) 
  { 
    Serial.println("time-out bei Client-Verbindung!");
    return; 
  }

/****** open html files  *******/
 SPIFFS.begin();
 File f = SPIFFS.open("/home.txt", "r");
    if (!f) {
    Serial.println("file open failed");
    }
    f.close();

}

/**********************************************************************
 * 
 **************** FUNCTIONS ********************************************
 * 



*/

/*
 * Fct tries to start WiFi in workstation mode, 
 * if not possible sets WiFiMode=AP 
 * starts server
 */
void WiFi_Start_STA() {
  unsigned long timeout;

WiFi.mode(WIFI_STA);   //  Try to start WiFi as Workstation

WiFi.begin(ssid_sta, password_sta);
  timeout = millis() + 12000L;
  while (WiFi.status() != WL_CONNECTED && millis() < timeout) {
  delay(10);
  }

if (WiFi.status() == WL_CONNECTED) {
    server.begin();
    WiFiMode = WIFI_STA;

Serial.print("Verbunden mit IP - Addresse: ");
    for (int i = 0; i < 3; i++) {
      Serial.print( WiFi.localIP()[i]);
      Serial.print(".");
    }
    Serial.println(WiFi.localIP()[3]);

} 
  else {
    WiFi.mode(WIFI_OFF);

Serial.println("WLAN-Verbindungsaufbau fehlgeschlagen");
}


}

/*
 *starts WiFi in AP-mode
 *starts server
 */
void WiFi_Start_AP() {
  WiFi.mode(WIFI_AP);   // Access Point mode
  WiFi.softAP(ssid_ap, password_ap);
  server.begin();       // start server
  IPAddress ApIP = WiFi.softAPIP();   //read IP of Access Point
  WiFiMode = WIFI_AP;

Serial.print("ESP-Netzwerk: ");
  Serial.print(ssid_ap);
  Serial.print(" aufgebaut. ");
  Serial.print( " IP-Addresse: ");
  Serial.println(ApIP);
}

    <code>


user51398: The answer is belated but since the question is still open...
The code does not include spiffs library. The line below should fix the problem.Note it should be below the the include statement for FS
include <SPIFFS.h> 

So the code should look like
#include "FS.h"
#include "WiFi.h"
#include "SPIFFS.h"


33723: <p>I'm working on a webserver on ESP32 in Arduino IDE and would like to load an html-file. Tried to use SPIFFS.open from the library FS.h from <a href="https://github.com/espressif/arduino-esp32/tree/master/libraries/FS" rel="nofollow noreferrer">github</a>. 
Errormessage says SPIFFS was not declared in this scope. (As far as I can see, there's no bracket in the wrong place.)</p>

<p>I did not find any example for ESP32 and FS.h and desperately hope for some help. Thanks in advance. </p>

<p>Here is my code:
     <pre>
    #include "FS.h"
    #include "WiFi.h"</p>

<p>/<em>Wifi Access data</em>/
const char* ssid_ap = "AccessPoint";
const char* password_ap = "12345678"; </p>

<p>const char * ssid_sta     = "";
const char * password_sta = "";</p>

<p>/* set global variables */
byte WiFiMode = 0;  // WIFI_STA = 1 = Workstation  WIFI_AP = 2  = Accesspoint
int request_counter;
String sHTML;
String sHTMLRequest;</p>

<p>/* Create instance of server on Port 80 */
WiFiServer server(80);
WiFiClient client;</p>

<p>/*
 * ******SETUP*******************************************************
 */
void setup() {</p>

<p>/<em>initialize GPIO</em>/</p>

<p>/*start serial communication */
  Serial.begin(115200);
  SPIFFS.format();
  Serial.println("Spiffs formatted");</p>

<p>/* start WiFi as workstation (STA), if not possible 
   start as Acess Point
   initialize server */ 
  WiFi_Start_STA();
  if (WiFiMode == 0) WiFi_Start_AP();
}</p>

<p>/*
 * **LOOP*************************************************************
 */
void loop() {</p>

<p>/* Check if a client has connected */
  client = server.available();
  if (!client) 
  {
    return;
  }</p>

<p>/*Wait for the client to send data */
  Serial.println("neuer Client verbunden");
  /*Count Aufruf der Seite: */
  request_counter ++; 
  unsigned long clTimeout = millis()+250;
  while(!client.available() &amp;&amp; (millis()clTimeout) 
  { 
    Serial.println("time-out bei Client-Verbindung!");
    return; 
  }</p>

<p>/****** open html files  *******/
 SPIFFS.begin();
 File f = SPIFFS.open("/home.txt", "r");
    if (!f) {
    Serial.println("file open failed");
    }
    f.close();</p>

<p>}</p>

<p>/**********************************************************************
 * 
 **************** FUNCTIONS ********************************************
 * </p>

<hr>

<p>*/</p>

<p>/*
 * Fct tries to start WiFi in workstation mode, 
 * if not possible sets WiFiMode=AP 
 * starts server
 */
void WiFi_Start_STA() {
  unsigned long timeout;</p>

<p>WiFi.mode(WIFI_STA);   //  Try to start WiFi as Workstation</p>

<p>WiFi.begin(ssid_sta, password_sta);
  timeout = millis() + 12000L;
  while (WiFi.status() != WL_CONNECTED &amp;&amp; millis() &lt; timeout) {
  delay(10);
  }</p>

<p>if (WiFi.status() == WL_CONNECTED) {
    server.begin();
    WiFiMode = WIFI_STA;</p>

<p>Serial.print("Verbunden mit IP - Addresse: ");
    for (int i = 0; i &lt; 3; i++) {
      Serial.print( WiFi.localIP()[i]);
      Serial.print(".");
    }
    Serial.println(WiFi.localIP()[3]);</p>

<p>} 
  else {
    WiFi.mode(WIFI_OFF);</p>

<pre><code>Serial.println("WLAN-Verbindungsaufbau fehlgeschlagen");
}
</code></pre>

<p>}</p>

<p>/*
 *starts WiFi in AP-mode
 *starts server
 */
void WiFi_Start_AP() {
  WiFi.mode(WIFI_AP);   // Access Point mode
  WiFi.softAP(ssid_ap, password_ap);
  server.begin();       // start server
  IPAddress ApIP = WiFi.softAPIP();   //read IP of Access Point
  WiFiMode = WIFI_AP;</p>

<p>Serial.print("ESP-Netzwerk: ");
  Serial.print(ssid_ap);
  Serial.print(" aufgebaut. ");
  Serial.print( " IP-Addresse: ");
  Serial.println(ApIP);
}</p>

<code>    &lt;code&gt;
</code></pre>
 51398: <p>The answer is belated but since the question is still open...</p>
<p>The code does not include spiffs library. The line below should fix the problem.Note it should be below the the include statement for FS</p>
<pre><code>include &lt;SPIFFS.h&gt; 
</code></pre>
<p>So the code should look like</p>
<pre><code>#include &quot;FS.h&quot;
#include &quot;WiFi.h&quot;
#include &quot;SPIFFS.h&quot;
</code></pre>
