I’m trying to connect my DWM1001 to an ESP32-C3 SuperMini using the ESP’s Serial port, but I’m having trouble. I understand I should send \r\rlep\r to the DWM1001 to retrieve data, but I’m not getting any response. Is there another step to establish the connection, or am I doing something wrong?
I’ll paste the code below for a quick check. Thanks!
while (!Serial.available()){
Serial.write(“\r”);
delay(1000);
Serial.write(“\r”);
delay(2000);
Serial.write(“lep\r”);
}
while (Serial.available()) {
character = Serial.read();
content = content.concat(character);
}
You send the final lep command and them immediatly check to see if any serial data has been received. If there is nothing waiting you move on. At that point in the code it won’t have even finished sending the command. Since you don’t seem to be worrying about delays I’d add another delay after sending the lep command in order to give the DWM1001 time to reply.
Having said that it should see something the first time (there is a delay after the transmit in setup() ) and every other time it sends the command. If you’re not seeing anything then I’d start by double checking the power, ground and data connections, both verify that you’ve got them connected and for the serial that you’re on the correct pins. If that all looks good oscilloscope on the data pins (or if you don’t have one a TTL serial to USB cable to a PC), look at the data pins in each direction and see where the data is going missing.