-
Notifications
You must be signed in to change notification settings - Fork 18
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
EEPROM -> Preferences for ESP32 #137
EEPROM -> Preferences for ESP32 #137
Conversation
edrumulus_hardware.h
Outdated
|
||
protected: | ||
int Fs; | ||
EEPROMClass eeprom_settings; | ||
Preferences preferences_settings; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe just call it settings
?
edrumulus_hardware.cpp
Outdated
@@ -226,8 +241,7 @@ void Edrumulus_hardware::setup ( const int conf_Fs, | |||
{ | |||
// set essential parameters | |||
Fs = conf_Fs; | |||
eeprom_settings.begin ( ( number_pads + 1 ) * MAX_NUM_SET_PER_PAD ); // "+ 1" for pad-independent global settings | |||
|
|||
preferences_settings.begin ( "Settings", false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
define Settings
string in a constant
Thanks, I use to code with python... I guess I need to learn to define and type constants ! |
Could you approve this workflow message @corrados ? Maybe these workflows approvals should be approved automatically? |
I changed something in the settings. So, hopefully now it works without the need for approval. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot test it at the moment but changes look ok to me.
Just to give you a bit of history regarding settings storage on the ESP32: As I pointed out, I already had an implementation ready for this which seemed to work perfectly. So, I used this for my Protoype 3 (HD-1) which I used regularly. I could play for days without any issues. Then suddenly, one pad did not work anymore. I thought that this would be an electrical contact issue of some sort and did investigating the hardware. This process took me hours and finally I found out that simply the MIDI note in the Edrumulus settings had suddenly changed to a different value. That caused that no sound came out of the headphones for this particular pad. So, in the end, it was not a hardware issue but a settings issue. That was very annoying for me (and would be for other Edrumulus users as well). Therefore, I am very cautious about settings storage on the ESP32. You are using a different library than I did which may solve that issue. But it may also be the case that internally in the library you now use, the same ESP functions are used which I used in the past. Therefore, before I merge this code, I need you (and maybe @thijstriemstra) to extensively test it over a couple of days (maybe even weeks) to really make sure that it works reliable. |
BTW, the problem I see here is that you are using it only on the ESP32-S3 but I saw the problems when I was testing it with the older ESP32. Therefore, it may work for the S3 but not for the old ESP32. |
The Preferences classes are part of official esp32 codebase (it's not a 3rd party library) and should be very stable (at least in my projects). It'll need some testing though. |
I agree, but I'm not yet with a setup that could be used daily for extensive tests... I'll need to build the hardware first, but for now I'm trying to make the algorithms work with my mps850 pads #138 . Not easy to understand how to tune each parameters... |
I would start with playing with the existing pad types. Maybe you find some which give you good results. But not only play with the pad types but also with threshold, sense, etc. parameters |
It's a while ago since you submitted this code. Have you had time to test it a lot? Did it work reliably for you? |
Hi @corrados , |
Absolutely no problem. Just wanted to check for updates. No hurry at all, just take your time :-) |
@thijstriemstra You approved this merge request. Does that mean that you have tested this code and are happy with the results? |
I'll integrate the code now. Thanks for the contribution. |
For ESP32 : implement Preferences for settings storage as it "should be considered as the replacement for the Arduino EEPROM library".