Nextion displays.

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

AndrewC
Flowcode v5 User
Posts: 28
Joined: Wed Oct 02, 2013 12:16 pm
Has thanked: 7 times
Been thanked: 7 times
Contact:

Nextion displays.

Postby AndrewC » Tue Aug 30, 2016 9:12 am

Hi
Anybody have any luck in getting one of these Nextion displays to work with a MicroChip PIC micro-controller using flow code?

I did find an example in the Russian Flowcode area. But Google translate doesn't quite cut it and I can't access the example.

But at $20 for a 3.2 inch screen, it interests me. :D

Cheers
Andrew

User avatar
Benj
Matrix Staff
Posts: 14660
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4651 times
Been thanked: 4269 times
Contact:

Re: Nextion displays.

Postby Benj » Mon Sep 05, 2016 6:08 pm

Hi Andrew,

This reminds me a lot of the 4D Systems VISI interface, you design the GUI and then control/monitor the GUI using the serial VISI command interface.

The Nextion seems to do the same thing but without the open source VISI interface, unless I am missing something.

Either way I've not found a API document explaining how the Nextion interface works so it could be it's closed source and will only work with their software?

User avatar
Benj
Matrix Staff
Posts: 14660
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4651 times
Been thanked: 4269 times
Contact:

Re: Nextion displays.

Postby Benj » Mon Sep 05, 2016 6:09 pm

Aha, found an Arduino libraruy now.

https://github.com/itead/ITEADLIB_Arduino_Nextion

Might be possible to craft a Flowcode component for this. I will keep investigating.

AndrewC
Flowcode v5 User
Posts: 28
Joined: Wed Oct 02, 2013 12:16 pm
Has thanked: 7 times
Been thanked: 7 times
Contact:

Re: Nextion displays.

Postby AndrewC » Tue Sep 06, 2016 1:50 pm

Benj wrote:Hi Andrew,

This reminds me a lot of the 4D Systems VISI interface, you design the GUI and then control/monitor the GUI using the serial VISI command interface.

The Nextion seems to do the same thing but without the open source VISI interface, unless I am missing something.

Either way I've not found a API document explaining how the Nextion interface works so it could be it's closed source and will only work with their software?


Hi Ben.

It does seem to 'resemble' the 4D Systems interface but you get what you pay for. After a brief play with the GUI it does not seem to be so refined, you have to go looking for, or create, your own graphics for such objects like a gauge, unlike 4D Genie where you are spoon fed the graphics. Nextion seem to provide just the pointer.
I like the 4D Systems products but they are a bit expensive to chuck on every project but for $14US I can now. :D

Re: "I've not found a API document explaining how the Nextion interface works so it could be it's closed source". I found an answer on the forum about making it open source a year ago - "There is not such plan at current stage. " :?

Anyway I have decided to order the 2.4" to have a play. I managed to get the Flowcode example from the Russian Flowcode site. Unfortunately it's for ATMEGA8 but it may give me a starting point.

ressi
Posts: 21
Joined: Fri Mar 25, 2016 6:05 pm
Been thanked: 14 times
Contact:

Re: Nextion displays.

Postby ressi » Tue Sep 20, 2016 7:27 pm

Hello. Do you have a solution on how to receive data from the display and evaluate? I want a motor on, but I can not figure out how I can receive data correctly. Does anyone have a solution? Data can I write correctly in the display. I wanted to register on the Russian Flowcode page but can not get access.
I appreciate any solution Bin !!!

User avatar
Benj
Matrix Staff
Posts: 14660
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4651 times
Been thanked: 4269 times
Contact:

Re: Nextion displays.

Postby Benj » Thu Sep 22, 2016 10:10 am

Hello,

I've looked at the Arduino example again but I'm struggling to know the right way to do this.

Can you share the Flowcode example or the Russian website where you are finding the information and I will see what we can do with this.

AndrewC
Flowcode v5 User
Posts: 28
Joined: Wed Oct 02, 2013 12:16 pm
Has thanked: 7 times
Been thanked: 7 times
Contact:

Re: Nextion displays.

Postby AndrewC » Fri Sep 23, 2016 12:24 am

Hi guys.

Apologies for not replying ressi. I'm not really sure how it's done (complete novice) as I have yet to receive my display so don't want to lead you in the wrong direction talking gibberish. Also I don't know why you can't register on the site. I had no problems apart from the expected using Google translate like this phrase "These are the moments of the pancake." :shock: OoooKaaaayy!

The link in the first post should take you there. But here's the web address.

http://flowcode.info/forum/viewtopic.php?f=19&t=2135

And here's the file Benj. I wasn't sure about posting some one else's work. I hope it helps and it's what we need.

nextion_mega8_v6.fcfx
(27.37 KiB) Downloaded 518 times


Cheers
Andrew
These users thanked the author AndrewC for the post (total 2):
Benj (Mon Sep 26, 2016 11:32 am) • AbhijitR (Tue Sep 03, 2019 8:09 am)
Rating: 10%
 

User avatar
Bachman
Posts: 64
Joined: Sun Sep 07, 2014 11:37 am
Location: Hungary
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: Nextion displays.

Postby Bachman » Sat Oct 01, 2016 2:08 pm

I think, the best way using this displays as a normal display. Do everything by the controller, reading from the display only the touch event, nothing more. Reading by UART interrupt, sending data as normal UART communication, easy to use.

Sedning "12345" text to object t0:

Code: Select all

SendRS232String("t0.txt=")
SendRS232Char(34)  //quotation mark
SendRS232String("12345")
SendRS232Char(34)
SendRS232Char(255)
SendRS232Char(255)
SendRS232Char(255)

The display send "A0", "A1" or "A2" if you touch an object. Receiving it by UART interrupt:

UART Interrupt.jpg
UART Interrupt.jpg (59.32 KiB) Viewed 12734 times


As you see, not necessary to send lots of characters by the display, if you using only some touchable object, the data can be only one byte long.

This two projects created in Flowcode, using only UART commands and UART (RS232) interrupt:

Nextion HMI 1.jpg
Nextion HMI 1.jpg (41.28 KiB) Viewed 12734 times

Nextion HMI 2.jpg
Nextion HMI 2.jpg (32.85 KiB) Viewed 12734 times
These users thanked the author Bachman for the post (total 4):
Benj (Mon Oct 03, 2016 11:23 am) • AndrewC (Fri Oct 07, 2016 1:11 am) • dazz (Mon Oct 10, 2016 7:10 pm) • AbhijitR (Tue Sep 03, 2019 8:08 am)
Rating: 20%
 

AndrewC
Flowcode v5 User
Posts: 28
Joined: Wed Oct 02, 2013 12:16 pm
Has thanked: 7 times
Been thanked: 7 times
Contact:

Re: Nextion displays.

Postby AndrewC » Fri Oct 07, 2016 1:18 am

Thanks Bachman. :D That's a great help, just what I was looking for.

Mine has just arrived so I've now got a starting point and can now play. :)

User avatar
Bachman
Posts: 64
Joined: Sun Sep 07, 2014 11:37 am
Location: Hungary
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: Nextion displays.

Postby Bachman » Fri Oct 07, 2016 7:17 pm

Highly recommended, start testing the display via an USB - UART converter. Much-much faster. You can test the commands (with your program in the display), if everithing is ok, write the microcontroller program. Whit this procedure, you can thest the display first. Othervise, you won't know where is the problem if you find one (or more).

FTDI USB - UART.png
FTDI USB - UART.png (191.99 KiB) Viewed 12471 times
These users thanked the author Bachman for the post (total 2):
Benj (Mon Oct 10, 2016 4:57 pm) • AbhijitR (Tue Sep 03, 2019 8:08 am)
Rating: 10%
 

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 514 times
Been thanked: 467 times
Contact:

Re: Nextion displays.

Postby dazz » Mon Oct 10, 2016 7:37 pm

Hi Bachman
Thanks for the info i will have a play later, One thing i would say is if anyone orders one, make sure you order an adaptor as in bachman's post.
I had one but i can't find it, so if you have a spare arduino laying around you can use that till you get an adaptor.

There are a couple of ways to do this the easiest way is to simply connect the arduino's Reset to ground, connect it to your hmi display (5v,gnd,tx,rx)
the other way is to upload the following as a sketch using the arduino ide, that was theres no need to tie the reset to gnd. im using a spare nano for this :)

Code: Select all

void setup(){
  pinMode(0,INPUT);
  pinMode(1,INPUT);
}
void loop(){
}


Regards
Dazz
These users thanked the author dazz for the post (total 2):
Benj (Tue Oct 11, 2016 10:09 am) • Bachman (Sun Oct 16, 2016 6:30 am)
Rating: 10%
 
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

gordonschlag
Posts: 1
Joined: Thu Mar 23, 2017 1:56 am
Contact:

Re: Nextion displays.

Postby gordonschlag » Thu Mar 23, 2017 2:35 am

hi guys new here and not a programmer. I have read the above info and would like to know if there has been any luck with a module for the nextion displays. If it is in the works let me know
when it is completed so that i can purchase it. I have some displays and wold like to use flowcode to program them ,there ide is not what i would call good but I would call it poor but usable. may be you could talk with Patrick Martin at itead and work with him on a module for flow code. As for the display it is awesome and has a lot of potential . one of the best things about it is that ,the display handles all the screens . so you don't have to have the arduino draw them. They are pictures stored on the display and called by touch events and maybe even data passed on the serial line. But if the you have the enhanced version you have gpio lines that can trigger events or screens and the fields in the screens can have there info updated by passing data from the arduino to the display by way of the serial line. I hope this made sense and I don't look or sound like a 10th grade drop out (which I am )...

schutki
Posts: 1
Joined: Thu Jun 01, 2017 6:55 pm
Been thanked: 1 time
Contact:

Re: Nextion displays.

Postby schutki » Thu Jun 01, 2017 7:00 pm

I think that the crucial thing is to understand in what format messages are sent to Nextion display to change some variable/text value and in what format you send values back to Uart (it can be Microcotroller/PC..).

I made one short tutorial here to show this formats using RS232 terminal (It can be any serial port terminal program such as Docklight, teraterm, bray...)

http://www.electronics-base.com/feature ... r-projects

I hope it helps a bit to understand it. And as you can see do not forger to send 3 times 0xff or byte value (255) or otherwise command will not be processed
These users thanked the author schutki for the post:
AbhijitR (Tue Sep 03, 2019 8:07 am)
Rating: 5%