DFPlayer checksum


#1

Hi,
I need help solving a mystery.
I can not send commands (serial) to the DFPlayer mp3 module. The format of the commands is in hex, two of them, consisting of checksum, according to the example (Arduino) below:

checksum = FF+06+0E+00+00+00=113(in hex)
checksum = 0 - checksum=0-113(113 is hex data)=FFFFFFFEED
then 4 end words is your checksum
FE, ED

Zerinth:
checksum = 0 - (0xFF+0x06+0x0E+0x00+0x00+0x00)
checksum = -275 ??

Another problem that is occurring is that the module, once it is turned on, should send (serial) a status phrase in hex [7E FF 06 3F 00 00 02 xx xx EF], but it does not work. 


#2

Hi cesarbudaye,

If you want to see int numbers in hex format you have to use the hex() function:

hex(-275) = 0xFEED
Regarding the serial issue, you can use the <a href="https://docs.zerynth.com/latest/official/core.zerynth.stdlib/docs/official_core.zerynth.stdlib_streams.html#streams.available" title="Link: https://docs.zerynth.com/latest/official/core.zerynth.stdlib/docs/official_core.zerynth.stdlib_streams.html#streams.available">available() method</a> and, consequently, the <a href="https://docs.zerynth.com/latest/official/core.zerynth.stdlib/docs/official_core.zerynth.stdlib_streams.html#streams.read" title="Link: https://docs.zerynth.com/latest/official/core.zerynth.stdlib/docs/official_core.zerynth.stdlib_streams.html#streams.read">read() method</a>&nbsp;to receive the "status phrase" from DFPlayer.<br><br>If this doesn't help you, try to put your code inside a try-except block to see if an exception occurred or post me your script so I can better understand how DFPlayer works.<br><br>Keep me posted :)&nbsp;<br><br>