|
16 | 16 | print("WiFi secrets are kept in secrets.py, please add them there!")
|
17 | 17 | raise
|
18 | 18 |
|
19 |
| -# the default else is the Aragon settings. Add different inits for different boards. |
| 19 | + |
20 | 20 | if board.board_id == "challenger_rp2040_wifi":
|
21 | 21 | RX = board.ESP_TX
|
22 | 22 | TX = board.ESP_RX
|
23 | 23 | 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) |
27 | 27 | esp_boot.direction = Direction.OUTPUT
|
28 | 28 | esp_boot.value = True
|
29 | 29 | else:
|
|
38 | 38 |
|
39 | 39 |
|
40 | 40 | print("ESP AT commands")
|
| 41 | +# I had to remove the rtspin from the esp bellow to get the challenger_rp2040_wifi to work. |
41 | 42 | esp = adafruit_espatcontrol.ESP_ATcontrol(
|
42 |
| - uart, 115200, reset_pin=resetpin, rts_pin=rtspin, debug=False |
| 43 | + uart, 115200, reset_pin=resetpin, debug=False |
43 | 44 | )
|
44 | 45 | print("Resetting ESP module")
|
45 | 46 | esp.hard_reset()
|
|
48 | 49 | while True:
|
49 | 50 | try:
|
50 | 51 | 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) |
54 | 56 | print("Checking connection...")
|
55 | 57 | # secrets dictionary must contain 'ssid' and 'password' at a minimum
|
56 | 58 | print("Connecting...")
|
|
0 commit comments