I have the following function that sends a string from ESP32 to Raspberry:
def rx_and_echo():
sock.send("\nsend anything\n")
while True:
data = sock.recv(buf_size)
if data:
print(data)
sock.send(data)
The format received by Raspberry is as follow:
b'T'
b'e'
b'x'
b't'
How to convert it into just Text?