Skip to content

Commit a349bac

Browse files
committed
add protected and unprotected AP code snippets to wsgi server demo
1 parent 180ceaa commit a349bac

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

adafruit_esp32spi/adafruit_esp32spi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ def create_AP(self, ssid, password, channel=1, timeout=10): # pylint: disable=in
517517
"""
518518
if len(ssid) > 32:
519519
raise RuntimeError("ssid must be no more than 32 characters")
520-
if len(password) < 8 or len(password) < 64:
520+
if password and (len(password) < 8 or len(password) > 64):
521521
raise RuntimeError("password must be 8 - 63 characters")
522522
if channel < 1 or channel > 14:
523523
raise RuntimeError("channel must be between 1 and 14")

adafruit_esp32spi/adafruit_esp32spi_wifimanager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def create_ap(self):
154154
failure_count = 0
155155
self.reset()
156156
continue
157-
print("Access Point created! Connect to ssid: {}".format(self.ssid))
157+
print("Access Point created! Connect to ssid:\n {}".format(self.ssid))
158158

159159
def connect_enterprise(self):
160160
"""

examples/server/esp32spi_wsgiserver.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,20 @@
4545
# import adafruit_dotstar as dotstar
4646
# status_light = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=1)
4747

48-
## Connect to wifi with secrets
48+
## If you want to connect to wifi with secrets:
4949
wifi = wifimanager.ESPSPI_WiFiManager(esp, secrets, status_light)
5050
wifi.connect()
5151

52+
## If you want to create a WIFI hotspot to connect to with secrets:
53+
# secrets = {"ssid": "My ESP32 AP!", "password": "supersecret"}
54+
# wifi = wifimanager.ESPSPI_WiFiManager(esp, secrets, status_light)
55+
# wifi.create_ap()
56+
57+
## To you want to create an un-protected WIFI hotspot to connect to with secrets:"
58+
# secrets = {"ssid": "My ESP32 AP!"}
59+
# wifi = wifimanager.ESPSPI_WiFiManager(esp, secrets, status_light)
60+
# wifi.create_ap()
61+
5262
class SimpleWSGIApplication:
5363
"""
5464
An example of a simple WSGI Application that supports

0 commit comments

Comments
 (0)