i want to test the example compText, but my serial output gives me back
for the example i use TX on pin 1 and RX on pin 2
1.Download the hmi file to your nextion by nextion editor with a usb-ttl board.
2.Download the ino file source code to your arduino mega.
3.Conect nextion display and mega:
TX → RX2
RX → TX2
4.If you use arduino UNO, there is no "db_serial".
TX → RX2
RX → TX2
yes i still get the problem :
using CompText example ?
i tried all the other TX/RX option and they all generate the same problem. ? Is my screen defective ?
I have the same problem!!!! Any solution??
Thanks for your reply Bryan. I am new to Arduino and was following old documentation in regards adding libraries to the IDE. I manually added the nextion library to the library folder in ProgramFiles (x86)\Arduino\libraries. After adding the library the proper way ( using the IDE ) I noticed they get saved in MyDocuments\Arduino. After saving the project to a folder within this directory all worked. The library within ProgramFiles (x86) is read only and didn't add the nextion library properly and therefore couldn't see the "Nextion.H" include. Thanks for the advice though as I will be needing to do this by the end of my project.
Hi I cant make this work either on a Mega
I can write to Nextion but not read
Is there a way to assign nextion to Serial2 on mega?
SoftwareSerial nextion(19,18);// Nextion TX to pin 19 and RX to pin 18 of Mega
Nextion myNextion(nextion, 9600); //create a Nextion object named myNextion using the nextion serial port @ 9600bps
I have the problem too. The solition "operr" suggested on youTube did not work for me, as my nexconfig.h uses HMSERIAL for use with Arduino Uno board.
I was able to get my nextion projects to work well, after I switched to using MEGA 2560 boards, which I need for reliable hardware UART to the Nextion, debugging my code, and easily re-upload new .ino projects. What you are doing with TWO mega boards - I do not know, but doubles your troubleshooting errors, maybe try one board get it to work first.
I had to build my own debugging and test interface shield between the Arduino 2560 and the Nextion, since I constantly re-adjust my code and re-test it. That means making a hardware switch to change the pins from Nextion to Arduino, - to an FTDI usb serial port where I could update the Nextion firmware. Without that, you have to pull pins off a breadboard every time you want to change code and debug.
To assign "serial2" to nextion:
#define nexSerial Serial2 nexSerial.begin(9600); // Nextion terminal nexInit();
For the random "recvRetCommandFinished err" problems, is a timing issue. My code was busy processing data for something else and aparently the nextion got impatient waiting for reply, or something technical. I troubleshoot those issues by isolating my code to a small project and testing each function and each line of code to nail down the "ERR". If you specify where exactly you get the problems in this forum on a new thread, I am sure someone can help.