edrumulus icon indicating copy to clipboard operation
edrumulus copied to clipboard

EEPROM -> Preferences for ESP32

Open davy39 opened this issue 1 year ago • 11 comments

For ESP32 : implement Preferences for settings storage as it "should be considered as the replacement for the Arduino EEPROM library".

davy39 avatar Mar 03 '24 05:03 davy39

Thanks, I use to code with python... I guess I need to learn to define and type constants ! Is it OK now ?

davy39 avatar Mar 04 '24 12:03 davy39

Could you approve this workflow message @corrados ? Maybe these workflows approvals should be approved automatically?

afbeelding

thijstriemstra avatar Mar 04 '24 14:03 thijstriemstra

I changed something in the settings. So, hopefully now it works without the need for approval.

corrados avatar Mar 05 '24 15:03 corrados

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.

corrados avatar Mar 09 '24 09:03 corrados

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. These are problems you have if you support multiple different types of hardware. Testing and verifying can be a nightmare...

corrados avatar Mar 09 '24 09:03 corrados

You are using a different library than I did which may solve that issue.

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.

thijstriemstra avatar Mar 09 '24 11:03 thijstriemstra

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...

davy39 avatar Mar 09 '24 17:03 davy39

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

corrados avatar Mar 09 '24 17:03 corrados

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?

corrados avatar Apr 18 '24 18:04 corrados

Hi @corrados , Sorry, I didn't have much time to work with edrumulus yet. I only have a test hardware with 2 inputs. For now, I've tried in vain to adjust both resistors and parameters to work on my positional sensing issue #139. I hope I'll have more time to play with that next weeks. Did someone else try this Preferences fork ?

davy39 avatar Apr 18 '24 18:04 davy39

Sorry, I didn't have much time to work with edrumulus yet.

Absolutely no problem. Just wanted to check for updates. No hurry at all, just take your time :-)

corrados avatar Apr 19 '24 18:04 corrados

@thijstriemstra You approved this merge request. Does that mean that you have tested this code and are happy with the results?

corrados avatar May 23 '24 16:05 corrados

I'll integrate the code now. Thanks for the contribution.

corrados avatar Jun 07 '24 13:06 corrados