Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arduino Stuck after trying to stop DFPlayer #51

Open
laurentmas opened this issue Jul 13, 2023 · 1 comment
Open

Arduino Stuck after trying to stop DFPlayer #51

laurentmas opened this issue Jul 13, 2023 · 1 comment

Comments

@laurentmas
Copy link

laurentmas commented Jul 13, 2023

Hello, since the new library version 1.0.6 , arduino stuck into an infinite loop when we play a music and we try to stop it.

The issue can be reproduced if the ack mode is set to true, then you play a music, and then you stop it with the DFPlayer function

The issue come from a change on the sendStack and available function.

it seams when you sendStack Stop (command 0x16) DFplayer do not reply or there is no catch in switch case in the available() function and _isSending is never set to false as the handleError is not called anymore, and you are stuck in the while loop in the sendStack function.

void DFRobotDFPlayerMini::sendStack(){ if (_sending[Stack_ACK]) { //if the ack mode is on wait until the last transmition **while (_isSending) { delay(0); waitAvailable(); }** }

the romoval of the following code in DFRobotDFPlayerMini::available(){ function is responsible of the DFplayer stuck :
if (_isSending && (millis()-_timeOutTimer>=_timeOutDuration)) { return handleError(TimeOut); }

This need to checked back and be fixed as the dfplayer is no more really usable.

@J-L-Fan
Copy link

J-L-Fan commented Oct 24, 2023

There are many problems with this library. For example, when you use readVolume after playing a piece of music, the value read out will definitely be incorrect.

Even if it is currently operating normally, problems with reading values ​​will occur after the program has been running for a period of time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants