Nextion Reparse mode

Hi

Where Nextion Reparse mode could be useful ?

Protocol Reparse mode will disable the Nextion instruction set and you just have access to the serial ring buffer. You need to read and write the serial interface yourself using Nextion scripts. Basically it makes the nextion behave more like an MCU or host, instead of a serial client device.

See this thread for some example applications: Reparse Protocol

Thank you.

But what exactly will be available to me ? I did not found any specification - what exactly will be available to MCU or programmer ?

For example : i need to write directly to the screen by X,Y coordinate and set pixel color. ( without calling draw Nextion instructions )

Advanced. Protocol Reparse mode is an advanced technique that allows users to define their own incoming protocol and incoming serial data handling. When in active Protocol Reparse mode, incoming serial data will not be processed natively by the Nextion firmware but will wait in the serial buffer for processing. To exit active Protocol Reparse mode, recmod must be set back to passive (ie: in Nextion logic as recmod=0), which can not be achieved via serial. Send DRAKJHSUYDGBNCJHGJKSHBDNÿÿÿ via serial to exit active mode serially. Most HMI applications will not require Protocol Reparse mode and should be skipped if not fully understood.

The instructions specific to Protocol Reparse mode are:

  • recmod [0 | 1] : Enable/disable Protocol Reparse mode
  • u[index] : Serial Buffer Data array. u[index] returns the byte at position index from the serial buffer.
  • ucopy : Copies data from the serial buffer
  • usize : Number of available bytes in the serial buffer

So, if you need to suspend the serial command interpreter and want to define your own serial communication protocol, you can use recmod to enable/disable this feature. Once enabled, you use the ucopy / usize / u[index] instructions to interact with the 1024 byte serial buffer.

Any other objects, commands, instructions just work as before. So painting a pixel still needs a draw instruction… Only the serial communication interpreter is suspended and you need to process the data in the serial buffer yourself.

Unless you need/want to take control over the serial communication layer, Protocol Reparse mode is not of particular use.

1 Like