Coder Social home page Coder Social logo

save-config-demo about configmanager HOT 7 CLOSED

nrwiersma avatar nrwiersma commented on July 22, 2024
save-config-demo

from configmanager.

Comments (7)

markvriens avatar markvriens commented on July 22, 2024

I had the same problem. I also had not deep-dive the code.

from configmanager.

nrwiersma avatar nrwiersma commented on July 22, 2024

Hi,

The minor issue I have with ConfigManager is on a new setup the contents of the eeprom is filled into the the fields in the setup screen. I haven't looked at the code yet, but it would be better to have empty text boxes on the first load.

The system has no concept of "first load". If your EEPROM is zeroed when flashing, then the values will be zeroed out. To try and change behaviour for first load would just make things more complex, as we would need to keep track of the state of the device. If it was desired not to read config that had not yet been written, it would be possible to add config magic bytes. When reading, if the bytes are not seen, it would not bother reading the config. This would allow for "default" config to be set on startup.

Typing new values into the line does not get rid of the remainder of the line.

Could you explain this more, I dont understand the issue here. Are you talking in the browser?

Confirmation would be nice

The confirmation is the 204 response.

Thanks,
Nick

from configmanager.

RudyFiero avatar RudyFiero commented on July 22, 2024

web-config

I did an erase of all flash and I then got what is shown in the image above. If the contents of the EEPROM area is filled with FF (erased) would that not give you a concept of "first load".

When I entered the new values into the form, the entered data wrote into those character positions but the remainder of the line was still filled with the ? image. In the above form, I had to delete a lot of the characters there to get an empty line.

If this was meant to be just for myself then I wouldn't have a problem with the quirks. But whatever I develop, I want to be able to give this to 'normal' people.

from configmanager.

nrwiersma avatar nrwiersma commented on July 22, 2024

The issue here is that you are erasing with FF and not 00. With strings in C, they are 00 terminated, so if you erase with 00 it will auto terminate the string. I kinda assumed erasing with 00 was standard.

from configmanager.

RudyFiero avatar RudyFiero commented on July 22, 2024

When I start with a clean slate, select erase "all flash contents" in the menu, any not initialized location will have FF in it. When you perform an erase on a memory block the erased state is all ones, FF. When you write some data what is happening is the appropriate bits are made to be zeros.

With strings in C, they are 00 terminated,

Then should the structure be initialized with 00 ?

Anyway, while there can be improvements, this is a good starting point for me. Thanks

from configmanager.

cgmckeever avatar cgmckeever commented on July 22, 2024

@RudyFiero FWIW in the latest release there is a clearSettings call which should (maybe) initialize the memory that is handled more consistently per this discussion

from configmanager.

RudyFiero avatar RudyFiero commented on July 22, 2024

Great! I will give it a try as soon as I can.

from configmanager.

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.