Open playmiel opened 1 year ago
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.
okay I'll start working on it
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
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.
oh ok I use platformio mainly, is there a way for arduino ide to have a global define like platformio ?
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?
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
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.
yep with this -DLIBSSH_ESP32_COMPAT_HOMEDIR=\"/littlefs\"
it work
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?
hi, yes I will add before an example for port forwarding
The example would be better in a new PR.
ok I will clean it up, it has file "contributing.md" to see repository's standards?
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