Skip to content

Commit 7cfeca6

Browse files
authored
Update esp_atcontrol_simpletest.py
More changes with some comments on what's working and not. AP scan not working for me with challenger yet...
1 parent 821248f commit 7cfeca6

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

examples/esp_atcontrol_simpletest.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
print("WiFi secrets are kept in secrets.py, please add them there!")
1717
raise
1818

19-
# the default else is the Aragon settings. Add different inits for different boards.
19+
2020
if board.board_id == "challenger_rp2040_wifi":
2121
RX = board.ESP_TX
2222
TX = board.ESP_RX
2323
resetpin = DigitalInOut(board.WIFI_RESET)
24-
rtspin = DigitalInOut(board.ESP_CTS)
25-
uart = busio.UART(TX, RX, timeout=0.1)
26-
esp_boot = DigitalInOut(board.ESP_BOOT_MODE)
24+
# rtspin = DigitalInOut(board.ESP_CTS)
25+
uart = busio.UART(board.ESP_TX, board.ESP_RX, baudrate=11520)
26+
esp_boot = DigitalInOut(board.WIFI_MODE)
2727
esp_boot.direction = Direction.OUTPUT
2828
esp_boot.value = True
2929
else:
@@ -38,8 +38,9 @@
3838

3939

4040
print("ESP AT commands")
41+
# I had to remove the rtspin from the esp bellow to get the challenger_rp2040_wifi to work.
4142
esp = adafruit_espatcontrol.ESP_ATcontrol(
42-
uart, 115200, reset_pin=resetpin, rts_pin=rtspin, debug=False
43+
uart, 115200, reset_pin=resetpin, debug=False
4344
)
4445
print("Resetting ESP module")
4546
esp.hard_reset()
@@ -48,9 +49,10 @@
4849
while True:
4950
try:
5051
if first_pass:
51-
print("Scanning for AP's")
52-
for ap in esp.scan_APs():
53-
print(ap)
52+
# I had to comment out scanning for APs as that did not work
53+
# print("Scanning for AP's")
54+
# for ap in esp.scan_APs():
55+
# print(ap)
5456
print("Checking connection...")
5557
# secrets dictionary must contain 'ssid' and 'password' at a minimum
5658
print("Connecting...")

0 commit comments

Comments
 (0)