I've tried this and it seems to work, but now I'm receiving a packet from sensor which contains "buffer_overflow". Meaning the internal receive buffer of the CHR-6d overflows before receiving a full packet. I'm not sure, but should I synchronize Sensor's reading and Mega's writing somehow?
If the packet size is limited to 5 bytes (+2 checksum) I understand that the buffer is overflowing with 20 characters sent in the string.
I would try it this way:
uint8_t sleep_code[] = {0x73, 0x6E, 0x70, 0x83, 0x00, 0x01, 0xD4};
for (uint8_t n = 0; n < 7; n++) {
Serial1.write(sleep_code[n]);
}
This is very similar to your first version but it's always a uin8_t type, so you know what exactly is transferred.
Does the datasheet specify any timing information? Do you have a link to the datasheet?