Code Monkey home page Code Monkey logo

Comments (16)

Samuel-Oliveira-BR avatar Samuel-Oliveira-BR commented on July 17, 2024

One time more in the field.
But now without disconnect the device.
The device just stopped to work and after turn off and turn on the NVS was cleared.

from arduino-esp32.

atanisoft avatar atanisoft commented on July 17, 2024

Are you being sure to call preferences.end() after you modify things to ensure it is stored/committed to flash?

from arduino-esp32.

Xylopyrographer avatar Xylopyrographer commented on July 17, 2024

Couple of things:

  • The code posted is only part of the overall sketch? There is not shown the .begin() nor the .end() statements.
  • The code uses, for example, preferences.getUChar("configFabrica", 170); which in this form will return the default value you specify of 170 if there is an error when doing the getX(). If the Preferences namespace it not properly initialized or opened with a .begin() then this may appear like the NVS has issues.

All the getX() methods commit to NVS before returning so unless the device resets at that exact time they should be safe.

from arduino-esp32.

Samuel-Oliveira-BR avatar Samuel-Oliveira-BR commented on July 17, 2024

Are you being sure to call preferences.end() after you modify things to ensure it is stored/committed to flash?

Hi.
Thank you about your comment.
Yes. The end are in a function in the final.

from arduino-esp32.

Samuel-Oliveira-BR avatar Samuel-Oliveira-BR commented on July 17, 2024

Couple of things:

  • The code posted is only part of the overall sketch? There is not shown the .begin() nor the .end() statements.
  • The code uses, for example, preferences.getUChar("configFabrica", 170); which in this form will return the default value you specify of 170 if there is an error when doing the getX(). If the Preferences namespace it not properly initialized or opened with a .begin() then this may appear like the NVS has issues.

All the getX() methods commit to NVS before returning so unless the device resets at that exact time they should be safe.

Hi.
Thanks about your comment.
Yes is in the setup.

The problem heppening not in the first time when turn of the devie.
The problem start after some hours the device on or when turn on and turn of several times.

from arduino-esp32.

me-no-dev avatar me-no-dev commented on July 17, 2024

Any chance you can try with newer version? 2.0.17 or 3.0.1? 2.0.2 is really old (and all 2.0.x will be EOL next month).

from arduino-esp32.

Samuel-Oliveira-BR avatar Samuel-Oliveira-BR commented on July 17, 2024

Any chance you can try with newer version? 2.0.17 or 3.0.1? 2.0.2 is really old (and all 2.0.x will be EOL next month).

from arduino-esp32.

Samuel-Oliveira-BR avatar Samuel-Oliveira-BR commented on July 17, 2024

Any chance you can try with newer version? 2.0.17 or 3.0.1? 2.0.2 is really old (and all 2.0.x will be EOL next month).

Dear me-no-dev, sorry close your comment. The chat is new for me. But update the IDE is not the solution. I think the problem is with the hardware.

from arduino-esp32.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.