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

add littlefs explanation #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

playmiel
Copy link

I tried to use libssh with littlefs with some modification and it works pretty well (test with an esp32 wrover)
it would be necessary just to modify the examples

@ewpa
Copy link
Owner

ewpa commented Mar 14, 2023

Hello, thank you for your contribution. To be acceptable there would need to be some 'switch' so the invoker can decide if they wish to compile for spiffs or littlefs. There are other code changes present in the pull request that do not match the commit message. Please can you review this.

@playmiel
Copy link
Author

okay I'll start working on it

@playmiel playmiel changed the title spiffs to littlefs spiffs to littlefs and improve examples Apr 11, 2023
@playmiel
Copy link
Author

I will improve and make compatible the examples for littlefs maybe add some examples.
if possible i will add a new example for a port forwarding

@playmiel playmiel changed the title spiffs to littlefs and improve examples add littlefs and improve examples Apr 11, 2023
@ewpa
Copy link
Owner

ewpa commented Apr 12, 2023

I will wait while you work on this, then review. Please be careful about making platformio specific commits since Arduino is the main platform I use with this library.

@playmiel
Copy link
Author

oh ok I use platformio mainly, is there a way for arduino ide to have a global define like platformio ?

@ewpa
Copy link
Owner

ewpa commented Apr 16, 2023

Using arduino-cli you can use something like --build-property="compiler.cpp.extra_flags=$MYFLAGS". for the IDE you would want something more transparent -- probably in the boards.txt. I've looked through the boards and cannot find any official esp32 boards with littlefs partitioning. They have only SPIFFS, FATFS or none. So I do not think littlefs is supported in Arduino for esp32 unless you can direct me otherwise?

@playmiel
Copy link
Author

yes it is supported by the Arduino ide with this plugin https://github.com/me-no-dev/arduino-esp32fs-plugin and this one https://github.com/earlephilhower/mklittlefs/releases, I think it is still present the official esp32 because the end of the SPIFFS support is recent and it still works very well for a "simple" use of esp32. I will see how I could simplify the use of the littlefs with libssh for the arduino ide

@ewpa
Copy link
Owner

ewpa commented Apr 18, 2023

I found this official library which indicates littlefs uses the spiffs partition and mounts on VFS at a different location. So I believe the choice to use/format spiffs or littlefs should be down to the sketch/example and not the library.

ESP32-specific interfacing is in src/libssh_esp32_compat.c so this is the place to focus on. Below are the appropriate lines.

#ifndef LIBSSH_ESP32_COMPAT_HOMEDIR
#define LIBSSH_ESP32_COMPAT_HOMEDIR "/spiffs"
#endif

So, if you define LIBSSH_ESP32_COMPAT_HOMEDIR to "/littlefs" in PIO you could use littlefs versus spiffs without any library code change.

@playmiel
Copy link
Author

playmiel commented Apr 18, 2023

yep with this -DLIBSSH_ESP32_COMPAT_HOMEDIR=\"/littlefs\" it work

@ewpa
Copy link
Owner

ewpa commented Apr 20, 2023

Hi Denis, please could you squash all commits into a single commit, cleanup/remove unrelated changes, move README comments about PIO into a clear section lower in the README, and update commit message to follow this repository's standards, i.e. MD. I think the PR is now just a change to a single file?

@playmiel
Copy link
Author

hi, yes I will add before an example for port forwarding

@ewpa
Copy link
Owner

ewpa commented Apr 24, 2023

The example would be better in a new PR.

@playmiel
Copy link
Author

ok I will clean it up, it has file "contributing.md" to see repository's standards?

@playmiel playmiel changed the title add littlefs and improve examples add littlefs explanation Apr 25, 2023
@playmiel playmiel force-pushed the littlefs-for-libssh branch 2 times, most recently from ab93576 to d23d3dd Compare April 25, 2023 23:04
Update README to add explanation for using littlefs
@playmiel playmiel force-pushed the littlefs-for-libssh branch 3 times, most recently from 8193398 to 135ee54 Compare April 26, 2023 10:58
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

Successfully merging this pull request may close these issues.

2 participants