-
Notifications
You must be signed in to change notification settings - Fork 74
Adding WPA2 Enterprise support to the WiFi manager library #45
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
Merged
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
8e65459
Chunk buffer sends into 64 byte chunks
martymcguire 9cade63
rm temp vars. replace buffer slice w/ memoryview.
martymcguire 79425a6
Fixed infinite loop when socket readline fails
ZachNo bf54a08
Update adafruit_esp32spi/adafruit_esp32spi_socket.py
ZachNo 7386534
Adding WPA2 Enterprise support to the WiFi manager library
docmollo d8f4ad2
Added an enum-like class for the WiFi connection type and refactored …
docmollo 8e2b787
Replaced enum-like class with 2 constants; various fix-ups based on P…
docmollo ac4aee5
Merge pull request #42 from ZachNo/socket_hang_fix
ladyada c25157e
Make timeout a keyword argument
anecdata 868dd5e
Merge pull request #50 from anecdata/master
makermelissa 4df8144
add first mock api, blinks!
7772894
add valid pin tupleset check before initialization, raise error
00e7f97
drop all pull functionality since we dont have it defined in adafruit…
5e97cb1
add switch_to_x methods, docstrings
6a0c036
pylinting - 8.79/10, look at drivemode/direction classes...
4923344
checking in digitalio, ready
8599c01
add credit to where credit is due :)
e199972
Merge pull request #51 from brentru/mock-pwmout-digitalio
brentru 6fcb231
Adding pwmout back in
64ca443
correct pin in attrerror, fixup docstrings
c916224
set freq
596b879
frequency should return, not raise
46b4dea
Merge pull request #52 from brentru/add-pwmout-implementation
brentru d21b709
add an externally defined rgbled status_led to _wifimanager
aeae91e
test the pixel attributes within pixel_status
92182ea
Merge pull request #53 from brentru/expose-rgbled-status-wifimanager
ladyada 0d7c5b5
Adding WPA2 Enterprise support to the WiFi manager library
docmollo 15ea3cc
Added an enum-like class for the WiFi connection type and refactored …
docmollo 1eca01c
Replaced enum-like class with 2 constants; various fix-ups based on P…
docmollo 1ff8edf
Refactored wifimanager connect function into 3 separate functions; re…
docmollo e01c762
fixing merge conflicts
docmollo 4190bc3
fix the failure_count issue...sorry about that!
docmollo 54bcb5a
make ._esp public
a23026d
Merge pull request #60 from brentru/make-esp-object-public
brentru 8f964cc
Merge pull request #29 from martymcguire/mm-chunk-socket-sends
siddacious 1e77ef5
merged conflicts
docmollo a492dda
merged conflicts
docmollo bce6bfa
merged conflicts
docmollo cbc7901
merged conflicts
docmollo 447955a
merged conflicts
docmollo 0c07ceb
merged conflicts
docmollo 5931c1b
merged conflicts
docmollo 7bc0ec6
merged conflicts
docmollo bb679e8
fix a regression due to the rebase'ing...
docmollo 5c7a735
more fix-ups from rebase; fixed param defs in __init__
docmollo c89d13e
fixing more issues
docmollo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
# The MIT License (MIT) | ||
# | ||
# Copyright (c) 2019 Brent Rubell for Adafruit Industries | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in | ||
# all copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
# THE SOFTWARE. | ||
""" | ||
`PWMOut` | ||
============================== | ||
PWMOut CircuitPython API for ESP32SPI. | ||
|
||
* Author(s): Brent Rubell | ||
""" | ||
|
||
class PWMOut(): | ||
""" | ||
Implementation of CircuitPython PWMOut for ESP32SPI. | ||
|
||
:param int esp_pin: Valid ESP32 GPIO Pin, predefined in ESP32_GPIO_PINS. | ||
:param ESP_SPIcontrol esp: The ESP object we are using. | ||
:param int duty_cycle: The fraction of each pulse which is high, 16-bit. | ||
:param int frequency: The target frequency in Hertz (32-bit). | ||
:param bool variable_frequency: True if the frequency will change over time. | ||
""" | ||
ESP32_PWM_PINS = set([0, 1, 2, 4, 5, | ||
12, 13, 14, 15, | ||
16, 17, 18, 19, | ||
21, 22, 23, 25, | ||
26, 27, 32, 33]) | ||
def __init__(self, esp, pwm_pin, *, frequency=500, duty_cycle=0, variable_frequency=False): | ||
if pwm_pin in self.ESP32_PWM_PINS: | ||
self._pwm_pin = pwm_pin | ||
else: | ||
raise AttributeError("Pin %d is not a valid ESP32 GPIO Pin."%pwm_pin) | ||
self._esp = esp | ||
self._duty_cycle = duty_cycle | ||
self._freq = frequency | ||
self._var_freq = variable_frequency | ||
|
||
def __enter__(self): | ||
return self | ||
|
||
def __exit__(self, exc_type, exc_value, exc_traceback): | ||
self.deinit() | ||
|
||
def deinit(self): | ||
"""De-initalize the PWMOut object.""" | ||
self._duty_cycle = 0 | ||
self._freq = 0 | ||
self._pwm_pin = None | ||
|
||
def _is_deinited(self): | ||
"""Checks if PWMOut object has been previously de-initalized""" | ||
if self._pwm_pin is None: | ||
raise ValueError("PWMOut Object has been deinitialized and can no longer " | ||
"be used. Create a new PWMOut object.") | ||
|
||
@property | ||
def duty_cycle(self): | ||
"""Returns the PWMOut object's duty cycle as a | ||
ratio from 0.0 to 1.0.""" | ||
self._is_deinited() | ||
return self._duty_cycle | ||
|
||
@duty_cycle.setter | ||
def duty_cycle(self, duty_cycle): | ||
"""Sets the PWMOut duty cycle. | ||
:param float duty_cycle: Between 0.0 (low) and 1.0 (high). | ||
:param int duty_cycle: Between 0 (low) and 1 (high). | ||
""" | ||
self._is_deinited() | ||
if not isinstance(duty_cycle, (int, float)): | ||
raise TypeError("Invalid duty_cycle, should be int or float.") | ||
duty_cycle /= 65535.0 | ||
if not 0.0 <= duty_cycle <= 1.0: | ||
raise ValueError("Invalid duty_cycle, should be between 0.0 and 1.0") | ||
self._esp.set_analog_write(self._pwm_pin, duty_cycle) | ||
|
||
@property | ||
def frequency(self): | ||
"""Returns the PWMOut object's frequency value.""" | ||
self._is_deinited() | ||
return self._freq | ||
|
||
@frequency.setter | ||
def frequency(self, freq): | ||
"""Sets the PWMOut object's frequency value. | ||
:param int freq: 32-bit value that dictates the PWM frequency in Hertz. | ||
NOTE: Only writeable when constructed with variable_Frequency=True. | ||
""" | ||
self._is_deinited() | ||
self._freq = freq | ||
raise NotImplementedError("PWMOut Frequency not implemented in ESP32SPI") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.