Hello,
I am working on a project with a Nextion display, but I can't seem to get the Arduino to communicate with my Nextion screen at all. I am using an Arduino Mega (name brand) with a 5" Nextion Enhanced display. I have wired the Nextion to the Arduino via Serial1 (ports 18/19), and I am powering the display directly from the Arduino as well (I have attached an image of my setup below). I checked connectivity on all the wired connections.
I am just trying to change the word "Vacation!" to "hello" (in a simple text box, named t0), using the command t0.txt="hello" terminated properly with three 0xff. Below is my very short script.
//Created as a Nextion communication test
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("Sending Change Message to Nextion");
Serial1.begin(9600);
delay(500);
Serial1.print("t0.txt=\"hello\"");
Serial1.print(0xFF);
Serial1.print(0xFF);
Serial1.print(0xFF);
}
void loop() {
}
The Serial print statement shows up fine on my computer, but the text box on the Nextion won't change. I have tried a second Arduino, tried using Serial2/3, and I even tried another Nextion (a 7" enhanced). Nothing is working. I have also tried to send information from the Nextion to the Arduino (Send Component ID), but I haven't been able to read any incoming info. I have tried a bunch of other stuff like changing the message I send to the Nextion and even adjusting the baud rate (to my knowledge it defaults to 9600), but none of these fixes are working either.
I have sorted through many forum posts about this, and I am basing my test code off of this excellent tutorial: Using Nextion displays with Arduino - Displays - Arduino Forum.
Any pointers would be greatly appreciated. I have also attached a picture of my nextion editor to show the names of the text boxes.
Thanks in advance! Let me know if you need more information.
Andrew