-->
Page 1 of 2

uart problem with Nextion

PostPosted: Fri Jun 09, 2017 10:02 am
by wchpikus
I have nextion lcd and i trying send to them some data using lua script.

I saw examples to this,but only using arduino software..i like to use only esp and lua.

One thing is hard to do,maybe someone has solution.

I have to send 3x 0xff data to the end transmission.
In lua to send hex command is write(0,0xff,0xff,0xff)
Now i have to split this with print command,but it must be one command e.g. print("t0.txt=/"test/""....and here send hex data)
If i send hex in next line,to the end of print command i got /r/n so this method is not ok.

How to send some hex data inside the print command?
Variable,table or using function inside?
The string must look this:
"t0="test"0xff 0xff 0xff (0xff='255' in asci,11111111 in binary).

i tried this:
print("g0.txt=\"aux test\""..(string.char (255))..(string.char (255))..(string.char (255)))
and this work ok....but on the end of line i got /r/n...
How to disable this brake line (/r/n) strings?

It should send command like this:
Image



Regards

Re: uart problem with Nextion

PostPosted: Mon Jun 19, 2017 1:10 pm
by wchpikus
Nobody know the solution?

Re: uart problem with Nextion

PostPosted: Mon Jun 19, 2017 5:29 pm
by urbanze
you use Serial.print or Serial.println?

Re: uart problem with Nextion

PostPosted: Wed Jun 21, 2017 3:18 pm
by wchpikus
I use uart.write and print without serial
is it deference as print and printin and serial.print/printin??