Monitoring hardware serial communications on ESP32

Hi guys,

So, previously I have built a successful project using a Nano and DFPlayer mini with softwareserial and the DFPlayerMini_Fast library.

I just got an ESP32 to play around with and as a learning exercise I want to set up a simple MP3 player using hardwareserial. Since the DFPlayer library handles the communications under the covers, I would like to be able to see what is actually being sent and received between the library and the DFPlayer.

So my question is, is there a way to have the TX and RX data that is sent over hardwareserial also sent to the regular serial monitor without adversely affecting the communications to the DFPlayer?

I have tried Googling this, but apparently I don't know enough to even search for the right thing.

Thanks.

The serial monitor is on hardware serial only, so that puts you back to square one. Other than that, it sounds reasonable to me. If you were going to have any adverse effect on comms, it would be already with you because you are using software serial. IF the monitor is only used as to look, no keyboard, you could have both items on hardware serial. You will have to disconnect the player when uploading your programme.

Nick_Pyner:
The serial monitor is on hardware serial only, so that puts you back to square one. Other than that, it sounds reasonable to me. If you were going to have any adverse effect on comms, it would be already with you because you are using software serial. IF the monitor is only used as to look, no keyboard, you could have both items on hardware serial. You will have to disconnect the player when uploading your programme.

Thanks for the information. I really appreciate it. Sorry I forgot to detail this. The ESP32 apparently has 3 hardware UARTS. My plan was to use hardware serial 2 for the DFPlayer. I guess I was wondering if there was a way to kind of "bind" serial 2 to the serial port which is serial 0 (I believe), so that whatever was transmitted or received on 2 would be displayed on the serial monitor.

Why not look at the library code here and the DFPlayer manual here.

I didn’t know ESP32 had three ports. I really can’t see you having a problem reading one and regurgitating out the other. It’s just a case of
Serial.println(ladedah);
but I don’t know anything about the data you are handling. You have already got it working and what I’m sure of is, if Arduino can receive it on one serial port, it can surely send out one of the others.