Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Nextion Upload Support #86

Closed
GitLer90 opened this issue Oct 22, 2018 · 29 comments
Closed

Feature request: Nextion Upload Support #86

GitLer90 opened this issue Oct 22, 2018 · 29 comments
Assignees

Comments

@GitLer90
Copy link

I am quite often using Nextion Displays in Projects with the ESP32.
So when I want to update the firmware of the ESP, that often includes new firmware for the Touchscreen.
It is already possible to upload the new compiled .tft-File to the Display via the ESP using the NexUpload.h from the official Nextion Arduino Library (When the file is already stored on the hardware/SD-Card in your system).

It would be an awesome feature for future releases, if you could not only upload a new .bin file to the ESP but also upload a new .tft file to the Nextion via your Webservice =)

@Onno-Dirkzwager
Copy link
Collaborator

Onno-Dirkzwager commented Oct 23, 2018

@GitLer90
I think this is an awesome idea! Would you be willing to help? Testing, documenting etc.

  • which version do you have?
  • do all versions support the nextupload.h?
  • on average how large do you expect the .tft files to be?
  • Maby we can store them in spiffs...

@GitLer90
Copy link
Author

@Onno-Dirkzwager
Sure I would like to contribute! =)

which version do you have?

What do you mean? Arduino IDE? Nextion Editor? Itead Arduino Lib?

do all versions support the nexipload.h?

Same thing^^

on average how large do you expect the .tft files to be?

That depends mostly on how many pages and background pics you have. Mine are around 1-5 MB.

@Onno-Dirkzwager
Copy link
Collaborator

Onno-Dirkzwager commented Oct 24, 2018

@GitLer90
As I dont have one yet.....

  • Which version Nextion Display do you have.
  • Do all current Nextion displays support the nextupload.h method of uploading .tft files

@GitLer90
Copy link
Author

@Onno-Dirkzwager
I currently use the 3.5" Basic Version (NX4832T035).
But yeah, all Nextion Displays support the NexUpload, since the Itead Nextion Arduino Lib is the same for every model. =)

@Onno-Dirkzwager
Copy link
Collaborator

@GitLer90
ok thankyou for the suggestion and information. I think this is a great idea. Ill leave this issue open and contact you somewhere in the future for testing, further questions, etc

@Onno-Dirkzwager
Copy link
Collaborator

@GitLer90
Good news! I received my Nextion and proved to myself in a test sketch that we can update it OTA using IAS. It will take an other few weeks to implement it correctly in our library and web service. But it is coming!

@Onno-Dirkzwager
Copy link
Collaborator

Onno-Dirkzwager commented Nov 18, 2018

@GitLer90 and to all other people who want to test ota updates to their Nextion Display

Comment your IAS username below
And we will add a nextion upload field to your account so you can test ota updates to your screen.

All users now have access to this field!

@GitLer90
Copy link
Author

Wow, great news!
My username: KIMETO

thank you!

@Onno-Dirkzwager
Copy link
Collaborator

@GitLer90 do you have an 8266? or only 32's

@GitLer90
Copy link
Author

@Onno-Dirkzwager Only ESP32's

@Onno-Dirkzwager
Copy link
Collaborator

@GitLer90 I hope to have the ESP32 version ready by friday

@Onno-Dirkzwager
Copy link
Collaborator

@GitLer90 Which nextupload library are you using on the esp32?

@alighadyali
Copy link

This would be awesome.

My username is alighadyali

Thanks!

@Onno-Dirkzwager
Copy link
Collaborator

Onno-Dirkzwager commented Nov 25, 2018

I have run into some problems and out of time while developing the ESP32 version for OTA updates.

For those using the ESP8266:
https://github.com/iotappstory/ESP-Library/tree/nextion-beta

@GitLer90
Copy link
Author

I have run into some problems and out of time while developing the ESP32 version for OTA updates.

For those using the ESP8266:
https://github.com/iotappstory/ESP-Library/tree/nextion-beta

@Onno-Dirkzwager Hm, does that mean the ESP32 Version will take longer?
I don't have ESP8266s to test it.

@Onno-Dirkzwager
Copy link
Collaborator

@GitLer90 @alighadyali
I added the Nextion upload fields to the "My Apps" page.
You can add .tft files below the sketch and spiffs files.

Repository owner deleted a comment from GitLer90 Nov 29, 2018
Repository owner deleted a comment from GitLer90 Nov 29, 2018
Repository owner deleted a comment from GitLer90 Nov 29, 2018
Repository owner deleted a comment from GitLer90 Nov 29, 2018
@richardlong-code
Copy link

Hi Onno, from testing the 8266 version (with the extra yield() just before initiating the connection to the display, I have seen a couple of issues:

  1. Following multiple uploads, the SPIFFS is reported to be full, which causes an error in (I think) the ESP NexUpload lib (insufficient space) while transferring the file from IAS.

  2. Sometimes the sketch crashes at the point of beginning upload to the display from the ESP. The cause seems to be 'Soft WDT' so I'm looking for a good place to insert another yield() at this point.

The yield() seems to improve the chances of being able to update the Nextion display multiple times, but when the sketch reboots, the display hangs as you observed (and needs power cycling). I seem to get to about 7 or 8 updates without physically touching the display before the crash occurs.

If it helps I will experiment with serial.print() debug messages to see how far it gets through the NexUpload lib and also display the free space at the beginning of each call.

I thought it might help if I share this here do that anyone else who may be looking at this might also see what is happening.

Really useful extension to IAS, hope this helps.

@Onno-Dirkzwager
Copy link
Collaborator

I updated the nextion-beta branch

  • removed SPIFFS storage all together
  • direct serial upload to the Nextion from the wifi client
  • added yields on top of most functions

@richardlong-code
Copy link

Thanks Onno, I've been testing again, just using the VirginSoil example and just effectively the update process.

By and large it seems to work pretty well now but I've seen a couple of instances where the display seems to have corrupted data, I'm not certain, but I think I can reproduce the cause.

Now that SPIFFS isn't used in the update process, the update upload to the display starts pretty much immediately (very welcome!).

I believe I caused corruption of the upload by uploading a new Nextion firmware onto the IAS control panel while the update was taking place. I thought I should raise this in case the process is used also in sketch upload, which would be less easy to recover?

I'll start playing with this in a real sketch now. 👍

@richardlong-code
Copy link

richardlong-code commented Dec 29, 2018

Hi @Onno-Dirkzwager , I've been using this for a couple of weeks now and today seem to be getting some issues, which look more like IAS is getting confused than the sketch (I'm sure I'm wrong, but I'll try to explain what I do and how I end up fixing it).

I have one active project that uses Nextion and I've been developing it for a while, for the most part not touching the TFT file and just uploading new sketches. Today, when replacing the sketch .bin file on IAS, on the next reboot, I get the Nextion 'white screen' briefly showing it is being uploaded to, before a message saying the screen type doesn't match and a (screen) hang. The sketch then continued as usual, albeit with a non-working screen.

Any subsequent reboot (removal and reinstatement of power) of the target went back to the same state (i.e. trying to get the TFT file again) and all the time, the screen would power up with the existing TFT file still present.

The only way I could fix it was to delete the project and app and start again in IAS, I didn't delete the device.

Some observations your consideration:

  1. It isn't possible to delete a Nextion firmware once it is on IAS (while it disappears from the App pane, it returns when you reopen the app pane)
  2. IAS forgets that there is no Nextion firmware and defaults to a blank entry (requires the user to delete the entry every time a sketch is uploaded)
  3. When it was getting 'confused' IAS reported that the sketch either didn't exist or was incompatible.

I should add that I saw this twice with two different sets of app, project and hardware - the other wasn't a Nextion enabled sketch, but it seemed to become inaccessible in the same way.

Hopefully this all helps in some way. :-)

For now I've set up an app without the Nextion firmware included as that particular app controls our central heating, hehe.

@Onno-Dirkzwager
Copy link
Collaborator

@abs-zero-ian This nextion beta uses a different update address as the normal version. And I think your errors have something to do with me editing this file and adding md5 support for file verification (is an update necessary or not)

@Onno-Dirkzwager
Copy link
Collaborator

@GitLer90 @alighadyali @abs-zero-ian @msiebuhr @Nredor
We finally released a new beta that supports both the ESP8266 and ESP32!

https://github.com/iotappstory/ESP-Library/tree/nextion-beta

It is no longer necessary to get on the test list.
All IOTAppStory users can now use upload Nextion files in the Control Panel!

@Onno-Dirkzwager
Copy link
Collaborator

@GitLer90 @alighadyali @abs-zero-ian @msiebuhr
@Nredor accepted my pull request. You can now find the ESPNexUpload in the Arduino library manager!

@JustusW
Copy link

JustusW commented Jan 9, 2019

Since there's no official repo for the page: I'd really appreciate if the Nextion upload thingy didn't require me to delete the superfluous upload field every time I change my app.

@richardlong-code
Copy link

richardlong-code commented Jan 9, 2019 via email

@Onno-Dirkzwager
Copy link
Collaborator

Hi @JustusW,
we fixed the version trash button (that forgot to delete on save)

Im not sure if this solves your issue let me know!?

@JustusW
Copy link

JustusW commented Feb 3, 2019

Hi @Onno-Dirkzwager,

It sort of did help, I still get the empty field and can't submit until I wrote something in there or deleted it, but it will at least stay filled in on subsequent submits. If you have any way of releasing your web code on Github I would happily assist you in evolving it forward.

@Onno-Dirkzwager
Copy link
Collaborator

Onno-Dirkzwager commented Feb 11, 2019

@JustusW
saw this last message a little late. But this is also fixed as I ran into it as wel.

This nextion field was for the beta testers. And this part of the page will be replaced in the future.

We would appriciate your help. But are not set up for this yet..... Are you on our discord channel? Would be nice to have a chat on this topic.

@GitLer90
Copy link
Author

Thank you! It works now! =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants