Abasz / ESPRowingMonitor

ESP32 based ergometer performance monitor
7 stars 1 forks source link

littlefs error on startup #4

Closed wyattwww closed 1 year ago

wyattwww commented 1 year ago

Hi, I'm following the install process with platformio and it seems to work except for a littlefs error on startup after uploading the image. If I set ENABLE_WEBSOCKET_MONITOR to false, there's no error as it does not try to init littlefs.

I've tried uploading to different ESP32s, including wemos_d1_mini32, esp32doit-devkit-v1, and esp32dev. Any ideas why this error is happening?

Monitor output:

00:00:00.026183 INFO - Setup EEPROM Data store 00:00:00.028250 INFO - Setting up BLE Controller 00:00:00.145387 INFO - Connecting to wifi: Iberico 00:00:00.146165 INFO - . . 00:00:01.337574 INFO - Setting up Cycling Power Profile 00:00:01.347980 INFO - Setting up rowing monitor controller 00:00:01.349375 INFO - Setting up power manager controller 00:00:01.350181 INFO - Wakeup caused by resetting or powering up the device 00:00:02.862446 INFO - Connected to the WiFi network 00:00:02.863348 INFO - Local ESP32 IP: 192.168.50.97 ./components/esp_littlefs/src/littlefs/lfs.c:1229:error: Corrupted dir pair at {0x0, 0x1} E (2864) esp_littlefs: mount failed, (-84) E (2868) esp_littlefs: Failed to initialize LittleFS [ 2877][E][LittleFS.cpp:95] begin(): Mounting LittleFS failed! Error: -1

platformio.ini:

[platformio] extra_configs=wifi-config.ini [env:esp32] monitor_speed = 115200 platform = https://github.com/platformio/platform-espressif32.git#master board = wemos_d1_mini32 board_upload.flash_size = 4MB board_build.partitions = no_ota.csv board_build.filesystem = littlefs board_build.flash_mode = qio framework = arduino monitor_filters = esp32_exception_decoder lib_deps = h2zero/NimBLE-Arduino thijse/ArduinoLog ottowinter/ESPAsyncWebServer-esphome platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32#master build_flags = -std=c++2a -std=gnu++2a -O2 build_unflags = -std=gnu++11 -ggdb -Os

Thanks!

Abasz commented 1 year ago

Hi, did you Upload the Filesystem image?

I recommend Erase Flash if you start out fresh first and then Upload the Filesystem image.

wyattwww commented 1 year ago

First, I'm new to platformio... figuring it out as I go.

I hadn't uploaded the Filesystem Image. When I tried to build it in VSCode/platformio I get this error output:

Processing esp32 (platform: https://github.com/platformio/platform-espressif32.git#master; board: wemos_d1_mini32; framework: arduino)

Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/wemos_d1_mini32.html PLATFORM: Espressif 32 (6.3.2+sha.eb7eba4) > WEMOS D1 MINI ESP32 HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa) PACKAGES:

Erasing the flash was successful, but had no effect on building or uploading the Filesystem Image. What steps am I missing?

Thanks!

Abasz commented 1 year ago

That is completely alright, I will try to help :)

Have you actually do this step from this repo: https://github.com/Abasz/ESPRowingMonitor-WebGUI

  1. Copy the files under the dist/esp-rowing-monitor-client to the ESP Rowing Monitor project folder data/www folder

I think you might have missed the data folder that is by default the source directory for platformio when making the system image. Its not checked into source control. Actually, my aim with the documentation was that if someone wants wesocket they will open the other repo with the UI :D If this issue is solved by this data folder, then I will make some changes to the documentation to make this clear.

Abasz commented 1 year ago

Did this issue get solved?

Also, please note that I had to make some tweaks to the slope-of-slope detection method due to the realization from the kayak ergo that does not have enough recovery data points. This could in some cases potentially impact the MINIMUM_RECOVERY_SLOPE_MARGIN setting...

I am not sure how far you have progressed with tweaking the settings but could be relevant. If you dont use TORQUE (or BOTH) detection method then this is not relevant.

wyattwww commented 1 year ago

Yes, building ESPRowingMonitor-WebGUI to get the data folder was the missing step, thank you!

I'll start experimenting with some settings soon and will let you know. Thank you!