Skip to content
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

Save and load DHCP(esp8266+SPIFF) #107

Open
Pikokosan opened this issue Dec 17, 2016 · 2 comments
Open

Save and load DHCP(esp8266+SPIFF) #107

Pikokosan opened this issue Dec 17, 2016 · 2 comments

Comments

@Pikokosan
Copy link

so i was looking at the code and thought. "wouldn't it be cool to save and load dhcp on a esp8266 using SPIFF" i've just started looking into it but figured i'd put the bug in someone's ear on here to see if they wanted to implement it.

@Pikokosan Pikokosan changed the title Save and load DHCP Save and load DHCP(esp8266+SPIFF) Dec 17, 2016
@Avamander Avamander added the Hacktoberfest Hacktoberfest 2020 label Sep 19, 2020
@Avamander
Copy link
Member

Added this to the Hacktoberfest list of potential contributions.

Just to be clear what is expected from the feature:

  • It should be implemented in a way that it can be enabled (only) on the ESP32 and ESP8266 using an #define. Support for other platforms that have writable flash is not in the scope.

  • The table should be written periodically, the period should have a sane default, but it should be possible to change it.

  • The DHCP table should only be written when it has been changed since the last time. Just reaching the write interval shouldn't trigger a pointless write (that most likely blocks for a while).

  • The table should be read from flash during startup or when a function is called.

If someone else has any other ideas, suggestions, do comment them below and I'll maybe update the list above.

@2bndy5
Copy link
Member

2bndy5 commented Jul 10, 2021

The table should be written periodically, the period should have a sane default, but it should be possible to change it.

Internally,

  • saveDHCP() is called every time setAddress() is called (specifically for Linux).
    • setAddress() is called by loadDHCP() (specifically for Linux) and DHCP() (agnostic of platform).
      • loadDHCP() is only called by begin(). Meanwhile, DHCP() is meant to be called by the user application when appropriate.

As a result, I would expect this feature to also mandate any calls to saveDHCP() be made only from the user's application (when not running on Linux) for better control over wear and tear of non-volatile storage.

Research links

arduino.cc has a list of libraries devoted to data storage. Notice that these libraries are not architecturally universal. So, this feature may require a "RF24Mesh/utilities" folder to house each supported architecture's NVM implementation. Not to mention the extra dependencies for libs that don't come with the Arduino's default framework (the PlatformIO package should also be compensated similarly).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants