Problems with Software Serial on ESP8266

I am using an esp8266 read data from my power meter via SML. I wanted to add my second and third meter (one uses D0, the other uses SML) using software serial on the esp, but I am just recieving garbarge data. My setup is a small esp8266 devboard (d1 layout) and a BPW40 with a 1k pullup connected to GPIO4. Below is my yml and logs.
Can someone help me with this? Thanks in advance.
My yml:

uart:
 - id: uart_bus1
   rx_pin: GPIO4
   baud_rate: 9600
   data_bits: 7
   parity: EVEN
   stop_bits: 1
   debug:
     dummy_receiver: true

obis_d0:
  id: my_sm
  uart_id: uart_bus1
  on_telegram:
    then:
      - logger.log: "telegram received"

Hardware Serial (GPIO3) (converted to ascii):

[21:29:51.779][D][uart_debug:113]: <<< 
V)
1-0:52.7.0*255(238.60*V)
1-0:72.7.0*255(240.61*V)
1-0:31.7.0*255(000.15*A)
1-0:51.7.0*255(000.08*A)
1-0:71.7.0*255(000.00*A)
1-0:21.7.0*255(+
[21:29:52.065][D][uart_debug:113]: <<< 
00000*W)
1-0:41.7.0*255(+00000*W)
1-0:61.7.0*255(+00000*W)
1-0:96.50.0*0(E6)
1-0:96.50.0*1(07CF)
1-0:96.50.0*2(1D)
1-0:96.50.0*3(0B)
1-0:96.50.

Software Serial (hex, ascii is not readable):

[21:25:19.157][D][uart_debug:113]: <<< 0E:00:00:06:20:40:00:10:20:20:20:02:1E:00:00:4C:00:06:00:20:20:08:00:08:00:20:08:20:30:20:0C:20:0C:20:00:20:20:20:00:20:20:30:20:24:26:20:20:00:08:00:20:08:20:30:20:0C:30:0C:20:00:20:20:20:00:20:20:30:26:24:20:0C:20:30:30:20:00:08:00:20:08:20:30:30:24:0C:20:0C:20:00:20:20:20:00:20:20:00:08:00:20:08:20:30:30:24:0C:20:0C:20:20:20:00:20:20:20:00:20:20:20:20:20:20:26:24:26:20:00:08:00:20:08:20:30:22:20:0C:26:0C:20:00:20:20:20:00:20:22:30:0C:20:30:00
[21:25:19.157][D][uart_debug:113]: <<< 04:00:08:00:20:08:20:30:20:20:0C:26:0C:20:00:20:20:20:00:20:22:30:0C:22:20:00:04:00:08:00:20:08:20:30:26:20:0C:26:0C:20:00:20:20:20:00:20:20:20:0C:20:20:00:04:00:08:00:20:08:20:30:22:20:0C:26:0C:20:00:20:20:20:00:20:20:20:0C:20:20:00:00:00:08:00:20:08:20:30:20:20:0C:26:0C:20:00:20:20:20:00:20:20:20:0C:20:30:00:00:00:08:00:20:08:20:30:26:20:0C:26:0C:20:00:20:20:20:00:20:20:20:0C:20:20:00:00:00:08:00:20:08:20:30:20:20:0C:26:0C:20:00:20:20:20:00:02

I’m not sure about esphome softwareserial but if it’s based on arduino, it probably doesn’t support 7E1.

And what is that??

Yes, get another esp device and use HW serial. Software Serial is a great idea, but often leaves much to be desired when trying to actually use it.

I had a water heater that used 9-bit serial. With esp chips this requires SW serial (and a custom version at that). I was able to make it work mostly, but it was never reliable. I needed 19200 baud but even 9600 is fast for software serial.

Luckily, my water heater died and I got a different one that uses 8-bit serial and works much better.

If you only needed 1200 baud or less it might be worth it.

Lucky you! :joy:

I’m pretty sure you can’t reliably use hardware serial and Software Serial at the same time on the ESP8266. The ESP8266’s hardware UART relies heavily on interrupts, and those interrupt latencies make Software Serial timing inaccurate or completely unusable.

Switch to ESP32, which has three full hardware UARTs and no Wi‑Fi‑interrupt timing issues.

So what’s the point of having sw serial in the first place?

It works for low-speed communications, 9600 or less. For example, I use it to communicate with the DFPlayer Mini and it leaves my UART I/O free for flashing and debugging. If you try to use both at the same time, the software serial will likely be garbled.

So if you have logger on hw uart , sw uart doesn’t work at moderate speeds?

This is the definitive library:

It does work, but it depends on your expectations.

Always use a HW serial port if you can. If you can’t be REALLY sure you can’t, because you will likely spend a lot of time getting SW serial to work well enough.

The esp chips don’t don’t support 9-bit serial, so I was forced to use SW serial. I got it mostly working before I no longer needed it.

The easy button is to just use HW serial.

So buying an ESP32 is the only good way to use three or even two 9600 connections at the same time? (2x 8n1, 1x 7E1)

I have a few pi pico (non w) lying around. Can I use one of those to relay the data?

This post suggests that it is possible:

You are welcome to try. It will be a learning experience. Be sure you want the learning and have the time.

If your goal is learning, I suggest you try and make software Serial work.

If your goal is to get data from your second meter, buy another esp device.

Sure, that too will be a learning experience.

Maybe not only but good way yes. Pick variant which has 3 uarts though.

But esphome doesn’t seem to use arduino library for sw serial.

You are correct. It uses something different:

This is likely to be even worse.

If you want great learning go down the path of getting software serial to work. At least a few people have been successful. Having gone down the path I can say it is not an easy path. It will challenge you.

What personally prevents me to waste time with this kind of approach is that even if you manage to make it work, it can break any moment in future. Add some components or update esphome and you have exciting times again. I do like challenges but only new ones.