Arduino ds3502 potentiometer

Hi Community,
I have a arduino ds3502 connected to a esp32 chip to control my ventilation in our house. This has been working flawlessly on firmware 2023.12.9 but today when i tried to update it to latest version of esphome i get this error:

[I][custom:030]: Setting wiper of <40> to <0>
[   261][E][Wire.cpp:411] beginTransmission(): Bus is in Slave Mode
Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x4016b1e8  PS      : 0x00060230  A0      : 0x8016afec  A1      : 0x3ffb23f0
A2      : 0x3ffb3368  A3      : 0x3ffb2475  A4      : 0x00000001  A5      : 0x00000001
A6      : 0x3ffb241e  A7      : 0x00000001  A8      : 0x006e6146  A9      : 0x3ffb23d0
A10     : 0x3f403382  A11     : 0x3ffb241e  A12     : 0x00000001  A13     : 0x00000038
A14     : 0x3ffb2450  A15     : 0x00000010  SAR     : 0x0000000b  EXCCAUSE: 0x0000001c
EXCVADDR: 0x006e6152  LBEG    : 0x4008a4a5  LEND    : 0x4008a4b5  LCOUNT  : 0xfffffffb


Backtrace:0x4016b1e5:0x3ffb23f00x4016afe9:0x3ffb2410 0x4016b073:0x3ffb2440 0x400eb779:0x3ffb2460 0x400e7f9d:0x3ffb24a0 0x400e7fc1:0x3ffb24c0 0x400e0231:0x3ffb24e0 0x400e0a96:0x3ffb2500 0x400e0cbd:0x3ffb2520 0x4017ea7d:0x3ffb2570 0x4017eb2d:0x3ffb2590 0x400e67b8:0x3ffb25b0 0x400eacbd:0x3ffb25e0 0x400f7326:0x3ffb2820

Is it anyone of you that had the same issue and where able to resolve it?

This is my configuration:

substitutions:
  ds3502_pin_sda: "GPIO18"
  ds3502_pin_scl: "GPIO19"
  ds3502_fan_name: "Fan"

esphome:
  libraries:
    - "Arduino"
    - "Wire"
    - "SPI"
    - "Adafruit BusIO"
    - "Adafruit DS3502"
  includes:
    - external_libraries/ds3502.h

i2c:
  - id: i2c_ds3502
    sda: ${ds3502_pin_sda}
    scl: ${ds3502_pin_scl}
    scan: false

i2c:
  - id: i2c_ds3502
    sda: ${ds3502_pin_sda}
    scl: ${ds3502_pin_scl}
    scan: false

fan:
  - platform: speed
    id: ds3502_fan
    output: ds3502_fan_output
    name: ${ds3502_fan_name}

output:
  - platform: custom
    type: float
    lambda: |-
      auto digipot = new DS3502_Component(0x28);
      App.register_component(digipot);
      return {digipot};
    outputs:
      - id: ds3502_fan_output

external_libraries/ds3502.h:

#include "esphome.h"
#include <Adafruit_DS3502.h>

#define WIPER_VALUE_PIN A0

class DS3502_Component : public Component, public FloatOutput
{
public:

    int I2C_Address;
    Adafruit_DS3502 ds3502;

    DS3502_Component(int address = DS3502_I2CADDR_DEFAULT) {
        I2C_Address = address;
        ds3502 = Adafruit_DS3502();
        ESP_LOGI("custom", "Initializing <%i>", I2C_Address);
    }

    void setup() override {
        if (!ds3502.begin(I2C_Address))
        {
            ESP_LOGI("custom", "<0x%X> Couldn't find DS3502 chip", I2C_Address);
            while (1);
        }
        ESP_LOGI("custom", "<0x%X> Found DS3502 chip", I2C_Address);
    }

    void write_state(float state) override {
        int mappedState = map(int(state*100), 0, 100, 0, 127);
        ESP_LOGI("custom", "Setting wiper of <%i> to <%i>", I2C_Address, mappedState);
        ds3502.setWiper(mappedState);
        int wiperValue = ds3502.getWiper();
        ESP_LOGI("custom", "--> Wiper value of <%i> is now <%i>", I2C_Address, wiperValue);
    }
};


When i configured it from beginning i followed this article: Issues running two custom I2C components (Adafruit DS3502)

Brg Robin

@robinostlund Robin did you manage to solve your problem?
I’m trying to use the same set-up to manage a set of fan-coils and I’m not able to compile with 2024.11.3. The issue is in the double inheritance of the class DS3502_Component. But I don’t have a solution

Unfortunately not, i am still running and old version or esphome on that device :pensive: