{"id":16239642,"url":"https://github.com/nopnop2002/esp-idf-dfplayermini","last_synced_at":"2025-03-19T16:31:31.703Z","repository":{"id":65448726,"uuid":"592211430","full_name":"nopnop2002/esp-idf-DFPlayerMini","owner":"nopnop2002","description":"DFPlayer - A Mini MP3 Player For ESP-IDF","archived":false,"fork":false,"pushed_at":"2024-05-23T06:17:31.000Z","size":1557,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-23T06:44:02.869Z","etag":null,"topics":["dfplayer-mini","esp-idf","esp32","mp3","mp3-player"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nopnop2002.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-23T08:03:58.000Z","updated_at":"2024-06-02T08:34:13.218Z","dependencies_parsed_at":"2024-04-24T12:59:45.017Z","dependency_job_id":"f8015524-ba4e-4011-b1ac-57d89ab72567","html_url":"https://github.com/nopnop2002/esp-idf-DFPlayerMini","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-DFPlayerMini","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-DFPlayerMini/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-DFPlayerMini/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-DFPlayerMini/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nopnop2002","download_url":"https://codeload.github.com/nopnop2002/esp-idf-DFPlayerMini/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244006260,"owners_count":20382441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dfplayer-mini","esp-idf","esp32","mp3","mp3-player"],"created_at":"2024-10-10T13:44:30.389Z","updated_at":"2025-03-19T16:31:31.691Z","avatar_url":"https://github.com/nopnop2002.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esp-idf-DFPlayerMini\nDFPlayer - A Mini MP3 Player For ESP-IDF.   \n\nESP32 has I2S output function.   \nBy using ESP-ADF and I2S amplifier, MP3 files can be played.   \nHowever, ESP-ADF is esoteric and also depends on a specific version of ESP-IDF.   \nAlso, for ESP32C2, I can't find any mention of I2S.   \n\nI made this for the purpose of playing MP3 files more easily.   \n\nI ported from [here](https://github.com/DFRobot/DFRobotDFPlayerMini) and used [this](https://github.com/nopnop2002/esp-idf-serial) component.\n\n# Software requirements\nESP-IDF V5.0 or later.   \nESP-IDF V4.4 release branch reached EOL in July 2024.   \n\n# Hardware requirements\nDFPlayer - A Mini MP3 Player For Arduino.   \nhttps://www.dfrobot.com/index.php?route=product/product\u0026product_id=1121   \n\n__Note for MP3-TF-16P__   \nMany suppliers sell MP3-TF-16P as DFPlayerMini.   \nHowever, since they are completely different products, they are not fully compatible.   \nThis repository supports MP3-TF-16P, but I'm not sure if all features work.   \nThe two on the top are MP3-TF-16P.   \n\n![MP3-TF-16P-1](https://github.com/nopnop2002/esp-idf-DFPlayerMini/assets/6020549/64b354cb-13f2-4d48-8845-12da14f7a587)\n![MP3-TF-16P-2](https://github.com/nopnop2002/esp-idf-DFPlayerMini/assets/6020549/d1866db4-2d55-4dd0-b627-748babe324b1)\n\n# MP3 Chip\nDF Player Mini's MP3 IC has a wide variety of variations.   \nI own three DF Players, two with JC AA18 and one with YX5200.   \nJC AA18 works very stable.   \nBut YX5200 give me this error sometime:\n```\nsending:7e ff 6 6 0 0 1e fe d7 ef\n\nsending:7e ff 6 3 0 0 1 fe f7 ef\nreceived:7e ff 6 40 0 0 4 fe b7 ef\nDFPlayerError:Check Sum Not Match\n```\n\nIn addition to this, there are YM5200, YM5300, MH2024K, GD3200B, etc.   \nThere are also articles like this.   \nhttps://github.com/arendst/Tasmota/discussions/11737   \nhttps://forum.arduino.cc/t/df-player-warning/952842   \nhttps://discourse.voss.earth/t/probleme-mit-dem-dfplayer-mini/12203   \n\n![MP3_CHIP](https://github.com/nopnop2002/esp-idf-DFPlayerMini/assets/6020549/8809b4e9-6765-41c7-8c71-5b413f8111da)\n\n\n# Installation\nCopy all the contents of mp3Data to the SD card.   \nInsert the SD card into the player.   \n\n```Shell\ngit clone https://github.com/nopnop2002/esp-idf-DFPlayerMini\n# mount your SD card\ncp esp-idf-DFPlayerMini/mp3Data/* your_SD_card\n# unmount your SD card and insert the SD card into the player\ncd esp-idf-DFPlayerMini/GetStarted\nidf.py menuconfig\nidf.py flash\n```\n\n# Configuration\n\n![config-top](https://user-images.githubusercontent.com/6020549/213992858-400a5d6d-0165-4394-9d3d-a84ef93270f1.jpg)\n\n![config-app](https://github.com/nopnop2002/esp-idf-DFPlayerMini/assets/6020549/760ccda3-a4e2-4300-b7b7-387dee00f044)\n\nIf you have problems, please enable debug mode.   \n\n# Wiring with built-in amplifier\n|ESP32||DFPlayerMini||Speker|\n|:-:|:-:|:-:|:-:|:-:|\n|3.3V|--|VCC|||\n|GPIO4(*)|--|RX|||\n|GPIO5(*)|--|TX|||\n|||SPK+|--|Speaker+|\n|GND|--|GND|||\n|||SPK-|--|Speaker-|\n\n(*) You can change it using menuconfig.   \n\n__The built-in amplifier of this module is very sensitive to noise.__   \n\nTypical circuit   \n![ESP32-DFRobot-DFPlayer-Mini-1](https://user-images.githubusercontent.com/6020549/213993262-ed8a3f7a-add9-48e2-b618-0d4ecce669bc.jpg)\n\n\n# Wiring with an external amplifier\n|ESP32||DFPlayerMini||AMP|\n|:-:|:-:|:-:|:-:|:-:|\n|3.3V|--|VCC|--|VCC|\n|GPIO4(*)|--|RX|||\n|GPIO5(*)|--|TX|||\n|||DAC_R|--|Right Channl Input|\n|||DAC_I|--|Left Channl Input|\n|GND|--|GND|--|GND|\n\nTypical circuit   \n![ESP32-DFRobot-DFPlayer-Mini-2](https://user-images.githubusercontent.com/6020549/213993306-7e591d0a-bfb6-42ce-bd71-62b3feef8a9c.jpg)\n\n# Micro SD Card\nI've tried several different brands of SD cards and some don't work.   \nI get this error.   \nI fixed it by replacing the SD card with another brand.   \nIt's probably related to the power consumption of the SD card.   \n```\nreceived:7e ff 6 3b 0 0 2 fe be ef\nCard Removed!\n```\n\n# About sample mp3 data\nI borrowed from here.(Japanese site)   \nThis is a typical alarm used in elementary and junior high schools in Japan to announce the start and end of classes.   \nhttps://otologic.jp/free/se/school_bell01.html#google_vignette\n\n# API\n```\n//----Mp3 play----\nDF_next();  //Play next mp3\nDF_previous();  //Play previous mp3\nDF_play(1);  //Play the first mp3\nDF_loop(1);  //Loop the first mp3\nDF_pause();  //pause the mp3. This cannot be resumed, so it is the same as stop.\nDF_start();  //start the mp3 from the pause\nDF_playFolder(15, 4);  //play specific mp3 in SD:/15/004.mp3; Folder Name(1~99); File Name(1~255)\nDF_enableLoop(); //start loop current mp3 file.\nDF_disableLoop(); //stop loop current mp3 file.\nDF_enableLoopAll(); //start loop all mp3 files in SD.\nDF_disableLoopAll(); //stop loop all mp3 files in SD.\nDF_playMp3Folder(4); //play specific mp3 in SD:/MP3/0004.mp3; File Name(0~65535)\nDF_advertise(3); //advertise specific mp3 in SD:/ADVERT/0003.mp3; File Name(0~65535)\nDF_stopAdvertise(); //stop advertise\nDF_playLargeFolder(2, 999); //play specific mp3 in SD:/02/004.mp3; Folder Name(1~10); File Name(1~1000)\nDF_loopFolder(5); //loop all mp3 files in folder SD:/05.\nDF_randomAll(); //Random play all the mp3.\n\n//----Read imformation----\nprintf(\"%d\",DF_readState()); //read device state\nprintf(\"%d\",DF_readVolume()); //read current volume\nprintf(\"%d\",DF_readEQ()); //read EQ setting\nprintf(\"%d\",DF_readPlaybackMode()); //read playback mode setting\nprintf(\"%d\",DF_DF_readSoftVersion()); //read software version\nprintf(\"%d\",DF_readFileCounts(DFPLAYER_DEVICE_SD)); //read all file counts in SD card\nprintf(\"%d\",DF_readCurrentFileNumber(DFPLAYER_DEVICE_SD)); //read current play file number in SD card\nprintf(\"%d\",DF_readFileCountsInFolder(3)); //read fill counts in folder SD:/03\n```\n\n# For more info\nDocument is [here](https://picaxe.com/docs/spe033.pdf).   \n\nProduct information is [here](https://www.dfrobot.com/wiki/index.php/DFPlayer_Mini_SKU:DFR0299).   \n\n# How to use this component in your project   \nCreate idf_component.yml in the same directory as main.c.   \n```\nYourProject --+-- CMakeLists.txt\n              +-- main --+-- main.c\n                         +-- CMakeLists.txt\n                         +-- idf_component.yml\n```\n\nContents of idf_component.yml.\n```\ndependencies:\n  nopnop2002/DFPlayerMini:\n    path: components/DFRobotDFPlayerMini/\n    git: https://github.com/nopnop2002/esp-idf-DFPlayerMini.git\n```\n\nWhen you build a projects esp-idf will automaticly fetch repository to managed_components dir and link with your code.   \n```\nYourProject --+-- CMakeLists.txt\n              +-- main --+-- main.c\n              |          +-- CMakeLists.txt\n              |          +-- idf_component.yml\n              +-- managed_components ----- nopnop2002__DFPlayerMini\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnopnop2002%2Fesp-idf-dfplayermini","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnopnop2002%2Fesp-idf-dfplayermini","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnopnop2002%2Fesp-idf-dfplayermini/lists"}