Nextion display AND DFPlayer MP3 module

@ScruffR

Thanks for the answers. I was just curious about the speed given commands are going via a serial interface which is slower than SPI.

Do you think it is stable enough to develop upon? I dismissed it back in October 15 as too new and have gone down a route with LCD display and plug-in keyboard when input required (initial WIFI setup onsite).

@peekay123 - more processing power on the display would allow/support fancier segue between screens - I just dim the LED and redraw the screen then re lite the LED. Cost is the real issue - I am using 1.8" and 2.2" TFT SPI displays ST7735 and ILI9341 which I can source for US$4-5 each, really looking at the Nextion for touchscreen with low GPIO use and at a reasonable price. The SPI based small touch displays all seem to be expensive - $27 for a touchscreen display to SPI controller plus the display.

If you want to draw rather than use the HMI components on the devices you'd definetly need to go with a high baudrate (115200 is supported).
If you want some feel for the speed I could shoot you a video of some drawing action.
Another option for some speed might be the onboard scripting which cuts away the transfer time but only works for simple drawing tasks (loops have to be emulated with timers or unrolled, only simple if conditions, ...)

About stability, it depends on your expectations, but I never had any issues for what I used them.

Thanks - I will check the library and see how it works with different baud rates.

Hello friends,
if you want to try my photon-less MP3 player for 2.4" Nextion display, you can download this zip and give it a try.
Since there is no MCU involved, you might see some occasional timing issues and the play button doesnā€™t pop out once a file is played, but this might be a building block.

To play a specific song from the MP3 folder tap the SongNr input box (second top left) and type in the number and hit play.
If you want to try a folder loop (as discussed in the other thread) tap the FolderNr input box (first top left) and hit the loop button.
On the far right you have a volume control.

image

https://dl.dropboxusercontent.com/u/60050879/NextionMP3.zip
https://www.dropbox.com/s/vd2j1i09rkgojlr/NextionMP3.zip


Update: With the new Enhanced Nextion displays you can use the BUSY pin of the DFplayer module to provide ā€œfeedbackā€ about the playing state to the display.

2 Likes

Wow, thatā€™s fantastic @ScruffR! :+1:
I downloaded your zip allright, but my nextion may still be a few weeks from hereā€¦

Meanwhile can you give us a short instruction what to do with the different files?
And how to wire the module to the Nextion? (Photo?)

The .HMI file is the ā€œsourceā€ file for Nextion Editor.
If you open it with NE you can see how Iā€™ve done the communication by clicking one any component and look at the ā€œTouch release eventā€. And this way you can also alter the appearance of the controls by replacing the two .PNG files in the editor.

The .TFT file is the ā€œcompiledā€ output of NE which youā€™d only put on an SD card (root directory), pop that into the displays SD slot, power the display up and wait till the display reports ā€œUpdate successed!ā€ (yup, thatā€™s what it says :wink: ).
Then you take the SD out again and repower the display.

The wiring is easy.
The pins on the display are well marked (+5V red, TX blue, RX yellow, GND black).
Just connect TX/RX to RX/TX on the MP3 module, +5V to the Vcc pin and a 5V supply, GND goes to one of the GND pins of the module and the supply again and thatā€™s it.

2 Likes

Thanks @ScruffR, thatā€™s a short & sweet explanation.
Everything is ready to try it out when the postman ringsā€¦

Good interface!
:hand: :older_man:

1 Like

Hi @ScruffR!
The postman rung twice today:

He finally brought my 2.4" 320X240 Nextion USART HMI TFT LCD Resistive Touch Screen (Model: NX3224T024)

If your files above are applicable to this model, I will try out your combination with the DFPlayer MP3 module this weekendā€¦

Just want to confirm the connections you used:

DFPlayer        Nextion display
--------        ---------------
Rx                  Tx
Tx                  Rx
+5V                 +5V
Gnd                 Gnd

:older_man: :+1:

1 Like

Yup, the only thing missing in the wiring table is that you also need to connect the supply.

Obvious, but just for completeness :wink:

DFPlayer    Nextion display    Supply
--------    ---------------    ------
  Rx          Tx
 (Tx)        (Rx)                           // not really used
  +5V         +5V                +5V
  Gnd         Gnd                GND

These files should work since Iā€™ve done them for my display of the same type.

1 Like

I found some time this morning and eager to try out your combination, I followed above instructions and that's what I got:

I tried with several micro-SD cards:

First card (4Gb) contains a folder "Garmin", which I left in, because I need it later. Then I got this message.
Second (32Gb, overkill?) was still new, empty. I copied only your "MP3.tft" file onto it. Same result...

(PS: I do this on OS-X, which may create 'hidden files' in a volume/folder...)

:bow:

2 Likes

YES! All works fantastically! Good job @ScruffR !!!
The problem was indeed the hidden files on the cardā€¦
I removed them in VM Ware and tried again: ā€œUpdate successed!ā€
:hand: :open_mouth:

Update: Hereā€™s a photo of the music machine:

The Photon is just there for good company and to enjoy good musicā€¦
:wave:

3 Likes

Good to hear that it works for you too.

Itā€™s still a bit fragile in places (e.g. sometimes a play command is not immediately accepted), maybe removing the unused connection MP3 -> display and/or playing with delays in the display macros could help with possible timing issues.

But this is mainly a proof of concept anyway :wink:

Having the Photon in there with only one (:weary:) serial port available will be the next challenge.

It works without the moduleā€™s blue wire (Tx) indeed, but I donā€™t see any change in behaviourā€¦
As a proof of concept itā€™s of course a success!

If the display could be permanently connected to the Photon, we could also use it for other touchscreen functions.
That would be great!

For my projects it would be sufficient if I can use the touchscreen with the Photon for common control tasks, and then perhaps let it switch the display to the MP3 page to loop one of the selected folders in the background. One extra button on the screen could give control back to the Photonā€¦
Sounds easy, isnā€™t it?
But I have no idea how to do thisā€¦

Thanks anyway for this nice JukeBox!

What are the most problematic points with the current state of the project for you?

That very much depends on the intended interaction between Photon and display for your common control tasks
For a full fledged GUI you'd need bi-directional communication between the, but you only have one interface (well, a second you could free up with an soldering iron ;-))