Start a new topic

arduino mega and serial communication problems with Nextion

Hi All,


I have read through a lot of discussion topics around the rx/tx connections and saw a lot of people were having trouble getting their Arduino mega 2560 to work with their Nextion.


I had library configuration issues and did finally get things corrected so all the examples from the ITEAD Nextion library working properly.   When trying to test some of the examples I keep getting the recvRetCommandFinished err which tells me the serial communication is not working.


I have not changed anything in the NexConfig file.  I have tried using every hardware port imaginable.  A really dumb question but how does the Arduino/nextion know what port we are using?  In  the serial software approach, I an specify the ports when initializing it.


After reading the blogs, I have tried most everything,  even ensuring the grounds are wired together.  I am thinking this should not be this difficult.  There is a wealth of information on these sites and I am struggling getting this thing to work.


Also, in the CompPage example the compiled HMI is on the SD card.  It loads perfectly on the Nextion.  No errors and says 100% completed and Successful.  It stays on that screen and does not do anything.  Shouldn't these examples load a page on the Nextion?


Any ideas / help would be truly appreciated.



In a Nutshell.  Nextion is a serial device, as such requires an RX /TX line.  Some basic understandings of serial, basic electronics, and programming abilities do help.


The default settings in the Iteadlib Arduino Nextion Library are configured for Mega on Serial2

The default wiring should be

    Nextion TX    to   Mega RX2

    Nextion RX    to   Mega TX2

    Nextion GND to   Mega GND

If your MCU (Mega in this case) cannot provide sufficient current (most cases)

It becomes necessary to supply Nextion 5V from separate 5V supply and not from Mega 5V

The Datasheet for the Nextion upto 5" recommends a 5V 1A supply.  7" recommended 5V 2A


Not all USB-TLL adapters are created equal.  Prolific has been reliable for me.


Thank you Patrick.  I have read many of your posts and do appreciate your knowledge as well as your dedication to the subject.  I will go back and check everything but I do believe I am configured correctly but you never know.  I did check the power to the Nextion from my Mega and it is 5V.


I know this is something silly but I will keep cranking away.  I started my control system for m smokehouse and  thought I would spend a lot of time with the thermocouplers, PID, Servos, or Selenoid.  To my surprise most of my time is with the Nextion/display.  I know once I get it working, I will have no trouble making it do what I need.  The instruction set and thousands of examples make this so nice.


Thanks again and I will post once I figure it out.

Login or Signup to post a comment