Sml sensors show no value after migration from esp8266 to esp32

Up until 2 hours ago I had two Hichi-TTL heads connected to an D1-mini (esp8266) supervising two electric meters.
Besides frequent reboots that setup work ok.

In hope of getting rid of the reboots I migrated the setup to an “D1-mini esp32”.
To do so I just copied the relevant yaml code from the 8266 to the esp32 and only changed the Rx Pins.

Data reception ist working:

[15:52:56][D][sml:078]: OBIS info:
[15:52:56][D][sml:084]:   (090149534b00045bab92) 129-129:199.130.3 [0x49534b]
[15:52:56][D][sml:084]:   (090149534b00045bab92) 1-0:0.0.9 [0x090149534b00045bab92]
[15:52:56][D][sml:084]:   (090149534b00045bab92) 1-0:1.8.0 [0x000000000ecccacb]
[15:52:56][D][sml:084]:   (090149534b00045bab92) 1-0:1.8.1 [0x000000000ecccacb]
[15:52:56][D][sml:084]:   (090149534b00045bab92) 1-0:1.8.2 [0x0000000000000000]
[15:52:56][D][sml:084]:   (090149534b00045bab92) 1-0:16.7.0 [0x000002ba]
[15:52:56][D][sml:084]:   (090149534b00045bab92) 129-129:199.130.5 [0x0064bb6cb5b19c2db25bd7c6b5c26d401e7dd48c564a2a27e808efa079e23942a78dccfaa572cf23fad8b8b9bfa3aeff]
[15:52:56][W][component:237]: Component sml took a long time for an operation (80 ms).
[15:52:56][W][component:238]: Components should block for at most 30 ms.
[15:52:56][D][sml:078]: OBIS info:
[15:52:56][D][sml:084]:   (090149534b0005101caf) 129-129:199.130.3 [0x49534b]
[15:52:56][D][sml:084]:   (090149534b0005101caf) 1-0:0.0.9 [0x090149534b0005101caf]
[15:52:56][D][sml:084]:   (090149534b0005101caf) 1-0:2.8.0 [0x0000000007c7ebd0]
[15:52:56][D][sml:084]:   (090149534b0005101caf) 1-0:2.8.1 [0x0000000007c7ebd0]
[15:52:56][D][sml:084]:   (090149534b0005101caf) 1-0:2.8.2 [0x0000000000000000]
[15:52:56][D][sml:084]:   (090149534b0005101caf) 1-0:16.7.0 [0xffffffc3]
[15:52:56][D][sml:084]:   (090149534b0005101caf) 129-129:199.130.5 [0xf0e58e8eecb454beb6cd77063c3909ff4115228029aaa75d6f3cb235443352efac8dbbfe2f547659f6e6e46515f64ff0]
[15:52:56][W][component:237]: Component sml took a long time for an operation (83 ms).
[15:52:56][W][component:238]: Components should block for at most 30 ms.

but what could be the reason for the data not being decoded?

edit:
the looks identical (besides the counter values) to an old log I saved on the 8266

OBIS info:
  (090149534b0005101caf) 129-129:199.130.3 [0x49534b]                
  (090149534b0005101caf) 1-0:0.0.9 [0x090149534b0005101caf]          
  (090149534b0005101caf) 1-0:2.8.0 [0x0000000007231ded]
  (090149534b0005101caf) 1-0:2.8.1 [0x0000000007231ded] 
  (090149534b0005101caf) 1-0:2.8.2 [0x0000000000000000]
  (090149534b0005101caf) 1-0:16.7.0 [0xffffff66]
  (090149534b0005101caf) 129-129:199.130.5 [0xf0e58e8eecb454beb6cd77063c3909ff4115228029aaa75d6f3cb235443352efac8dbbfe2f547659f6e6e46515f64ff0]
OBIS info:
  (090149534b00045bab92) 129-129:199.130.3 [0x49534b]
  (090149534b00045bab92) 1-0:0.0.9 [0x090149534b00045bab92]
  (090149534b00045bab92) 1-0:1.8.0 [0x000000000d4b48df]
  (090149534b00045bab92) 1-0:1.8.1 [0x000000000d4b48df]
  (090149534b00045bab92) 1-0:1.8.2 [0x0000000000000000]
  (090149534b00045bab92) 1-0:16.7.0 [0x000001e7]
  (090149534b00045bab92) 129-129:199.130.5 [0x0064bb6cb5b19c2db25bd7c6b5c26d401e7dd48c564a2a27e808efa079e23942a78dccfaa572cf23fad8b8b9bfa3aeff]

You forgot to post your yaml.

this exactly the same code as was running on the 8266
modified for the esp32 plattform

esphome:
  name: "d1m32-sml27"
  friendly_name: "d1m32-sml27"

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

ota:
  - platform: esphome
    password: "..."

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "..."
    password: "..."

# Enable Home Assistant API
api:
  encryption:
    key: "..."

captive_portal:

uart:
  - id: uart_1
    rx_pin: GPIO18
#    tx_pin: GPIO19
    baud_rate: 9600
    data_bits: 8
    parity: NONE
    stop_bits: 1
    rx_buffer_size: 1024
  - id: uart_2
    rx_pin: GPIO16
#    tx_pin: GPIO17
    baud_rate: 9600
    data_bits: 8
    parity: NONE
    stop_bits: 1
    rx_buffer_size: 1024

sml:
  - id: sml_27_2OG
    uart_id: uart_1
  - id: sml_27_Solar
    uart_id: uart_2

sensor:
  - platform: sml
    name: "kWh 2OG"
    sml_id: sml_27_2OG
    server_id: "090149534b00045bab92"
    obis_code: "1-0:1.8.0"
    unit_of_measurement: kWh
    accuracy_decimals: 3
    device_class: energy
    state_class: total_increasing
    filters:
      - multiply: 0.0001
  - platform: sml
    name: "kW 2OG"
    sml_id: sml_27_2OG
    server_id: "090149534b00045bab92"
    obis_code: "1-0:16.7.0"
    unit_of_measurement: kW
    accuracy_decimals: 3
    device_class: power
    state_class: measurement
    filters:
      - multiply: 0.001

  - platform: sml
    name: "kWh Solar"
    sml_id: sml_27_Solar
    server_id: "090149534b0005101caf"
    obis_code: "1-0:2.8.0"
    unit_of_measurement: kWh
    accuracy_decimals: 3
    device_class: energy
    state_class: total_increasing
    filters:
      - multiply: 0.0001
  - platform: sml
    name: "kW Solar"
    sml_id: sml_27_Solar
    server_id: "090149534b0005101caf"
    obis_code: "1-0:16.7.0"
    unit_of_measurement: kW
    accuracy_decimals: 3
    device_class: power
    state_class: measurement
    filters:
      - multiply: 0.001

If that translates to Wroom32 board, I don’t see any reason why your code shouldn’t work (if it was working with esp8266).

yes, it’s a Wroom32 board.

Any idea what I can do to track the problem down?

UART and SLM protocol are working, but SML does not decod the values.
HA shows the sensor values as unkonwn

one coffee later …

:man_facepalming: I swap the UARTs when soldering the Hichis to the esp32 board.

as one of the counters is connected to a solar collector, the obis channels for the two counters are different (1-0:1.8.x vs 1-0:2.8.x)