Start a new topic

How to send to nextion display?

Hello,

i don't know whats wrong.

I send:

"dim=30" and 3x 255 

and the display says: 

0x1A; 0xFF; 0xFF; 0xFF


The Error message mean that the variable is incorrect, but i can't see any mistake.


Attachment: Screen of terminal


what is the 26 before the three 255s?


No quotes ... just  dim=30ÿÿÿ

I only make the quotes to highlight the code.


- The 2.line is the sending String over UART

- The 4. line is the 0x1A -> 26 in decimal

- The 5. line is the first 0xFF -> 255 in decimal

- The 7. and 9. line are the other 0xFF


Ensure no line returns
Can you view in Hex?


Nothing seems wrong if dim=30ÿÿÿ is what is sent


Nextion use the simplest of serial configurations: N81


None Parity, 8 data bits, 1 Stop Bit.

No error checking, no flow control, no compression, no RTS/CTS

May i have found the mistake. How is the uart configuration of the nextion display?

(paraty=none; stopbit=1)


Attachment: Oszi 0x255

A logic one is 0V and a logic null is 3.3V.


To my knowledge it should be changed to:

Alogic one is 3.3V and a logic null is 0V.

0x255.jpg
(46.1 KB)

Looking at your screener, what do you interpret from?

  Are you sure your Nextion supports such voltages?

  Are you sure timing matches Nextion supported width requirements?


Such requirements are documented in your Nextion Model Data sheet.


255 @ 115200

image

and what is now the issue?


how to send to Nextion ...


or


how Nextion send out ...


???

The issue is: how to send to nextion


cpu send:

image


answer from nextion display:

image


So Nextion has indeed received something - it responded intelligently.

I would now focus on if other commands give different result

I too can reproduce a 0x1A 0xFF 0xFF 0xFF response

But is your dim=30 being accepted and dim changes or not?


The command is not accepted and the brightness didn't changed.

1) ensure proper baud

2) try with leading 0xFF 0xFF 0xFF

With leading 3x 0xFF it works fine. 

Thanks for helping.

Test this:

   send leading 0xFF 0xFF 0xFF on connection start

   (should not need leading and trailing every command after)

Glad to hear.  Happy coding.


Login or Signup to post a comment