Start a new topic

Uploading Nextion firmware thrugh Arduino MEGA USB.

 Hi,


I was wondering how a tft file could be uploaded using the Upload sketch for Arduino.

By checking the constructor of the nexDownload class I can see that the second argument is the SD card pin. I assume that an SD card reader should be attached to the Arduino board.

My question is, is it possible to upload the tft file via Arduino USB without the use of an SD card attached to the Arduino board.


Thank you in advance.


The link to the blog post publishing the Upload protocol is in the thread Tools, Tips, Tricks and How-TOs in the Nextion Gallery.  So there isn't any mystery to the upload.  Some ESP users have allotted 1/2 of SPI flash spiff file system to retrieve the full TFT file and then upload from there once the TFT has been confirmed valid.   Many things will come into play for Upload.


Serial timeouts will be probably the biggest one, so one has to be certain that there will be no breaks in the upload process, with only a small delay between the 4K chunks of the TFT (Nextion will be writing to its SPI flash at this time).  So if you can establish your method so as to not hinder the flow from start to finish ... then yes, it may be possible.  Nextion Editor itself uploads via serial (typically through a USB-to-TTL Adapter)  But as operating two serials simultaneously on Arduino often proves a challenge (Arduino is not typically multitasking), then you will appreciate why SD is a good way.

Just for clarification:

The IteadLib Arduino Nextion Library does not have a nexDownload class.

Typo? or does this come from someone other?


So, if I understand that right, a two step process could be used to upload a tft file to Nextion via Arduino's USB. First step to upload the tft file to the arduino SD card and then execute the Upload sketch to upload from the SD card to Nextion.
I understand that the easiest way is to upload directly by inserting the SD card to Nextion but if the device is inside an enclosure the SD card slot will not be accessible and so the only possible way would be through Arduino's USB which could be accessible form outside the enclosure.

That is the reason I created this post.

 

Yes, that's a typo. I meant NexUpload.

 

Not the only possible way. 

An ESP8266 is Wifi.  use a large SPI Flash, Bluetooth ...

I would also think a quick uninterrupted serial process could be doable.

Mega has certainly has limited resources, but certainly not impossible.

Sounds like a good idea. I think i will investigate that possibility.

Thanks Patrick!

 

Just to further add another method with ESP8266


It is possible to upload the TFT file, even if it's location is on a remote server. As long as ESP knows beforehand, the IP address and the file name, and this can be done in one seamless operation on the fly.

There is no need to copy to local (ESP Spiffs), the ESP can do a direct transfer from Server to Nextion and only needs a 128 byte buffer to do so. Which is pretty neat :)

I have the same problem. My Nextion display is in an enclosure with an Arduino Uno, which uses a software serial to the Nextion display. On the Nextion I have a button that puts the Uno in a mode to transfer data to/from the Nextion from/to the hardware serial port. After that I set the Nextion Editor to 9600 baud, and I'm able to upload to the display. It is, of course, very slow.

 

Login or Signup to post a comment