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

added support for wifi AP mode to class Wifi #65

Merged
merged 13 commits into from
Aug 23, 2019
Merged

added support for wifi AP mode to class Wifi #65

merged 13 commits into from
Aug 23, 2019

Conversation

squonk11
Copy link
Contributor

added support for wifi AP mode to class Wifi.
In order to use the AP mode the command wifi.connect_to_ap(); must be replaced by wifi.start_softap();. As default only one client is allowed to connect to the AP. If more clients should be allowed wifi.set_softap_max_connections(x); can be used before starting the AP.

@PerMalmberg
Copy link
Owner

@squonk11
Copy link
Contributor Author

It is already enabled.

@PerMalmberg
Copy link
Owner

PerMalmberg commented Aug 21, 2019

It won't let me push to your branch/repo, not authorized even though the instructions above state that's where to push to. Anyway, I pushed my changes to a branch in my repo. I've mainly just C++-ifyied the code. I also removed logging the password and instead print the auth mode.

I think a test project for AP-mode is in order before merging. A static web page served by the HTTP server will do.

@PerMalmberg
Copy link
Owner

Weird, now I could push to your PR. Anyhow, have a look.

@squonk11
Copy link
Contributor Author

I just checked your c++ifying - for me it is very interesting to see how this has been done - thank you for that. And of course: these changes are o.k. for me.
I hope that I will be able to setup a simple test project this evening. If not then during the next days.

@PerMalmberg
Copy link
Owner

thank you for that

Happy to teach :)

I hope that I will be able to setup a simple test project this evening. If not then during the next days.

Ok, I'll let you have a go at it. I suggest you copy the http_server example and remove things you don't need. Just remember to rename the files and namespace - the folder name must be the same as the namespace the code is in.

@squonk11
Copy link
Contributor Author

Using the http_server example and removing everything not urgently necessary was also my plan. Here I also wanted to remove the template_data_retriever and passing NULL to the HTTPServerConfig in this place. Unfortunately this doesn't work - there is an error message during compilation. Is there a way to define a Http Server without using the template engine?
Probably I will not finish with this example today but I hope I can shift it to the PR tomorrow.

@PerMalmberg
Copy link
Owner

If you update your branch from upstream, you can now pass nullptr as the template_data_retriever argument. It previously required a reference so it didn't work without one being passed in.

@squonk11
Copy link
Contributor Author

now I pushed the test "http_server_ap_test". I had some trouble cross-resolving between local, remote and upstream. I hope now it is o.k.

@PerMalmberg
Copy link
Owner

I made some adjustments:

  • No need to specify app_main in the test its generated for you. (how did you build this, I get compilation errors if I leave it in?)
  • Renamed the test to access_point as that is what is being tested, not the http-server.

It works nicely :)

I can accept this PR as-is, do you have any additional changed you want to make?

@squonk11
Copy link
Contributor Author

squonk11 commented Aug 23, 2019

currently I don't have any further changes.
I am building with the build system from esp-idf under Windows since I was having problems with the build system you are using. Here I need to explicitly define a main() function.
Then let's hope that the bug in wifi will be fixed soon...

@PerMalmberg
Copy link
Owner

I am building with the build system from esp-idf under Windows since I was having problems with the build system you are using. Here I need to explicitly define a main() function.

Hm, that's odd, especially since I've reworked the build system according to the one IDF uses. You should be able to open the root folder/root CMakeList as a project. Anyway, I'll merge this now. Thank you for your contribution.

@squonk11
Copy link
Contributor Author

Now I understood your question concerning additional changes. I thought this question was related to changes on the support for AP - but probably it was related to additional changes/additions to the Smooth repository?
There are a few things I would need in future:

  • support for NVS memory in order to store some key/value pairs (maybe I could try to do this also?)
  • support for bluetooth SPP profile (maybe this is not best suited for your library)
  • ...

@PerMalmberg
Copy link
Owner

It was mainly about the AP-changes. Please continue discussions re. other items in separate threads.

@squonk11 squonk11 deleted the wifiap branch August 24, 2019 15:17
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