Nextion communication with arduino mega 2560 suddenly went off

Hi guys, this code below is the code I ran in my arduino with proper wiring. When I ran it for the first time on my nextion NX3224F024_011, It worked. then when I adjust the device in the editor to go wih NX8048K050_011, and connected properly. it didn't work. then when I open a new file and did the same thing, it didn't work as well. When putting it again in my NX3224F024_011, it didn't work as well.

#include <EasyNextionLibrary.h>

// Create an EasyNex object
EasyNex myNex(Serial1);



void setup() {
  // Begin serial communication with the Nextion display
  Serial.begin(9600);
  
  // Initialize the EasyNex library
  myNex.begin(9600);
  delay(500);
  myNex.writeStr("t0.txt", "Hello");
}

void loop() {
  // Listen for events from the Nextion display
  myNex.NextionListen();
}

Arduino | Nextion
GND | GND
RX | TX
TX | RX
5V | 5V

HELLO.zip (18.3 KB)

I have uploaded the file here. Please help me. I don't what to do. I even change the wires with the same connections

@cattledog pls help

What do you see if you take the delay to 2000.
In this previous thread, I did not get good results at 500.

https://forum.arduino.cc/t/nextion-communication-with-arduino-mega-2560/1322115/3

I still couldn't get it.
Its still blank

Have you selected the correct Device ID for the Nextion that you are using?

I can't see anything wrong with the HMI file, and indeed if you go into debug and type t0.txt="Hello" into the instruction panel the text does change.

the device id is the same. I checked alrdy. i still don't know why. Could be any problem with the nextion or arduino??

You can try with Serial2 or Serial3 which use different pins incase you have damaged Serial1.

it worked.
Thank you

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.