Start a new topic

Refresh components at more than 9600 bauds

Hi there,


I encounter a problem when I want to refresh some components with baudrate higher than 9600 bauds.


I have 32 buttons and 32 text components that I want to refresh at the same time

(txt and bco/bco2 value)


- I tried to send all my instructions first then use "ref 0"

- use "ref" for each component after editing the parameters

But it only works (but it is very slow) if I use a baudrate of 9600 bauds.


With other baudrates refresh is not complete (some components are not refreshed with new values)


Am I the only one with this problem ?

Is there something wrong with my method ?

Or is Nextion unable to manage a continuous data flow with a baudrate >9600 bauds ?


Regards.


If it isn't implemented to catch every byte in the display side it could be getting out of sync and throwing data away. I think this is wh as the the arduino code will do. It would be nice to know how big it's internal buffers are and how long it takes to process each command so we could prevent lose of data. At 9600 it takes 1 ms to transmit a byte with start and stop bits. So this give the display a fair amount of time to do other things. You may need to wait for each response before you send the next.

1 person likes this

Thank you,

waiting for each response is the better way for minimize the delay.

Better but still not perfect..

@Bspranger  @Robin Godefroid

 

Buffer = 1024Byte

 

Q: how long it takes to process each command

A: different instructions, different time. Hmm.... I do not have a exact time as well.

 

But I think it's not a bug. I move this thread to Free Chat.

I just want to say that even if I wait each response after each instruction, sometimes my components are not refreshed correctly (with baudrate = 115200 bauds).


You should probably add an instruction to know if Nextion is ready to accept new instruction or is busy.


Regards.


1 person likes this
changing baudrates did little for me, but when I changed a delay in my library, it makes a huge difference.
IE. Line 53 in NexHardware.h timeous changed to 12 from 100,


 

bool recvRetCommandFinished(uint32_t timeout = 12);    //this was 100  12 was the lowest that would work

 

 

Login or Signup to post a comment