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

WiFi Manager Integration #38

Closed
wants to merge 35 commits into from

Conversation

jfujitani
Copy link

@jfujitani jfujitani commented Jul 8, 2023

Add support for allowing uses to change WIFI networks without creating a new build and uploading it to their board.

Addresses this request: by integrating this WiFiManager

After these changes, the void setup() loop will check if the configured pin (27 is coded in config.cpp) if pulled down, the device will enter AP config mode.

platformio/platformio.ini Outdated Show resolved Hide resolved
@jfujitani jfujitani marked this pull request as ready for review July 8, 2023 14:20
@lmarzen
Copy link
Owner

lmarzen commented Jul 13, 2023

Hi John,

I haven't forgotten about this. I have been distracted by other things lately.

Could you make using this feature optional so that you can perform the setup either with the wifi manager or at compile time?
Or preferably, make it so it uses the ssid/password from the config file for the initial setup but it could be changed later using the wifi manager.

I frequently reflash my weather display while working on this project and it is very convenient for me to have my settings remembered.

-Luke

@jfujitani
Copy link
Author

Hi John,

I haven't forgotten about this. I have been distracted by other things lately.

Could you make using this feature optional so that you can perform the setup either with the wifi manager or at compile time? Or preferably, make it so it uses the ssid/password from the config file for the initial setup but it could be changed later using the wifi manager.

I frequently reflash my weather display while working on this project and it is very convenient for me to have my settings remembered.

-Luke

Hi @lmarzen (Luke),
Sorry for the delayed response. I was out of town. Unfortunately I won't have a lot of time for this as I play catch-up at work.

HOWEVER, I would like to find some time to work on it. Given I will be short on time let's discuss implementation before investing time in the code.

I was thinking of doing something like this:

if (!previously connected to a network) { 
  connect_using_compiled_configs()
  if (connected) {
    set previously connected to a network to true
  }
} else {
  connect using WiFi Manager
}

previously connected to a network could probably be represented by a marker file or something. Let me know if you have suggestions or preference.

In addition to the above logic reset the previously connected value/flag when the button is held down during a reboot. This way you can hold the button while resetting to clear the flag then reset again to connect using compiled configs.

@lmarzen
Copy link
Owner

lmarzen commented Jul 18, 2023

That logic looks good to me :)

@lmarzen
Copy link
Owner

lmarzen commented Jul 18, 2023

previously connected to a network could probably be represented by a marker file or something. Let me know if you have suggestions or preference.

I have used a library in this project called preferences which is a relatively simple way to allow you to store primitive data types in the nonvolatile storage of the esp32. See how I used it for some of the critically low battery logic in main.cpp.

@jfujitani
Copy link
Author

Just an update it will probably be a few weeks before I get back to this, unless I find time at night.

@jfujitani
Copy link
Author

@lmarzen I found some time to knock out a first pass of this but, not much time for testing so do beware I've only tested happy path use cases and at a very limited level of attention to detail.

-John

@jfujitani
Copy link
Author

jfujitani commented Nov 11, 2023

Hi @lmarzen,
I've been running with these changes for a while now. I've switched wifi credentials a number of times, using the feature, and have not encountered any issues. Let me know if you're still interested in integrating the changes.

Thanks,
-John

@lmarzen
Copy link
Owner

lmarzen commented Nov 12, 2023

Hey John,

This is a feature I am interested in. I have had a busy semester of grad school and have not been able to keep up with maintaining this project as much as I would like. I've been meaning to update some documentation to include information about the new waveshare driver board and I plan to add documentation for this feature at the same time and merge it. I have a break for thanksgiving and I might get around to merging the feature then, however I may get busy with the holidays. If it doesn't happen later this month I will get around to it after the semester ends, sometime in December.

Thanks for your patience. I sincerely apologize for the long wait.

-Luke

@jfujitani
Copy link
Author

Hi @lmarzen,

There's absolutely no need to apologize. I anticipate I may also have some time during the November or December holidays and will hopefully available for support should it be needed.

Good luck with your studies,
-John

@lmarzen
Copy link
Owner

lmarzen commented Nov 12, 2023

I just saw that you added a section to the readme. Thanks for that!

@lmarzen
Copy link
Owner

lmarzen commented Nov 18, 2023

@jfujitani I'm fully on board with this idea. I want to expand this to enable the entire project to be configured this way. We would save most of the settings to the flash. It may take me a little bit because this will require some major refactoring. I have had many people request a more user friendly way to change settings so that family members and friends can configure it without needing to compile code.

@jfujitani
Copy link
Author

@jfujitani I'm fully on board with this idea. I want to expand this to enable the entire project to be configured this way. We would save most of the settings to the flash. It may take me a little bit because this will require some major refactoring. I have had many people request a more user friendly way to change settings so that family members and friends can configure it without needing to compile code.

@lmarzen
This sounds good to me.

@lmarzen
Copy link
Owner

lmarzen commented Dec 23, 2023

I finished up with school for the year about a week ago (just graduated with my BS in Computer Science.. yay). I have spent some time reworking the code so that most of the options can be controlled via wifi manager. Hoping to get this finished before the new year. This is a pretty large change and I am also reworking the documentation since the configuration is effectively moving entirely to wifi manager. For those who do not wish to use wifi manager, default options can still be set at compile time and first time setup can be disabled. I have spent time earlier last week addressing some other issues in the backlog and wifi manager is now the first in line.

@jfujitani
Copy link
Author

@lmarzen congratulations on your graduation!!!

Nothing really to add here, expect that I'm looking forward to seeing the changes.

-John

@lmarzen
Copy link
Owner

lmarzen commented Dec 25, 2023

I've added a handful of settings with nice dropdowns and a bunch of custom html, but WiFi Manager is failing to send the configuration page once I add the settings for only half of the settings I want to add. I may move away from WiFi Manager and towards an entirely custom solution. This may delay this feature a little longer yet, but I will continue to provide semi-regular updates here.

@jfujitani
Copy link
Author

Hi @lmarzen,
Sorry to hear WiFiManager caused you issues with your PoC work.
One the bight side, a few weeks ago they tagged a version that is labeled as a release (no longer post-fixed with "rc"). It looks to be about a year since the last tag in git and has a long list of release notes. They still haven't address their discovery-ability or integration with platformio from what I can tell. Only a very old version shows up in platformio gui. I haven't tested the other issue where just the act of adding it to a new project causing build errors until one of your source files uses one of their headers. (not worth the time).

I'm not sure if any of the issues you were having were resolved but, I'm at leaste glad to see that it's not abandoned.

I will try to check in periodically and update my proposed changes. Weather you eventually integrate this library or go a custom route, I'll help out if I can.

-John

@lmarzen
Copy link
Owner

lmarzen commented Apr 29, 2024

Hi @jfujitani,

I'm leaning towards closing this PR. I am still interested in integrating WiFi Manager (or something like it), but am aiming for a much more comprehensive solution. The goal is to make it so that average people can configure the display via their phone. This includes on screen instructions and enables the user to scan a QR code to automatically join a password protected network created by the esp32. I am aiming to make most settings configurable through this interface including timezones. WiFi Manager has a number of limitations and I am working on moving away from it entirely (this is a lot of work).

Given that my local changes go far beyond the scope of this PR and are no longer based off your changes I think it makes sense to close this PR. Maybe I should open an issue so there is a place to further discuss ideas around this topic?

Regards,

Luke

@lmarzen lmarzen closed this Apr 30, 2024
@jfujitani
Copy link
Author

Hi @jfujitani,

I'm leaning towards closing this PR. I am still interested in integrating WiFi Manager (or something like it), but am aiming for a much more comprehensive solution. The goal is to make it so that average people can configure the display via their phone. This includes on screen instructions and enables the user to scan a QR code to automatically join a password protected network created by the esp32. I am aiming to make most settings configurable through this interface including timezones. WiFi Manager has a number of limitations and I am working on moving away from it entirely (this is a lot of work).

Given that my local changes go far beyond the scope of this PR and are no longer based off your changes I think it makes sense to close this PR. Maybe I should open an issue so there is a place to further discuss ideas around this topic?

Regards,

Luke

That sounds good to me. I've mainly keep the PR up to date as I run a few stations with the changes here. I would gladly switch over to a more full featured and purpose built branch though if you were to implement something. I have no issues with this closing out.

@lmarzen
Copy link
Owner

lmarzen commented May 5, 2024

Thanks for understanding. I'll keep you updated when I have something to show.

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

Successfully merging this pull request may close these issues.

2 participants