-
Notifications
You must be signed in to change notification settings - Fork 74
Add Access point mode #57
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
Conversation
- channel needed to be in hex byte format. - Add begining of a server example example program. - TODO: figure out why cannot create AP w/ passphrase
i think this is a solid start. for making little servers, a 'micro Flask' could be a good way to create the structure for responding to queries. maybe we want to split this into two PRs, one for AP and one for server? |
I think having 2 PRs is fine, one with AP, one with server. The only hesitation I have is that one isn't very useful w/out the other. Does this repo get a new release with every commit/PR, or is release cut manually when we think think its time? In that case, I'll make this branch and PR just for AP and take out the example code. I'll open a new branch and draft PR for server with what I have now and can continue working on fleshing that out more. |
we can make releases whenever. server is useful without AP (but agree AP is not useful without server) so lets do server first :) |
Good to know. Server PR still has a lot more work to go into it, but I think this PR should be ready to go whenever we want, just because it's a simpler and more understood. We can sit on it until Server PR is merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks promising (and something I'd use for a few of the CircuitPython IOT libraries!). Requesting a few changes..
@@ -409,6 +411,29 @@ def wifi_set_entenable(self): | |||
if resp[0][0] != 1: | |||
raise RuntimeError("Failed to enable enterprise mode") | |||
|
|||
def wifi_set_ap_network(self, ssid, channel): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to wifi_create_ap
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
decided to leave this the same to match the name of the command we send to the ESP32 FW.
Thanks for the feedback @brentru ! I'll try to address your suggestions tomorrow night, unfortunately the only time I have to work on project is in my free time (nights, weekends) and this week I have a bit going on on. |
@mscosti No rush - great work so far! |
@brentru Thanks for the review! I have updated to incorporate your feedback, and responded to some of them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one little nit pick about disabling the line length lint checker, and a question about the delay time for the timeout. I'll test in a bit.
I think this PR also has all currently requested changes made, and is ready for potential re-review. |
@mscosti Just tested this, I'd like to suggest some things before we merge:
|
…rt AP without internet
I fixed a bug, and added AP creation examples to the wsgi server demo code as options to use instead of connecting to wifi. I also modified the web application to no longer depend on externally hosted static assets, since if you're connected to the esp32 hotspot, you likely don't have a way for your device to download those assets from the internet unless your device has already cached them. Now it will work regardless. @brentru I haven't updated the method signature for The reason I think its better to use secrets is that the wifimanager class currently expects a secrets object to be passed to it, and every method in it uses that. If we took in kwargs, then there was no point in passing in secrets to the constructor. I thought about supporting some sort of dual mode where you could use kwargs or secrets, but it felt clunky to me. Curious what your thoughts are. |
@mscosti Had the chance to test this AM. Works great with each of the AP examples you provided.
I like how AP creation works in your example - especially since it's contained within the init. for
Agreed, the way you have it right now isn't clunky and we can always add a dual-mode in later. I'm going to merge this in and release, as you've made siddacious' requested changes too. Thank you for your patience with this PR. |
Updating https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground to 2.1.3 from 2.1.2: > Merge pull request adafruit/Adafruit_CircuitPython_CircuitPlayground#67 from dcbriccetti/gravity_pulls_pixel > Merge pull request adafruit/Adafruit_CircuitPython_CircuitPlayground#66 from jepler/audiocore Updating https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI to 1.8.0 from 1.7.0: > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#57 from mscosti/ap_mode
Todo