-
Notifications
You must be signed in to change notification settings - Fork 21
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
Huge thanks, and a request to cover saving parameters #29
Comments
Hi Peter, And thank you for your feedback. I'm glad I could bring you some interesting elements in the development of your project, which seems very promising. The tutorial is focused on the use of WebSockets and I don't plan to add what you ask. Nevertheless, to answer your question, there is a very simple library that perfectly answers your need. I mean the Preferences library. It is really easy to use, and there are many tutorials on the net to show you how to use it. The idea would be to collect the values of the parameters you want to save in a I think you will be able to use this library without any difficulty. Among the examples provided with the library, you can have a look at this one, which details the code needed to save a Good luck with your project. |
Hi Steph,
Many thanks for taking the time to reply.
I initially passed over the Preferences library, suspecting it was too
simple for my needs. However, despite learning more c++, I still
haven't a result. So your reccomendation is very welcome, particularly now
I know a little more,
Ironically, this morning I listened to an interview with Engineer Leidy
Klotz <https://hiddenbrain.org/podcast/do-less/>, who argues that sometimes
the best way forward involves removing, streamlining and simplifying things.
Many, many thanks
p[eterC
…On Sat, 11 Jun 2022 at 16:29, m1cr0lab ***@***.***> wrote:
Hi Peter,
And thank you for your feedback. I'm glad I could bring you some
interesting elements in the development of your project, which seems very
promising.
The tutorial is focused on the use of WebSockets and I don't plan to add
what you ask. Nevertheless, to answer your question, there is a very simple
library that perfectly answers your need. I mean the Preferences
<https://espressif-docs.readthedocs-hosted.com/projects/arduino-esp32/en/latest/api/preferences.html>
library. It is really easy to use, and there are many tutorials on the net
to show you how to use it. The idea would be to collect the values of the
parameters you want to save in a struct object, then use the putBytes()
method to save them, then getBytes() to read them back. The main
advantage of this process is that it preserves the saved data, even after
powering off or restarting the ESP32.
I think you will be able to use this library without any difficulty.
Among the examples provided with the library, you can have a look at this
one
<https://github.com/espressif/arduino-esp32/blob/master/libraries/Preferences/examples/Prefs2Struct/Prefs2Struct.ino>,
which details the code needed to save a struct object.
Good luck with your project.
Best regards,
Steph
—
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHGYEXK7RS2RGS6F3QF4NRLVOQW6JANCNFSM5X4646SA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
--
*Peter Cameron*
***@***.***
|
Hi Stéphane,
First, thank you for your clear and helpful tutorial. However, I'd like to see an additional chapter on how to save preferences. I'm working on a particular project where this would be useful, but I think the need is not uncommon.
I'm building a macro rail device with a camera on a platform, supported by rails and moved by a stepper motor. The camera approaches the subject in tiny steps, taking a new image each step. Later specialised software stitches the sharp bits from each image into one image with an incredible depth of field.
The hardware is built, and I used a tutorial similar to yours to create a web interface. I'm not a programmer but have a basic understanding of a couple of languages. I've integrated stepper functionality using ESP-FlexyStepper and remote control of the camera via Canon BLE Remote. It's not finished yet, but I have a working prototype.
About a dozen settings are needed, e.g. camera sensor, focal length, f-stop, the delay between steps, etc. Ideally, a user would save these between sessions. I think that a flexible system could be devised using JSON and SPIFFS, mainly since these are already part of the system.
I've researched SPIFFS and ArduinoJason, but following step by step doesn't give you the depth to extract principles and apply them creatively. Instead, I found articles covering saving parameters and others covering server communication but not an integrated combination of the two.
Would you be interested in writing this? I would be surprised if I'm the only one interested.
Having thought about it, these are the questions that it could answer.
FYI At the moment, the project is not a commercial. I intend to release it as open-source (Hardware, 3D printed and software). It would only be in the unlikely event it was popular that would I think about commercialising it.
Again, thank you for the article, it was very helpful
Kind regards
peterC
The text was updated successfully, but these errors were encountered: