Skip to content

Commit 2d7aab9

Browse files
authored
Update esp_atcontrol_simpletest.py
1 parent 59f2c35 commit 2d7aab9

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

examples/esp_atcontrol_simpletest.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
except ImportError:
1717
print("WiFi secrets are kept in secrets.py, please add them there!")
1818
raise
19-
19+
# Debug Level
20+
# Change the Debug Flag if you have issues with AT commands
21+
debugflag=False
2022

2123
if board.board_id == "challenger_rp2040_wifi":
2224
RX = board.ESP_RX
@@ -39,9 +41,9 @@
3941

4042

4143
print("ESP AT commands")
42-
# I had to remove the rtspin from the esp bellow to get the challenger_rp2040_wifi to work.
44+
# For Boards that do not have an rtspin like challenger_rp2040_wifi set rtspin to False.
4345
esp = adafruit_espatcontrol.ESP_ATcontrol(
44-
uart, 115200, reset_pin=resetpin, rts_pin=rtspin, debug=False
46+
uart, 115200, reset_pin=resetpin, rts_pin=rtspin, debug=debugflag
4547
)
4648
print("Resetting ESP module")
4749
esp.hard_reset()
@@ -50,10 +52,11 @@
5052
while True:
5153
try:
5254
if first_pass:
53-
# I had to comment out scanning for APs as that did not work
54-
# print("Scanning for AP's")
55-
# for ap in esp.scan_APs():
56-
# print(ap)
55+
# Some ESP do not return OK on AP Scan. See https://github.com/adafruit/Adafruit_CircuitPython_ESP_ATcontrol/issues/48
56+
# disable next 3 lines if you get a No OK response to AT+CWLAP
57+
print("Scanning for AP's")
58+
for ap in esp.scan_APs():
59+
print(ap)
5760
print("Checking connection...")
5861
# secrets dictionary must contain 'ssid' and 'password' at a minimum
5962
print("Connecting...")

0 commit comments

Comments
 (0)