Sending binary data over TCP

Hi everyone!

I’m trying to send binary data over TCP to a server made in python. I need to send binary data, without coding, non-ASCII characters indeed. Some of the data bytes can be 0x1A which coincide with the send command, doing that all data were transmitted early. Using AT+CIPSEND=< length > solve the problem, because data are transmitted when the content of the buffer reach that quantity. But in case of a byte take a certain value it is not transmitted properly, such as 0x00 (in this case, the byte is not transmitted) or 0x0A (line-feed or new line, in this case, the server receives 0x0A 0x0D, an extra byte). I don’t know if the module interprets certain values, low values in the ASCII table or it’s a problem on the server-side. Have anyone made something similar?

Thank you in advance

Yes length based command will work. But if you are seeing some bytes are affecting the data delivery its the server which is interpreting and closing connection or doing something. Check there. Device doesnt interpret when you give length.

Maybe a good compromise would be to use Base64 encoding and decoding?