Skip to content

Fixed DFPlayer init issue#412

Open
Yukti007 wants to merge 1 commit intomainfrom
359-firmware-dfplayer-initializing-failed-dfplayer-not-detected
Open

Fixed DFPlayer init issue#412
Yukti007 wants to merge 1 commit intomainfrom
359-firmware-dfplayer-initializing-failed-dfplayer-not-detected

Conversation

@Yukti007
Copy link
Collaborator

Links

What & Why

  • Fix DFPlayer false-negative on init: changed isACK=true to isACK=false
    in dfPlayer.begin() to prevent timing race where unsolicited SD card status
    packets cause begin() to miss the ACK and return false on working hardware.

Validation / How to Verify

  1. Flash v0.4.5.0 on a board with DFPlayer + SD card installed.
  2. Run test 4 — should report PASS and not DFPlayer not detected.
  3. Run tests 5 and 6 — SD file count should be > 0 and speaker should play.

Artifacts (attach if relevant)

  • Screenshots / PDFs / STLs
  • Logs — attach Serial Monitor output showing DFPlayer detected and responding

Checklist

  • Only related changes FactoryTest_wMenu.ino
  • Folder structure respected, work directory Firmware/factoryTest/FactoryTest_wMenu/FactoryTest_wMenu.ino

@Yukti007 Yukti007 linked an issue Mar 22, 2026 that may be closed by this pull request
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7353ea2e5d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

delay(300);

if (!dfPlayer.begin(dfSerial, true, true)) {
if (!dfPlayer.begin(dfSerial, false, true)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Re-enable ACK after the DFPlayer init workaround

Passing false here changes more than the startup check: in DFRobotDFPlayerMini, begin(..., false, ...) disables ACK mode on the dfPlayer object for all later commands. In this sketch that means outputDevice() in initDFPlayer() and the volume()/play()/stop() sequence in runTest_Speaker() no longer wait for the module's command ACKs and instead run with only the library's fixed 10 ms pacing. On slower DFPlayers or SD cards this can turn tests 5/6 into intermittent false FAILs even after init succeeds, so the workaround should not leave ACKs disabled for the rest of the session.

Useful? React with 👍 / 👎.

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

Successfully merging this pull request may close these issues.

Firmware, DFPlayer initializing Failed (DFPlayer not detected).

1 participant