Migrate code arduino to esphome

Hi,
i have many esp32 who have a pt100 and a amplifier MAX31865.
My temperature works.

I want to migrate these esp to esphome but i have many errors.

There is the working fonction :

void pt100()  {
  Serial.write("TEMP");
  int cs = 34;
  int di = 35;
  int doo = 32;
  int clk = 33;
  Adafruit_MAX31865 max = Adafruit_MAX31865(cs,di,doo,clk);
  max.begin(MAX31865_2WIRE);
  unsigned int rtd = max.readRTD();
  float ratio = rtd;
  ratio /= 32768;
  float resistance = RREF*ratio;
  float temp = max.temperature(RNOMINAL, RREF);
  Serial.println(temp);
  String tempstr = String(temp);
  server.send(200, "text/plain", tempstr);
}

And the yaml of esphome who not works :

esphome:
  name: chambre
  friendly_name: Chambre

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:
  logs:
    # Silence unrelated chatty components
    api: DEBUG
    api.connection: DEBUG
    api.service: DEBUG
    app: DEBUG
    scheduler: DEBUG
    sensor.filter: DEBUG
    sensor: DEBUG
# Enable Home Assistant API
api:
  encryption:
    key: xxx

ota:
  - platform: esphome
    password: xxx

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Chambre Fallback Hotspot"
    password: xxx

captive_portal:


# Example configuration entry
spi:
  miso_pin: 33
  mosi_pin: 25
  clk_pin: 26

sensor:
  - platform: max31865
    name: "Chambre Temperature"
    cs_pin: 32
    reference_resistance: 430 Ω
    rtd_nominal_resistance: 100 Ω
    rtd_wires: 2

There is the logs of esphome :

[18:59:18][W][max31865:018]: Overvoltage/undervoltage fault between measurements
[18:59:18][W][max31865:021]: RTDIN- < 0.85 x V_BIAS (FORCE- open) between measurements
[18:59:18][W][max31865:024]: REFIN- < 0.85 x V_BIAS (FORCE- open) between measurements
[18:59:18][W][max31865:027]: REFIN- > 0.85 x V_BIAS between measurements
[18:59:18][W][max31865:031]: RTD Low Threshold between measurements
[18:59:18][W][max31865:034]: RTD High Threshold between measurements
[18:59:18][E][max31865:051]: Fault detection incomplete (0xFF) after 6007μs (datasheet spec is 600μs max)! Aborting read.
[18:59:18][D][sensor:094]: 'Chambre Temperature': Sending state nan °C with 2 decimals of accuracy
[18:59:18][W][component:237]: Component max31865.sensor took a long time for an operation (62 ms).
[18:59:18][W][component:238]: Components should block for at most 30 ms.

If anyone have an idea
Thank you !

Your pins doesn’t seem to match.
I assume di and Doo is pins?

Also, if possible, I suggest to use default SPI pins:

di = mosi
do= miso

Yeah thanks i don’t know how it works with this SPI pins and not the others.

I’m pretty sure you can make it work with other pins as well, but it’s not worth the headache if you are free to use default pins.