Connection monitoring

Hi All,

I have done some googling but wonder if I have been using the wrong search terms. The issue I am having is whenever I have created Nextion applications I end up with a solution that the buttons work 90% of the time. For example, most of my applications have buttons which are simply on or off. Most of the time they are in sync with the main control board but then they get out of sync. I have been careful not to have any delays in the main control board etc which could caus this.

My question is, is there a way of offering checking if the button is on or off and re-syncronising every time the button is pressed.

I am using the easy Nextion library and an atmega 2560 with Arduino IDE for the main programs if that helps. I have also tried using 115200 baud rate as well.

You could use a timer on the nextion to ask for the state of the buttons. But without knowing what the project does (in overall terms not specific if commercial) its hard to suggest solutions. The problem with using Arduino is it treats the nextion as a dumb display and its not it only lacks the IO to control things for example I have a nextion display controlling my off grid solar inverters it requests data from them , parses the data , puts it into text boxes calculates values displays in text boxes , runs animations of what is occurring. It also calculates CRC16 when sending commands changing values in the inverters , there is just a RS232 to TTL buffer between them.

You might like to look at a library (code and example (HMI and .INO) I developed.
I know I am biased, but I think it works really well and is easy to use.
It can be found here.