Force M5Stack-Fire board detection for ESP32

M5Stack-Fire board detection should be:

i2c0 = I2C(0, sda=Pin(21), scl=Pin(22)) 
if {0x68} <= set(i2c0.scan()): # IMU (MPU6886)
    return "m5stack-fire"

But there are some pin incompatibilities between ESP32 and ESP32-S3 boards that don't allow I2C scan.
This commit is contained in:
Antonio Cebrián
2026-02-07 17:28:56 +01:00
committed by GitHub
parent 033f4f54af
commit 1d9ba8f814
+1 -10
View File
@@ -31,16 +31,7 @@ def detect_board():
if sys.platform == "linux" or sys.platform == "darwin": # linux and macOS
return "linux"
elif sys.platform == "esp32":
from machine import Pin, I2C
i2c0 = I2C(0, sda=Pin(48), scl=Pin(47))
if {0x15, 0x6B} <= set(i2c0.scan()): # touch screen and IMU (at least, possibly more)
return "waveshare_esp32_s3_touch_lcd_2"
else:
i2c0 = I2C(0, sda=Pin(9), scl=Pin(18))
if {0x6B} <= set(i2c0.scan()): # IMU (plus possibly the Communicator's LANA TNY at 0x38)
return "fri3d_2024"
else: # if {0x6A} <= set(i2c0.scan()): # IMU (plus a few others, to be added later, but this should work)
return "fri3d_2026"
return "m5stack_fire"
board = detect_board()