I am trying to use the Neato xv11 lidar with an ESP32. This should output packets of 22 bytes with the starting byte 0xFA. The communication is 8N1 and the baud rate is 115200.
When I connect the Lidar TX to the ESP32 RX2 pin, I get data that does not make sense as I get the start byte every 9 (and sometimes 8) bytes. However, when I run the same code on an Arduino Nano, I get the correct 22 byte packages. I even connected both at once and logged the results in Putty. This is the data I got.
// Arduino Nano Code
void setup() {
Serial.begin(115200);
Serial1.begin(115200);
}
void loop() {
while (Serial1.available()) {
Serial.println(Serial1.read(),HEX);
}
}
// ESP32 Code
void setup() {
Serial.begin(115200);
Serial2.begin(115200, SERIAL_8N1, 16, 17);
}
void loop() {
while (Serial2.available()) {
Serial.println(Serial2.read(),HEX);
}
}
ESP32
FA
A8
0
35
6D
11
17
71
3D
FA
A9
0
3D
12
97
12
10
D1
41
FA
AA
0
E1
E
14
12
E7
1F
FA
AB
Arduino Nano
FA
D8
74
35
6B
3
3D
1
7B
3
3B
1
8C
3
2B
1
9F
3
1C
1
A
1D
FA
D9
74
35
B2
3
if, instead ofwhile