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.
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 :)
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.
Just for clarification:
The IteadLib Arduino Nextion Library does not have a nexDownload class.
Typo? or does this come from someone other?
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.