XIAO ESP-32c6 + mr60bha2 mmWave sensor arduino examples not working

Hello. I followed the instructions from here: Getting started with MR60BHA2 | Seeed Studio Wiki but I am unable to run mmWave examples from Arduino. I’ve tried updating the firmware and the only thing that works is LightRGB example that lightens on board LED (not the esp one). When I do some debug prints in loop() it does print them out but it seems that mmWave.update(100) returns false. What is wrong with this kit? I just bought it.

Hi there,

And welcome here…

So which BSP are you using to compile the code with? You may need to roll it back to an earlier one to get it to work. YMMV
You can use the code tags “</>” above and paste it in there sa we can look. Sounds like you have it sort of going.

HTH
GL :slight_smile: PJ :v:

I am just trying to launch some examples in arduino ide with board selected : xiao-esp32c6

example I am trying to flash:

#include <Arduino.h>
#include "Seeed_Arduino_mmWave.h"

// Set up serial communication depending on the board type
#ifdef ESP32
#  include <HardwareSerial.h>
HardwareSerial mmWaveSerial(0);
#else
#  define mmWaveSerial Serial1
#endif

SEEED_MR60BHA2 mmWave;

void setup() {
Serial.begin(115200);
mmWave.begin(&mmWaveSerial);
}

void loop() {
  Serial.println("debug");
if (mmWave.update(100)) {
 float total_phase, breath_phase, heart_phase;
 if (mmWave.getHeartBreathPhases(total_phase, breath_phase, heart_phase)) {
   Serial.printf("total_phase: %.2f\t", total_phase);
   Serial.printf("breath_phase: %.2f\t", breath_phase);
   Serial.printf("heart_phase: %.2f\n", heart_phase);
 }

 float breath_rate;
 if (mmWave.getBreathRate(breath_rate)) {
   Serial.printf("breath_rate: %.2f\n", breath_rate);
 }

 float heart_rate;
 if (mmWave.getHeartRate(heart_rate)) {
   Serial.printf("heart_rate: %.2f\n", heart_rate);
 }

 float distance;
 if (mmWave.getDistance(distance)) {
   Serial.printf("distance: %.2f\n", distance);
 }
}
}

is it the module firmware I should rollback or the library?

You may need to re-flash the firmware and check if you have mixed up the BHA2 and FDA2 firmware.Could you please upload the pictures showing the process of flashing the firmware? Make sure they are consistent with the information on the Wiki. If there is any discrepancy, please contact techsupport to follow the after-sales procedure.

I am sure I did BHA2. I was following the instructions from the tutorial. I flashed the firmware correctly but now when I went back to OTA tool, nothing happens when I click request update.

You can organize the operation procedures into a document, making it as detailed as possible so that we can easily identify which step has gone wrong. If it is a product issue, you can contact our technical support team via email. This way, you will be able to get help promptly.

I did exactly as tutorial guided me. I tried different examples and the only one working is RGBLed, Tried both serials too. It seems the module was bricked from the start. It wasn’t until Ive tried all available options till I went for OTA Tool.

Based on the tutorial, you have to upload the following code in Arduino IDE:
#include <Arduino.h>
#include “Seeed_Arduino_mmWave.h”

// If the board is an ESP32, include the HardwareSerial library and create a
// HardwareSerial object for the mmWave serial communication
#ifdef ESP32

#include <HardwareSerial.h>

HardwareSerial mmWaveSerial(0);
#else
// Otherwise, define mmWaveSerial as Serial1

#define mmWaveSerial Serial1

#endif

void setup() {
// Initialize the serial communication for debugging
Serial.begin(115200);
while (!Serial) {
; // Wait for Serial to initialize
}

// Initialize the mmWaveSerial communication
mmWaveSerial.begin(115200);
}

void loop() {
// Check if there is data available from mmWaveSerial
while (mmWaveSerial.available() > 0) {
char receivedChar = mmWaveSerial.read();
Serial.write(receivedChar); // Forward data to Serial
}

// Check if there is data available from Serial
while (Serial.available() > 0) {
char receivedChar = Serial.read();
mmWaveSerial.write(receivedChar); // Forward data to mmWaveSerial
}
}
Please take a screenshot of the Arduino IDE serial monitor after you upload this code. If the result shows that:

That indicates the radar is working. Again, we cannot help you any more if you don’t share any details with us.

Regards,
John

1 Like