DFRobot Gravity voice recognition module

This should really be basic stuff, my stupidity really must be showing today.
Simply, I don't seem to have any communication between the voice module and the Arduino. I've watched a couple of videos and copied the code they use in their projects without any correct responses. I copied the example code from the DFrobot GIThub with the same results.

I've got the first 4 custom commands set up in the DFRobot as tests, which the unit responds to fine - but I'm getting no feedback about them in the serial monitor when connected to the Arduino. I tried a small section of code to identify them individually, still nothing. (Sorry, overwrote that code trying something else).

The serial monitor is coming up with the "Begin ok!" message - even when the device isn't attached. The code suggests it should say there's no connection;

// Init the sensor
while( !( DF2301Q.begin() ) ) {
Serial.println("Communication with device failed, please check connection");
delay(3000);
}
Serial.println("Begin ok!");

Because of that I don't have a positive way to even see if it's detecting the DFrobot.

After the Begin ok! message I get nothing more.

Does anyone know of a very simple, basic code anywhere for this thing just to test if it's actually talking to the Arduino or not?

Notes : tried on both UNO and Nano, using UART but switching between the two and using the different examples on the site made no difference.

Many thanks.

This says "while the return from DF2301Qbegin() is zero, print '... failed...', any other return (< 0 or > 0) will print "ok"... then wait three seconds and "while" again.

I am guessing the return is "-1"... which usually means "no response", but the code is not taking that into account.

While the thing is not connected, print the return of DF2301Q.begin() and use that as another "comm failure" exit or retry.

1 Like