Watchdog system

I want to implement a watchdog system. If no serial is received for x seconds, the display should switch to another page. When serial is received again, it should switch back to the normal page. How can I do this?

Use a timer. In the Timer event, change to another page using the page command.

1 Like

How to reset the timer when serial has been received?

You do not have to when the timer sends it to the other page it is reset , in this other page when you get serial input you send it back to the first page timer starts again as its not global. It is best to have a look at the nextion instruction set the display may be able to do a lot if not all that an outside micro may be doing.

It should only go to the page when no serial has been received. How do I check that then?

You need to read the nextion instruction set and write a a program in the timer to check if any data is in the buffer. The same code will be in a timer on both pages one on the first sends you to the second page if no data , after the set interval on the second page it sends you to the first if there is data in the buffer.
You will then have to read the data from the buffer and do something with it, If your using arduino you should find the nextion not much more difficult and maybe like me find the arduino unnecessary. If you search the forum you will find code I have posted that runs on the nextion checking the buffer.