Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to LittleFS for ESP8266 #47

Open
andypiper opened this issue Dec 17, 2021 · 7 comments
Open

Migrate to LittleFS for ESP8266 #47

andypiper opened this issue Dec 17, 2021 · 7 comments

Comments

@andypiper
Copy link
Contributor

Compiling against the current version of the libraries and Generic 8266 board support, results in these warnings:

Compiling sketch...
/Users/andypiper/Library/Arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3 -I /Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/signing.py --mode header --publickey /Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/public.key --out /var/folders/3t/s2qs3f713zvgvt7kq31rkrxc0000gn/T/arduino_build_441567/core/Updater_Signing.h
/Users/andypiper/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -D_GNU_SOURCE -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/include -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/lwip2/include -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/libc/xtensa-lx106-elf/include -I/var/folders/3t/s2qs3f713zvgvt7kq31rkrxc0000gn/T/arduino_build_441567/core -c -Werror=return-type -Os -g -free -fipa-pta -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++17 -MMD -ffunction-sections -fdata-sections -fno-exceptions -DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10813 -DARDUINO_ESP8266_GENERIC -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_GENERIC\"" -DLED_BUILTIN=2 -DFLASHMODE_DOUT -DESP8266 -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266 -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/variants/generic -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266WiFi/src -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266httpUpdate/src -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266HTTPClient/src -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/DNSServer/src -I/Users/andypiper/Documents/Arduino/libraries/NTPClient -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266WebServer/src -I/Users/andypiper/Documents/Arduino/libraries/WiFiManager -I/Users/andypiper/Documents/Arduino/libraries/ArduinoJson/src -I/Users/andypiper/Documents/Arduino/libraries/PubSubClient/src -I/Users/andypiper/Documents/Arduino/libraries/DHT_sensor_library -I/Users/andypiper/Documents/Arduino/libraries/U8g2/src -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/Wire -I/Users/andypiper/Documents/Arduino/libraries/OneWire -I/Users/andypiper/Documents/Arduino/libraries/DallasTemperature -I/Users/andypiper/Documents/Arduino/libraries/Adafruit_HTU21DF_Library -I/Users/andypiper/Documents/Arduino/libraries/Adafruit_BusIO -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/SPI -I/Users/andypiper/Documents/Arduino/libraries/Adafruit_APDS9960_Library -I/Users/andypiper/Documents/Arduino/libraries/Adafruit_Unified_Sensor -I/Users/andypiper/Documents/Arduino/libraries/Adafruit_BMP085_Unified /var/folders/3t/s2qs3f713zvgvt7kq31rkrxc0000gn/T/arduino_build_441567/sketch/anavi-thermometer-sw.ino.cpp -o /var/folders/3t/s2qs3f713zvgvt7kq31rkrxc0000gn/T/arduino_build_441567/sketch/anavi-thermometer-sw.ino.cpp.o
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino: In function 'void load_calibration()':
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:887:10: warning: 'SPIFFS' is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
  887 |     if (!SPIFFS.exists("/calibration.json"))
      |          ^~~~~~
In file included from /Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:2:
/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/FS.h:275:15: note: declared here
  275 | extern fs::FS SPIFFS __attribute__((deprecated("SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.")));
      |               ^~~~~~
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:889:23: warning: 'SPIFFS' is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
  889 |     File configFile = SPIFFS.open("/calibration.json", "r");
      |                       ^~~~~~
In file included from /Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:2:
/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/FS.h:275:15: note: declared here
  275 | extern fs::FS SPIFFS __attribute__((deprecated("SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.")));
      |               ^~~~~~
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino: In function 'void save_calibration()':
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:923:23: warning: 'SPIFFS' is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
  923 |     File configFile = SPIFFS.open("/calibration.json", "w");
      |                       ^~~~~~
In file included from /Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:2:
/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/FS.h:275:15: note: declared here
  275 | extern fs::FS SPIFFS __attribute__((deprecated("SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.")));
      |               ^~~~~~
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino: In function 'void saveConfig()':
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:953:23: warning: 'SPIFFS' is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
  953 |     File configFile = SPIFFS.open("/config.json", "w");
      |                       ^~~~~~
In file included from /Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:2:
/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/FS.h:275:15: note: declared here
  275 | extern fs::FS SPIFFS __attribute__((deprecated("SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.")));
      |               ^~~~~~
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino: In function 'void setup()':
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:1117:9: warning: 'SPIFFS' is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
 1117 |     if (SPIFFS.begin())
      |         ^~~~~~
In file included from /Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:2:
/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/FS.h:275:15: note: declared here
  275 | extern fs::FS SPIFFS __attribute__((deprecated("SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.")));
      |               ^~~~~~
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:1120:13: warning: 'SPIFFS' is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
 1120 |         if (SPIFFS.exists("/config.json")) {
      |             ^~~~~~
In file included from /Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:2:
/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/FS.h:275:15: note: declared here
  275 | extern fs::FS SPIFFS __attribute__((deprecated("SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.")));
      |               ^~~~~~
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:1123:31: warning: 'SPIFFS' is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
 1123 |             File configFile = SPIFFS.open("/config.json", "r");
      |                               ^~~~~~
In file included from /Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:2:
/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/FS.h:275:15: note: declared here
  275 | extern fs::FS SPIFFS __attribute__((deprecated("SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.")));
      |               ^~~~~~
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino: In function 'void factoryReset()':
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:1516:13: warning: 'SPIFFS' is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
 1516 |             SPIFFS.format();
      |             ^~~~~~
In file included from /Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:2:
/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/FS.h:275:15: note: declared here
  275 | extern fs::FS SPIFFS __attribute__((deprecated("SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.")));
      |               ^~~~~~

These are only warnings, but it looks like LittleFS is the way to go for future compatibility.

@andypiper
Copy link
Contributor Author

According to the esp8266 core docs this may depend on whether the Anavi board can support LittleFS - and would need more information provided about how to rebuild the filesystem if a board was re-flashed.

@leon-anavi
Copy link
Member

Hi @andypiper,

Thank you for pointing out this warning and the recommendation for moving on to LittleFS. The thermometer is using Ai Thinker ESP-12E ESP8266 module with 4MB SPI flash memory so I expect it should be capable of supporting LittleFS.

Thanks,
Leon

@andypiper
Copy link
Contributor Author

Cool, good to know - thanks! I'll have a look at this.

(also, I've flashed the sketch successfully now on Arduino IDE 2.0 from an M1 Mac - it looks like this has refreshed the software on the board, since initially it was not working with the tempformat command until this evening - moving forward!)

@leon-anavi
Copy link
Member

That actually makes sense because the boards are provided to distributors with the latest firmware as of the moment when they are shipped to them but by the time they are purchased by individuals from the distributor there might be a new firmware version.

Btw I am happy to hear the dev workflow works with Arduino IDE 2.0 on an M1 Mac :)

Thanks,
Leon

@andypiper
Copy link
Contributor Author

I sent a couple of PRs, and I'll do some more testing and look up refreshing to LittleFS when I have some more time. Thank you!

@MarkKociscin
Copy link

MarkKociscin commented Dec 18, 2021 via email

@andypiper
Copy link
Contributor Author

andypiper commented Dec 18, 2021

I have not seen that, what is “a long period of time”? I only had the sensors drop to zero (C, aka 32F) once, when I reflashed the board, and restarting it resolved that. Did you previously open this as an issue? Maybe reopen or log this as a separate bug to this discussion :-) I can try to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants