Slimmelezer with ESP-link - python script not receiving the whole package

Hi, I have just bought a Slimmelezer+ and connected it (WiFi) to Iskra AM550 P1 port (I am from Slovenia). It came preinstalled with ESPHome. I was able to use Docker on my WinPC and installed Home Assistant and connected it to the Slimmelezer+, but no data was shown, except SSID, version and simmilar (no electricity data).
So I installed ESP-Link to test it and the device UI page shows that data is recieved from the meter.

So I tried to create a Python script to read the package / telegram, but I only recieve the first part of the package, over and over.

The ouput is here:
Connecting to 192.168.64.117:23…
Connected successfully! Listening for data…

Received chunk:
/ISK9\2M551T-200

0-0:96.1.0(94437989)
0-0:97.97.0(00000000)
1-0:0.9.1(11513
Received chunk:
/ISK9\2M551T-200

0-0:96.1.0(94437989)
0-0:97.97.0(00000000)

Received chunk:
/ISK9\2M551T-200

0-0:96.1.0(94437989)
0-0:97.97.0(00000000)

No new data received, waiting for more…

How should I get all the chunks of the package? I think the package always ends with “!”.

Thanks
Best
M.

The code is:

import socket
import time


def receive_telegram():
    host = "192.168.64.117"  # SlimmeLezer device IP
    port = 23  # TCP port for communication
    buffer_size = 1024  # Adjust if needed

    try:
        print(f"Connecting to {host}:{port}...")
        with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
            s.settimeout(10)  # Timeout for connection
            s.connect((host, port))
            print("Connected successfully! Listening for data...\n")

            data = b""

            while True:
                try:
                    chunk = s.recv(buffer_size)
                    if not chunk:
                        print("Device closed the connection.")
                        break  # Exit if connection is closed

                    data += chunk  # Append received data
                    print(f"Received chunk:\n{chunk.decode(errors='ignore')}")

                    if b"!" in data:  # Full telegram detected
                        print("\nFull Telegram Received:\n")
                        try:
                            print(data.decode("utf-8"))  # Print decoded data
                        except UnicodeDecodeError:
                            print("Received data is not UTF-8, printing raw bytes:")
                            print(data)

                        print("-" * 40)
                        data = b""  # Reset for next telegram

                except socket.timeout:
                    print("No new data received, waiting for more...")
                    continue  # Keep listening if there's a delay

    except Exception as e:
        print(f"Error receiving telegram: {e}")


if __name__ == "__main__":
    receive_telegram()