Solved: It appears to be the clone nano I was using so bought genuine Nano ESP32 and now working. Was having false activations to caused by using ribbon cable which i2c didnt like so used CAT5e cable and split power and i2c over different pairs.
Should have said original Arduino Nano ESP32 not a clone ;-)
Actually you could try this as I had the same when trying to set at level 7 DF2301Q.setVolume(4); so i did this at the beginning of my set up…………….
while (!(DF2301Q.begin())) {
Serial.println("Communication with device failed, please check connection");
delay(3000);
}
Serial.println("Found DfRobot");
DF2301Q.setMuteMode(0);
delay(2000);
DF2301Q.playByCMDID(99); // plays command set volume at max Change volume to maximum from CMD ID table
delay(2000);
//DF2301Q.setVolume(7) // this doesn't seem to work and makes volume really quiet for some reason!!!
hope it helps
In my case I was using a clone Nano and it was freezing randomly and I think buffer was getting full up. Using Serial.flush(); seemed to help but still froze. I bought Nano ESP32 and so far seems ok. Only thing I have to sort is long cable for I2C connection. Needs to be short or twisted pairs to stop lag or not seeing SEN0539-EN. If your cable from dev board to SEN0539 is long may be better using IC2 than UART its faster ;-)
Can you post your code please?