Strange data enters [ 0D 0A ]

Model : DUE

char serialPacket[8] = {0,};
serialPacket[0] = 0x01;
serialPacket[1] = 0x04;
serialPacket[2] = 0x00;
serialPacket[3] = 0x64;
serialPacket[4] = 0x00;
serialPacket[5] = 0x06;
serialPacket[6] = 0x31;
serialPacket[7] = 0xD7;
Serial1.write(serialPacket, sizeof(serialPacket));

[ 01 04 00 64 00 06 31 D7 0D 0A ...d..1?.. ]

I want to send data in "01040064000631D7 " format.
But when I check it, it comes out with "01040064000631D70D0A "

Why is the value of "0D0A" being sent
Please tell me how to send it properly

"Serial1.println ();" < ==== Delete

0x0D : Carriage Return '\r'
0x0A : Line Feed '\n'

The Serial.println(); prints "\r\n", that is what you see.

Try Serial1.print(). Thats a carriage return youre seeing :wink:

Because ou have sent a Carriage Return and Linefeed after the data using Serial1.println();

"Serial1.println ();" is a built-in function.
Where should I edit

If you don't want to send the line ending characters then remove that line of code

It is common to send CarriageReturn + LineFeed at the end of a line.
Can the receiver handle it ?

How did you check it ? With a serial terminal or a serial sniffer ? Perhaps the 0x0D and 0x0A are supposed to be there.