Thank you for taking the time to resolve my problem.
I followed the instructions to the letter and still get the same result. Here are the console outputs:
A) ESP32 firmware update. I reloaded the update-bootloader-metro_m4_airlift-v3.13.0.uf2 file.
Code: Select all
UF2 Bootloader v3.13.0 SFHWRO
Model: Metro M4 AirLift
Board-ID: SAMD51J19A-Metro-AirLift-v0
For updating with nina-fw 1.7.4. I used Metro_M4_WiFi_ESP32_Passthru.UF2 for a Metro M4 Airlift Lite. Here the process goes sour. My mini controller plays dead! No LED lights up. Nothing! I then continue with esptool.py and the NINA_W102-1.7.4.bin file with the Metro M4 in BOOT mode. I then get the following message:
Code: Select all
lun jui 26 $ esptool.py --port /dev/ttyACM0 --before no_reset --baud 115200 write_flash 0 NINA_W102-1.7.4.bin
esptool.py v3.1
Serial port /dev/ttyACM0
WARNING: Pre-connection option "no_reset" was selected. Connection may fail if the chip is not in bootloader or flasher stub mode.
Connecting........_____....._____....._____....._____....._____....._____....._____
A fatal error occurred: Failed to connect to Espressif device: Timed out waiting for packet header
On the other hand, if I exit BOOT mode, then the update seems to be done and I get.
Code: Select all
lun jui 26$ esptool.py --port /dev/ttyACM0 --before no_reset --baud 115200 write_flash 0 NINA_W102-1.7.4.bin
esptool.py v3.1
Serial port /dev/ttyACM0
WARNING: Pre-connection option "no_reset" was selected. Connection may fail if the chip is not in bootloader or flasher stub mode.
Connecting........__
Detecting chip type... ESP32
Chip is ESP32-D0WD-V3 (revision 3)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: ac:67:b2:77:34:3c
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00000000 to 0x0011afff...
Compressed 1159168 bytes to 633594...
Wrote 1159168 bytes (633594 compressed) at 0x00000000 in 56.1 seconds (effective 165.4 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
But, CircuitPython is erased and I have to reinstall it. Once reinstalled, I find my code.py file intact with the following code (the proposed test).
Code: Select all
# ble_test.py
import board
from lib.adafruit_ble import BLERadio
from lib.adafruit_ble.advertising.standard import ProvideServicesAdvertisement
from lib.adafruit_ble.services.nordic import UARTService
from lib.adafruit_airlift.esp32 import ESP32
# If you are using a Metro M4 Airlift Lite, PyPortal,
# or MatrixPortal, you can use the default pin settings.
# Leave this DEFAULT line uncommented.
# esp32 = ESP32() # DEFAULT
# If you are using CircuitPython 6.0.0 or earlier,
# on PyPortal and PyPortal Titano only, use the pin settings
# below. Comment out the DEFAULT line above and uncomment
# the line below. For CircuitPython 6.1.0, the pin names
# have changed for these boards, and the DEFAULT line
# above is correct.
esp32 = ESP32(tx=board.TX, rx=board.RX)
# If you are using an AirLift FeatherWing or AirLift Bitsy Add-On,
# use the pin settings below. Comment out the DEFAULT line above
# and uncomment the lines below.
# If you are using an AirLift Breakout, check that these
# choices match the wiring to your microcontroller board,
# or change them as appropriate.
# esp32 = ESP32(
# reset=board.D12,
# gpio0=board.D10,
# busy=board.D11,
# chip_select=board.D13,
# tx=board.TX,
# rx=board.RX,
# )
# If you are using an AirLift Shield,
# use the pin settings below. Comment out the DEFAULT line above
# and uncomment the lines below.
# esp32 = ESP32(
# reset=board.D5,
# gpio0=board.D6,
# busy=board.D7,
# chip_select=board.D10,
# tx=board.TX,
# rx=board.RX,
# )
adapter = esp32.start_bluetooth()
ble = BLERadio(adapter)
uart = UARTService()
advertisement = ProvideServicesAdvertisement(uart)
while True:
ble.start_advertising(advertisement)
print("waiting to connect")
while not ble.connected:
pass
print("connected: trying to read input")
while ble.connected:
# Returns b'' if nothing was read.
one_byte = uart.read(1)
if one_byte:
print(one_byte)
uart.write(one_byte)
And there I get the error message:
Code: Select all
Traceback (appels les plus récents en dernier) :
Fichier "code.py", ligne 51, dans <module>
Fichier "adafruit_airlift/esp32.py", ligne 178, dans start_bluetooth
Fichier "adafruit_airlift/esp32.py", ligne 137, dans reset
RuntimeError: ESP32 did not respond with a startup message
Cordially