.hmi file not uploading on Nextion display

Hello,
I am trying to interface Nextion display NX4827T043_011 to my Arduino MEGA.
I have used Nextion Editor to design the GUI which shows no errors when i compile it or debug it. However when I try to upload the code on the display the error "The device doesnt recognise the command" occus (image attached below).

I am using the file "SerialThruHardwareSerial.ino" of NeoNextion library to upload the .hmi file to the touch panel.
I am using the ITEADLIB_Arduino_Nextion library.
Download link: GitHub - itead/ITEADLIB_Arduino_Nextion


Hello Usman1515,
Welcome to the forum.

How have you connected the Nextion to your PC?

I have never tried to upload a Nextion configuration file through the serial port, I am not even sure it's possible. Get a micro SD card, copy the hmi file to the SD card (there must be nothing else on the card), put it into the SD card slot on the Nextion and connect power. The file should upload in about 5 seconds. The Nextion display will show progress. Disconnect the power, take the card out, reconnect the power.

Don't bother with the Nextion libraries, they are not very good, they will give you hours of frustration. See my tutorial 'Using Nextion displays with Arduino'.

Come back if you get stuck.