简体   繁体   中英

Forbidden characters in a TCP packet

I'm trying to send data from my ESP8266 to a NodeJS TCP server, the connection and basic charakters (48-90) are working fine, but if I use others like ASCII-Code (0,1,2,3...) I don't get any usefull data out of it. So what I was thinking about that there are some character which aren't allowed to send over TCP/IP.

By the way, I'm using this to write to the server, and I work with the standard WiFi Client library

char arr[255]
for(int i = 0; i < 255; i++){
   arr[i] = (char)i;
}
client.print(arr);

On the TCP/IP level, any characters values can be sent. The protocol is often used to transfer binary data (eg SSH, FTP etc. do this).

The problem is likely to be in your code adding the characters to the sent data or printing the received string.

One thing you can do to determine if the problem is on the sending or receiving side is to use Wireshark on your server machine to capture the transmitted data and check if the bytes are actually sent or not.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM