MH2024K-16SS: errors, errors, errors
bbbart opened this issue ยท 21 comments
Hi,
I compiled the code from the repository with the following small changes:
- commented out the includes of
avr/sleep.h
andavr/eeprom.h
- changed the SoftwareSerial ports to 16 (TX) and 17 (RX), according to my hardware setup
Compilation succeeded without warnings and upload to my ESP32 went smooth.
This is the output on the serial monitor. It doesn't seem to me to be looking any good...
19:55:14.123 -> DFPlayer Analyzer 1.0 - Starting up...
19:55:14.123 ->
19:55:14.189 -> [91] Packet sent (->): 7E FF 6 42 0 0 0 FE B9 EF -> Cmd: 42 (GetStatus), arg: 0
19:55:14.288 -> [201] Packet received (<-): 7E FF 6 42 0 2 2 FE B5 EF <- Msg: 42 (GetStatus), arg: 514
19:55:14.288 -> -------------------------------------------------------
19:55:14.321 -> Test Case "TestConnectivity" FINISHED
19:55:14.321 -> -------------------------------------------------------
19:55:14.321 ->
19:55:14.321 ->
19:55:14.321 -> -------------------------------------------------------
19:55:14.321 -> Running Test Case "TestDiscoverDevices"
19:55:14.321 -> -------------------------------------------------------
19:55:14.321 -> [235] Packet sent (->): 7E FF 6 C 0 0 0 FE EF EF -> Cmd: C (Reset), arg: 0
19:55:15.282 -> [1185] Packet received (<-): 7E FF 6 3F 0 0 2 FE BA EF <- Msg: 3F (StorageDevices), arg: 2
19:55:15.282 -> Callback OnCardOnline: 2
19:55:16.441 -> [2346] Packet sent (->): 7E FF 6 7 0 0 0 FE F4 EF -> Cmd: 7 (SetEQ), arg: 0
19:55:16.541 -> [2457] Packet sent (->): 7E FF 6 1A 0 0 0 FE E1 EF -> Cmd: 1A (SetDAC), arg: 0
19:55:16.806 -> [2718] Packet sent (->): 7E FF 6 6 0 0 1 FE F4 EF -> Cmd: 6 (SetVolume), arg: 1
19:55:16.872 -> [2779] Packet sent (->): 7E FF 6 C 0 0 0 FE EF EF -> Cmd: C (Reset), arg: 0
19:55:18.893 -> [4790] Packet sent (->): 7E FF 6 9 0 0 2 FE F0 EF -> Cmd: 9 (SetPlaybackDevice), arg: 2
19:55:19.092 -> [4990] Packet received (<-): 7E FF 6 40 0 0 3 FE B8 EF <- Msg: 40 (Error), arg: 3
19:55:19.092 -> --------------
19:55:19.092 -> ERROR 3
19:55:19.092 -> --------------
19:55:20.880 -> [6801] Packet sent (->): 7E FF 6 48 0 0 0 FE B3 EF -> Cmd: 48 (GetNoTracksSD), arg: 0
19:55:21.013 -> [6911] Packet received (<-): 7E FF 6 48 0 0 3 FE B0 EF <- Msg: 48 (GetNoTracksSD), arg: 3
19:55:21.013 -> [6922] Packet sent (->): 7E FF 6 9 0 0 1 FE F1 EF -> Cmd: 9 (SetPlaybackDevice), arg: 1
19:55:21.211 -> [7121] Packet received (<-): 7E FF 6 40 0 0 3 FE B8 EF <- Msg: 40 (Error), arg: 3
19:55:21.211 -> --------------
19:55:21.211 -> ERROR 3
19:55:21.211 -> --------------
19:55:23.066 -> [8982] Packet sent (->): 7E FF 6 47 0 0 0 FE B4 EF -> Cmd: 47 (GetNoTracksUSB), arg: 0
19:55:23.199 -> [9092] Packet received (<-): 7E FF 6 47 0 0 0 FE B4 EF <- Msg: 47 (GetNoTracksUSB), arg: 0
19:55:24.193 -> [10103] Packet sent (->): 7E FF 6 9 0 0 5 FE ED EF -> Cmd: 9 (SetPlaybackDevice), arg: 5
19:55:24.391 -> [10303] Packet received (<-): 7E FF 6 40 0 0 3 FE B8 EF <- Msg: 40 (Error), arg: 3
19:55:24.391 -> --------------
19:55:24.391 -> ERROR 3
19:55:24.391 -> --------------
19:55:26.213 -> [12114] Packet sent (->): 7E FF 6 9 0 0 2 FE F0 EF -> Cmd: 9 (SetPlaybackDevice), arg: 2
19:55:26.213 -> -------------------------------------------------------
19:55:26.213 -> Test Case "TestDiscoverDevices" FINISHED
19:55:26.213 -> -------------------------------------------------------
19:55:26.213 ->
19:55:26.213 ->
19:55:26.213 -> -------------------------------------------------------
19:55:26.246 -> Running Test Case "TestReaction3F"
19:55:26.246 -> -------------------------------------------------------
19:55:26.313 -> [12225] Packet received (<-): 7E FF 6 40 0 0 3 FE B8 EF <- Msg: 40 (Error), arg: 3
19:55:26.313 -> --------------
19:55:26.313 -> ERROR 3
19:55:26.313 -> --------------
19:55:26.412 -> [12325] Packet sent (->): 7E FF 6 C 0 0 0 FE EF EF -> Cmd: C (Reset), arg: 0
19:55:27.372 -> [13275] Packet received (<-): 7E FF 6 3F 0 0 2 FE BA EF <- Msg: 3F (StorageDevices), arg: 2
19:55:27.372 -> Callback OnCardOnline: 2
19:55:28.532 -> [14436] Packet sent (->): 7E FF 6 7 0 0 0 FE F4 EF -> Cmd: 7 (SetEQ), arg: 0
19:55:28.631 -> [14547] Packet sent (->): 7E FF 6 1A 0 0 0 FE E1 EF -> Cmd: 1A (SetDAC), arg: 0
19:55:28.896 -> [14808] Packet sent (->): 7E FF 6 6 0 0 1 FE F4 EF -> Cmd: 6 (SetVolume), arg: 1
19:55:28.963 -> [14869] Packet sent (->): 7E FF 6 3F 0 0 0 FE BC EF -> Cmd: 3F (StorageDevices), arg: 0
19:55:30.453 -> --------------
19:55:30.453 -> ERROR 129
19:55:30.453 -> --------------
19:55:30.453 -> -------------------------------------------------------
19:55:30.453 -> Test Case "TestReaction3F" FINISHED
19:55:30.486 -> -------------------------------------------------------
19:55:30.486 ->
19:55:30.486 ->
19:55:30.486 -> -------------------------------------------------------
19:55:30.486 -> Running Test Case "TestGetFolderTrackCount"
19:55:30.486 -> -------------------------------------------------------
19:55:30.486 -> [16399] Packet sent (->): 7E FF 6 C 0 0 0 FE EF EF -> Cmd: C (Reset), arg: 0
19:55:31.447 -> [17348] Packet received (<-): 7E FF 6 3F 0 0 2 FE BA EF <- Msg: 3F (StorageDevices), arg: 2
19:55:31.447 -> Callback OnCardOnline: 2
19:55:32.639 -> [18559] Packet sent (->): 7E FF 6 7 0 0 0 FE F4 EF -> Cmd: 7 (SetEQ), arg: 0
19:55:32.772 -> [18670] Packet sent (->): 7E FF 6 1A 0 0 0 FE E1 EF -> Cmd: 1A (SetDAC), arg: 0
19:55:33.037 -> [18931] Packet sent (->): 7E FF 6 6 0 0 1 FE F4 EF -> Cmd: 6 (SetVolume), arg: 1
19:55:33.070 -> [18992] Packet sent (->): 7E FF 6 9 0 0 2 FE F0 EF -> Cmd: 9 (SetPlaybackDevice), arg: 2
19:55:34.097 -> [20003] Packet sent (->): 7E FF 6 4E 0 0 1 FE AC EF -> Cmd: 4E (GetNoTracksFolder), arg: 1
19:55:34.196 -> [20113] Packet received (<-): 7E FF 6 40 0 0 3 FE B8 EF <- Msg: 40 (Error), arg: 3
19:55:34.229 -> --------------
19:55:34.229 -> ERROR 3
19:55:34.229 -> --------------
19:55:34.229 -> -------------------------------------------------------
19:55:34.229 -> Test Case "TestGetFolderTrackCount" FINISHED
19:55:34.229 -> -------------------------------------------------------
19:55:34.229 ->
19:55:34.229 ->
19:55:34.229 -> -------------------------------------------------------
19:55:34.229 -> Running Test Case "TestGetCurrentTrack"
19:55:34.229 -> -------------------------------------------------------
19:55:34.229 -> [20151] Packet sent (->): 7E FF 6 C 0 0 0 FE EF EF -> Cmd: C (Reset), arg: 0
19:55:35.190 -> [21100] Packet received (<-): 7E FF 6 3F 0 0 2 FE BA EF <- Msg: 3F (StorageDevices), arg: 2
19:55:35.190 -> Callback OnCardOnline: 2
19:55:36.416 -> [22311] Packet sent (->): 7E FF 6 7 0 0 0 FE F4 EF -> Cmd: 7 (SetEQ), arg: 0
19:55:36.515 -> [22422] Packet sent (->): 7E FF 6 1A 0 0 0 FE E1 EF -> Cmd: 1A (SetDAC), arg: 0
19:55:36.780 -> [22683] Packet sent (->): 7E FF 6 6 0 0 1 FE F4 EF -> Cmd: 6 (SetVolume), arg: 1
19:55:36.846 -> [22744] Packet sent (->): 7E FF 6 9 0 0 2 FE F0 EF -> Cmd: 9 (SetPlaybackDevice), arg: 2
19:55:37.045 -> [22955] Packet sent (->): 7E FF 6 F 0 1 2 FE E9 EF -> Cmd: F (PlayFolderTrack), arg: 258
19:55:37.244 -> [23155] Packet received (<-): 7E FF 6 40 0 0 3 FE B8 EF <- Msg: 40 (Error), arg: 3
19:55:37.244 -> --------------
19:55:37.244 -> ERROR 3
19:55:37.244 -> --------------
19:55:39.066 -> [24966] Packet sent (->): 7E FF 6 4C 0 0 0 FE AF EF -> Cmd: 4C (GetCurrentTrackSD), arg: 0
19:55:39.166 -> [25076] Packet received (<-): 7E FF 6 4C 0 0 1 FE AE EF <- Msg: 4C (GetCurrentTrackSD), arg: 1
19:55:39.166 -> [25087] Packet sent (->): 7E FF 6 16 0 0 0 FE E5 EF -> Cmd: 16 (Stop), arg: 0
19:55:39.199 -> -------------------------------------------------------
19:55:39.199 -> Test Case "TestGetCurrentTrack" FINISHED
19:55:39.199 -> -------------------------------------------------------
19:55:39.199 ->
19:55:39.199 ->
19:55:39.199 -> -------------------------------------------------------
19:55:39.199 -> Running Test Case "TestTrackFinishedCallback"
19:55:39.199 -> -------------------------------------------------------
19:55:39.232 -> [25148] Packet sent (->): 7E FF 6 C 0 0 0 FE EF EF -> Cmd: C (Reset), arg: 0
19:55:41.352 -> [27259] Packet sent (->): 7E FF 6 7 0 0 0 FE F4 EF -> Cmd: 7 (SetEQ), arg: 0
19:55:41.451 -> [27370] Packet sent (->): 7E FF 6 1A 0 0 0 FE E1 EF -> Cmd: 1A (SetDAC), arg: 0
19:55:41.716 -> [27631] Packet sent (->): 7E FF 6 6 0 0 1 FE F4 EF -> Cmd: 6 (SetVolume), arg: 1
19:55:41.782 -> [27692] Packet sent (->): 7E FF 6 9 0 0 2 FE F0 EF -> Cmd: 9 (SetPlaybackDevice), arg: 2
19:55:42.809 -> [28703] Packet sent (->): 7E FF 6 F 0 1 2 FE E9 EF -> Cmd: F (PlayFolderTrack), arg: 258
19:55:43.008 -> [28903] Packet received (<-): 7E FF 6 40 0 0 3 FE B8 EF <- Msg: 40 (Error), arg: 3
19:55:43.008 -> --------------
19:55:43.008 -> ERROR 3
19:55:43.008 -> --------------
19:55:44.797 -> [30714] Packet sent (->): 7E FF 6 4C 0 0 0 FE AF EF -> Cmd: 4C (GetCurrentTrackSD), arg: 0
19:55:44.929 -> [30824] Packet received (<-): 7E FF 6 4C 0 0 1 FE AE EF <- Msg: 4C (GetCurrentTrackSD), arg: 1
(This is the complete output, after waiting for about 10 minutes; the ALL TESTS COMPLETED
message doesn't appear.)
Additional info: when trying to talk to the DFPlayer using https://github.com/ShrimpingIt/micropython-dfplayer (Micropython) with the exact same hardware layout, I manage to find the player and issue a play command that sometimes results in the player playing the first song completely, but often stops it after just a few seconds. Changing volume or other commands don't work at all with that library.
Final piece of information: I am powering the DFPlayer with 3.3V
So, am I dealing with a broken piece of hardware? Or does mine have a chipset requiring a new driver? The chip says MH2024K-16SS and has 16 connectors (like the photo in #5), but there's no mention of 'MH ET LIVE' anywhere.
Final piece of information: I am powering the DFPlayer with 3.3V
I just did the same test from an Arduino Mega (5V) with the exact same results.
Also, using the DFRobotDFPlayerMini library, I get the same results as with Micropython on the ESP: I can play mp3 files from the SD card, but not change the volume or anything else. Also, the library complains that the connection failed, but still manages to get the module to play an mp3 file - reliably.
A guess: is it possible that this chipset speaks another serial language with the play
command being he same command as with the protocol we already know simply by chance? Let me hunt for a datasheet...
Seems that the player has trouble to receive the command messages sent via UART. Error mentioned 0x40 with code 0x03 means "Serial receiving error(a frame has not been received completely yet)" according to this spec document. Might be the player hardware is really broken or the communication channel has a lot of noise. Do you have that 1k resistor (and nothing else) between your MCU sending pin and the RX pin of the player?
Hm. Well, the 1k resistor (and nothing else) is indeed where it's supposed to be. I'm not sure about the noise, but the components are next to each other on a breadboard, so that seems unlikely, doesn't it? About the broken component suggestion: I got a couple at once, and tried with a freshly unpacked one, giving me the exact same output.
(I also tried without the resistor, but the output remains identical as posted above.)
By the way - but this perhaps requires a new issue - I also saw that I got a few with a completely different chipset: GD3200B. Whenever I replace a DFPlayer with a MH2024K-16SS with one of those, I get no serial communication in or out whatsoever (identical breadboard wiring).
Thanks for the quick reply!
Both chips, MH2024K-16SS and GD3200B seem to be quite new on the market. At least "Google research" doesn't reveal that much hits with those chipnames. Here's one thing I found pretending it's possible to get GD3200B to work: https://www.thebackshed.com/forum/ViewTopic.php?TID=11977&P=2#164416
If I interpret it correctly it's said to work without the resistor...
What's bugging me is that in #5 seisfeld managed to run an almost successful test with the same MH2024K-16SS chip, so I'm still guessing issues with serial/UART communication in your setup. Do you have a scope or a logic analyzer to dig deeper into what's going on on protocol level? What's also possible is timing issues in the current SoftwareSerial implementation. So it might help if you use HardwareSerial of your board. However, then you'd need some more tricks to get the normal Serial log output...
I'm sorry for not replying sooner. Because of the urgency of the project, we have meanwhile simply purchased DFPlayer components known to simply work... :-/
As far as I'm concerned, this issue can be closed, or it could be left open to invite others to contribute into taming these apparently newer editions of the DFPlayer.
Thank you very much for your input!
Very good idea :-) Doesn't make sense to poke around with some new fancy hardware if a working model just is 2 bucks.
Thank you very much for filing the output for that chip version. At least now it's documented what people can expect (or not) from that MH2024K-16SS chip version...
Hi, I just tried this and got the same report.
I also found this on amazon..
Each value represents one property:
// These values playing the first file on the Micro-SD-Card
"0x7E" => Start-Byte
"0xFF" => Version-Information (always "0xFF")
"0x06" => the number of bytes after "Len", Checksums are not counted
"0x03" => Command
"0x00" => Command feedback, "0x00" no feedback, "0x01" feedback
"0x00" => Argument 1
"0x01" => Argument 2
"0xFE" => Checksum 1 (high data byte)
"0xF7" => Checksum 2 (low data byte)
"0xEF" => End-Byte
The checksum is calculated like this:
Sum up every value from (including) "Version-Information" until (excluding) "Checksum 1"
Convert the result into an decimal value
multiply it by "-1"
Convert the result back into a hex-value, signed 2's complement
For the value above it is:
0xFF+0x06+0x03+0x00+0x00+0x01 = 0x109
0x109 = 265
265 * -1 = -265
-265 = 0xFEF7 (as signed 2's complement)
FE
is the high data byte and
F7
is the low data byte.
i'm no expert at this though. Hopefully it might help with the communication issues?
I've also tested the MH2024K-16SS
and the test hang up on Running Test Case "TestTrackFinishedCallback"
I'm using arduino mega with Serial1
(DFMiniMp3<HardwareSerial, Mp3Notify> player(Serial1);
)
Also I've commented the:
// if (_serial.overflow()) {
// #ifdef DEBUG_DFPLAYER_COMMUNICATION
// Serial.print("[");
// Serial.print(millis());
// Serial.println("] Overflow on UART buffer for DFPlayer. Flushing...");
// #endif
// _serial.flush();
// }
Because of DFMiniMp3.h:89:17: error: 'class HardwareSerial' has no member named 'overflow'
I also have a MH2024K-16SS chipset and I confirm the following:
- volume command doesn't work (but I can get current volume and decrease/increase with a while loop combined with the decrease and increase volume commands...)
- I can play a random music, but I can't play a specific one.
I've tested with an arduino nano with a 1kohm resistor on the rx pin (and without).
Do you know if someone managed to make it work? What's the working chipset (I ordered a dfplayer, I don't want to receive the same component again...)
I'd recommend either YX5200-24SS or MH2024K-24SS.
Thanks, I've done some investigations after my message and that was also my conclusion (with a small preference for the YX5200). I need to find a place where I can buy them now... The photo of the product indicated a MH2024k-24SS...
Good choice.
Some further notes if you like poking around with the existing chip. Found some entries in a German forum that state they've made MH2024K-16SS work with some changes in the DFMiniMp3 lib: https://discourse.voss.earth/t/dfplayer-verschiedene-versionen/681/167
Good luck!
Wow, thanks for the link. I'm testing the patched version right now and it's now possible to set the volume (cmd 6), that's an improvement! I'll test the other features (for now, playMp3FolderTrack always plays the same track but maybe other functions will work)
After comparing the versions, the only change is that the checksum bytes are not sent. The packet is smaller.
The playFolderTrack
function seems to be working. https://raw.githubusercontent.com/bkk87/DFMiniMp3/1.0.7-noChecksums/src/DFMiniMp3.h
This deserves more visibility... thanks @bkk87
edit: I don't receive the OnPlayFinished events, but it looks like it's because of a different code (0x4c).
@MaximeCheramy exactly, thanks for the follow-up! I have added both fixes in a separate branch:
https://github.com/bkk87/DFMiniMp3/blob/1.0.7-noChecksums-fixcase/src/DFMiniMp3.h
Thanks, I've done some investigations after my message and that was also my conclusion (with a small preference for the YX5200). I need to find a place where I can buy them now... The photo of the product indicated a MH2024k-24SS...
The situation is, the chip that aaaaall these DF Player modules built on for several years, is EOL. It came from Jieli and they don't make it anymore. So all these companies now have to switch to another Chip and (as it seems) have to rebuild the firmware. To make things even worse, Players with the same marking on the chip currently don't have guaranteed the same firmware version. So it's a little hit and miss currently.
Since our community was mentioned here already, here is what chip markings we have seen so far:
Old Chip | New Chip | Unknown |
---|---|---|
YX5200-24SS | MH2024K-16SS | YX6200-16S |
MH2024K-24SS | GD3200B | |
DFROBOT LISP3 | ||
JL |
If you can still get your hands on the ones in the first column, consider yourself lucky. They are more and more harder to get. Especially since shops have still images of the old ones online but the stock is actually with the new ones...
Just wanted to thank all involved with documenting and tracking the issues with disparate chips. Every Arduino forum contributor I read dismissed the OP's description of the symptom, if not well described, due to unfamiliarity of technical or programming knowledge. The library from @bkk87 worked as expected with the MH2024K-16SS chipset and saved me time from having to order a replacement.
What I have observed also with MH2024K-16SS it hangs randomly when song finish. Busy pin sometimes doesn't correspond to the real play status. This chip also will play last played song after invoking advert from stop/pause state.
Hi,
I've bought similar module from here. I made the project on PIC18 of Microchip to control this module but experienced with issue of volume adjusting. When sent volume command with value the module returned communication error. So, i contacted the seller with this issue and he sent me the datasheet and code examples of this module. All in Chinese, but no problem, Google translate translates it easy. From datasheet i learnt that all commands can be accepted by module without checksum also. So, i tried it with volume and it worked. The datasheet can be downloaded from here
Cheers,
-
With checksum:
7E FF 06 06 00 00 1E FE D7 EF -
Without checksum:
7E FF 06 06 00 00 1E EF