Help calibrating WitMotion inclinometer through TTL with Mega2560

I am using a WitMotion WT901C-TTL inclinometer to provide angle data to an Arduino Mega2560. I can already receive data through the mega's RX1 pin. Now I am trying to send a calibration command to the sensor from the mega's TX1 pin, but the sensor doesn't go into calibration mode or respond in any way.

I have the sensor's TX pin connected to the mega's RX1 pin, and the sensor's RX pin connected to the mega's TX1 pin.

According to the datasheet and FAQ, the sensor needs the following commands to calibrate:

Unlock: FF AA 69 88 B5
Save: FF AA 00 00 00
Enable calibration: FF AA 01 01 00
wait 3 seconds
Disable calibration: FF AA 01 00 00
Save: FF AA 00 00 00

This is the arduino code I am using:

Serial1.begin(9600); // Use the RX1 and TX1 pins on the Mega2560

// Unlock configurations
byte data1[] = {0xFF, 0xAA, 0x69, 0x88, 0xB5};
Serial1.write(data1, 5);

// Enable Calibration mode
byte data2[] = {0xFF, 0xAA, 0x01, 0x01, 0x00};
Serial1.write(data2, 5);

delay(3000);

// Disable calibration mode
byte data3[] = {0xFF, 0xAA, 0x01, 0x00, 0x00};
Serial1.write(data3, 5);

// Save the configuration
byte data4[] = {0xFF, 0xAA, 0x00, 0x00, 0x00};
Serial1.write(data4, 5);

The serial1 is the same interface being used to read data from the sensor, so I imagine it would work sending data to the sensor too. But the sensor does not respond in any way to these commands.

WitMotion customer service was pretty unhelpful. I'm hoping someone here has some real experience with the device.

I am having the same issue, were you ever able to find a solution?

Thank you for using code tags, but please post the whole code.

Are you sure of the baud rate?

Within this file is sample code for Arduino. See inside Sample Code.zip.

Yes, actually, I did solve the problem.
This is the magic line of code:

byte data0[] = {0xFF, 0xF0, 0xF0, 0xF0, 0xF0};
Serial1.write(data0, 5);

Although the datasheet doesn't say it, that sequence of bytes must be sent to the WitMotion accelerometer before any configurations can be set.
So the whole program now becomes:

Serial1.begin(115200, SERIAL_8N1); // Use the RX1 and TX1 pins on the Mega2560

// Special unlock/enable thing (not documented anywhere!)
byte data0[] = {0xFF, 0xF0, 0xF0, 0xF0, 0xF0};
Serial1.write(data0, 5);

delay(2);
	
// Unlock configuration
byte data1[] = {0xFF, 0xAA, 0x69, 0x88, 0xB5};
Serial1.write(data1, 5);
	
delay(2);

// Enable calibration mode
byte data2[] = {0xFF, 0xAA, 0x01, 0x01, 0x00};
Serial1.write(data2, 5);

delay(5000); // Wait for calibration to finish

// Save configuration
byte data3[] = {0xFF, 0xAA, 0x00, 0x00, 0x00};
Serial1.write(data3, 5);

Thanks for posting the solution.