For anyone who wants to use it, here are three modified files that fix the serial communications handling in the v0.9.0 Nextion library so that events actually work. The serial code in the Nextion library is atrocious - it discards messages at random, throws in long delays, and does other stupid things, so that GUI events and timers are basically unusable. This modification fixes all that, so events work AFAICT, perfecty.
There is one (optional) change in the API - I’ve added an optional baud rate argument to the nexInit function, to make it easier to change from the default 9600 baud to anything you want.
I’m just tossing these files out there for anyone who wants them, but make no claims it is 100% correct, though I’ve been using it for weeks with zero problems. If you find a problem, let me know, and I will try to correct it, but no guarantees.
Just copy the three files to your Nextion library folder, and, if you want a different baud rate, add the baud rate as an argument to your nexInit() call. Everything else should work just as before.
NexConfig.h (1.38 KB)
NexHardware.cpp (12.4 KB)
NexHardware.h (1.85 KB)