ITEADLIB_Nextion published on Particle Build

I’ve just pushed a (work-in-progress) port of the ITEADLIB_Arduino_Nextion library to Particle Build (aka Web IDE) which was originally started by @Bspranger who kindly granted me the privilege to adapt it for Particle Build.

I dropped the Arduino in ITEADLIB_Arduino_Nextion tho’ :wink:

So it’s now ITEADLIB_Nextion on Particle Build - the demos now all build, but I haven’t acutally tested them on the displays.

Edit: For the time being the lib does contain some blocking loops that don’t work well with the cloud housekeeping, so you might need to go non-cloud-bound or use the SYSTEM_THREAD(ENABLED) (beta) feature.

6 Likes

I have a 5 inch Nextion display sitting here that I have not had time to play with yet but it looks nice and I’m happy the code for it and the photon are now in the library. Thanks for that :smile:

1 Like

When I get back to the nextion I will be sure to start from this fork. There is much that can be done to make it better/more complete.

2 Likes

This is great! Thanks @ScruffR. I was adding files manually as I played with this display and the tabs in the Web IDE soon became unreadable…

Welcome!
I just realized one “minor” issure of the current version: At the moment there are several places in the library that do have blocking loops, which does not work well with the cloud connection.
So for the time being you might have to go non-cloud-bound or use SYSTEM_THREAD(ENABLED) in the demos and your own code till I get round to adding Particle.process() wherever needed or someone files a PR for this :wink:

1 Like

OK, I’ve added some Particle.process() lines and republished :wink:

But now I seem to have not serial communication between the my display and the Particle.
Can anybody test this too, please?

Edit: Found the cause. The original lib seems to fail to call Serial1.begin()

I can’t find this in the Libraries. I’ve refreshed my browser and clicked the refresh Libraries button.

Is it possible you looked for it about half an hour ago?
Due to above errors I’ve pulled it off again, corrected the errors found and then republished it.

If it’s less than half an hour ago, you might have to

  1. got to the Particle Build settings (gear symbol), press CLEAR CACHE
  2. close Build and best your browser too
  3. reopen Build
  4. REFRESH LIBRARIES

then you should be able to find it.

Clearing the cache then refreshing the libraries worked, Thanks! :smile:

1 Like

I’ve still seen some occasional blocking (with subsequent cloud drop) when the serial communication to the display is bad.
But I’ve not got the time to dig into it any deeper for the rest of the week.

I didn’t notice any blocking issues, but I also didn’t have all the files included in my project yet. I’m going to create a new project and give your library a try. Were you able to load any of the example HMI files from the example folder on iteads git hub? I get some error about the resource file being corrupt.

My C skills are very bad, been a C# coder and very spoiled with the debugger in Visual Studio. But I’m willing to test it out and help if I can :smile:

@xcode post some feedback on how setting the screen up goes with this library if possible. I’m going to try to make a custom screen for the Nextion screen also but haven’t used the software yet although I did take a quick look at it.

I’m still not sure how the coding between the Photon and the screen works considering the Nextion software creates it’s own custom code. I didn’t find any good tutorials on how to this works, just some quick videos showing somebody flying through creating an example.

@RWB Sure thing. Have to head off to work now, but when I get back to this I’ll post my feedback. My first project with this screen was very simple but it was working :smile:

Yes, I've tried CompTimer and CompWaveform.
Have you got the most current version of NextionEditor (0.31) installed?

@ScruffR I got the current version (0.31) and just downloaded that same example and got the same error about the resource file. Maybe it’s my install that is bad. I’ll try the uninstalling/install method and see if that helps. At least I know the files are working. Thanks.

I think there was an error report on their forum which I replied to.
As far ad I remember it has got something to do with some write protected file, which you just need to delete.

I’ll try to dig the post up.

It’s not exactly the same thing, but you might still try to remove ca.ca from the program folder
http://support.iteadstudio.com/support/discussions/topics/1000057805

You could post the error message or a screenshot here and on the ITEAD support site.

I ported the NEXTION Arduino sources to run on a Photon about a couple of months ago. Right off I noticed the call to nexLoop() never returned, So I removed the while (true) in NexTouch::mainEventLoop() and just call nexLoop() from the Photon’s main loop.
Next, I noticed that NexTouch::recvRetCommandFinished() always timed out when there was no error - in this case the display returns nothing. So I shortened that function’s timeout and assume pass when nothing is received.
Otherwise it all works!

Edit: Looks like the NEXTION Arduino sources were majorly updated since I last ported them, and the structure of nexLoop() has changed so that it now returns. Okayfine.

1 Like

I have recently received a Nextion 4.3". Im trying to set up the touchscreen to control the relay shield. i have a small webapp that currently does this. How would i make the controls GUI based using this touchscreen.

You’d need to give some more details about your intentions.

But before that you should actually get your hands on the Nextion Editor and look at the demo HMI files provided with the library (via the GitHub link) and dig your teeth into the demo INOs.

Doing that right now.