Summary
- Ports the MLX90640 thermal driver off Arduino
Wireonto the component's
ESPHomei2c::I2CBus, fixing the thermal camera on ESPHome 2026.x. The IDF
i2c backend never initialisesWire, so every MLX read failed (parameter
extraction returned-4) while the rest of the bus worked. - Reads use
write_readv()(atomic address-then-read). ESPHome's legacy
write(stop=false)+read()ignoresstopand issues two STOP-terminated
transactions, losing the MLX address pointer. - Reads are chunked (16 words / 32 bytes) — a single large EEPROM/frame
transfer stalls the IDF driver and trips the task watchdog (boot loop). - Drops the
<Wire.h>dependency entirely.
Test plan
./docker/esphome compile configs/test-atoms3u-sensors.yaml— green.- Flashed an AtomS3U: EEPROM extraction OK, frames read (768 valid pixels,
~24 °C avg), no-4, no watchdog resets; SCD4x + QMP6988 unaffected.
## Summary
- Ports the MLX90640 thermal driver off Arduino `Wire` onto the component's
ESPHome `i2c::I2CBus`, fixing the thermal camera on ESPHome 2026.x. The IDF
i2c backend never initialises `Wire`, so every MLX read failed (parameter
extraction returned `-4`) while the rest of the bus worked.
- Reads use `write_readv()` (atomic address-then-read). ESPHome's legacy
`write(stop=false)+read()` ignores `stop` and issues two STOP-terminated
transactions, losing the MLX address pointer.
- Reads are chunked (16 words / 32 bytes) — a single large EEPROM/frame
transfer stalls the IDF driver and trips the task watchdog (boot loop).
- Drops the `<Wire.h>` dependency entirely.
## Test plan
- `./docker/esphome compile configs/test-atoms3u-sensors.yaml` — green.
- Flashed an AtomS3U: EEPROM extraction OK, frames read (768 valid pixels,
~24 °C avg), no `-4`, no watchdog resets; SCD4x + QMP6988 unaffected.