1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-27 18:02:17 +03:00

Deprecate SPIFFS, move examples to LittleFS (#7263)

* Deprecate SPIFFS, move examples to LittleFS

SPIFFS has been a great filesystem, but it has significant problems in
many cases (and it's also pretty slow).  Development seems to have
slowed/stopped on the upstream version, and we're not able to provide
support or fix the known issues with it as-is.

Deprecate SPIFFS variable.

Update all examples to use LittleFS instead of SPIFFS.

Also, minor cleanup on very old examples which has obsolete delays
waiting for the Serial port to come up, or which were stuck at 9600 baud
because of their ancient AVR heritage.

Fixes #7095

* Remove leftover debug code

* Clean up comments in some examples

* Update documentation on SPIFFS deprecation

* Fix host tests to avoid deprecation warnings

* Fix cut-n-paste error

* Restore SpeedTest.ino, adjust to allow custom FSes

Co-authored-by: Develo <deveyes@gmail.com>
This commit is contained in:
Earle F. Philhower, III
2020-05-04 11:22:50 -07:00
committed by GitHub
parent 9845deb283
commit 83166f948b
40 changed files with 176 additions and 164 deletions

View File

@ -2,11 +2,11 @@
//
// Before running, you must download the set of certs using
// the script "certs-from-mozilla.py" (no parameters)
// and then uploading the generated .AR file to SPIFFS or SD.
// and then uploading the generated .AR file to LittleFS or SD.
//
// You do not need to generate the ".IDX" file listed below,
// it is generated automatically when the CertStore object
// is created and written to SD or SPIFFS by the ESP8266.
// is created and written to SD or LittleFS by the ESP8266.
//
// Why would you need a CertStore?
//
@ -37,6 +37,7 @@
#include <CertStoreBearSSL.h>
#include <time.h>
#include <FS.h>
#include <LittleFS.h>
#ifndef STASSID
#define STASSID "your-ssid"
@ -117,8 +118,7 @@ void setup() {
Serial.println();
Serial.println();
SPIFFS.begin();
// If using a SD card or LittleFS, call the appropriate ::begin instead
LittleFS.begin();
// We start by connecting to a WiFi network
Serial.print("Connecting to ");
@ -138,10 +138,10 @@ void setup() {
setClock(); // Required for X.509 validation
int numCerts = certStore.initCertStore(SPIFFS, PSTR("/certs.idx"), PSTR("/certs.ar"));
int numCerts = certStore.initCertStore(LittleFS, PSTR("/certs.idx"), PSTR("/certs.ar"));
Serial.printf("Number of CA certs read: %d\n", numCerts);
if (numCerts == 0) {
Serial.printf("No certs found. Did you run certs-from-mozilla.py and upload the SPIFFS directory before running?\n");
Serial.printf("No certs found. Did you run certs-from-mozilla.py and upload the LittleFS directory before running?\n");
return; // Can't connect to anything w/o certs!
}

View File

@ -3,7 +3,7 @@
# This script pulls the list of Mozilla trusted certificate authorities
# from the web at the "mozurl" below, parses the file to grab the PEM
# for each cert, and then generates DER files in a new ./data directory
# Upload these to a SPIFFS filesystem and use the CertManager to parse
# Upload these to an on-chip filesystem and use the CertManager to parse
# and use them for your outgoing SSL connections.
#
# Script by Earle F. Philhower, III. Released to the public domain.