Start a new topic

Support for Nextion Basic 3.5" with Raspberry PI2

Hi,

Does anyone have an idea how to use Nextion and raspberry ?

I'm checking about tutorial here on ITEAD, and on internet, but there is nothing !


Except some useless tutorials which makes you waste a lot of time for nothing !

I install the Segnix library, I check exemples, but nothing about the screen...


What i need is to be able to use buttons, dual-state buttons, text (to send t°, humidity, date, time,...) and to change the pages...


First i used Arduino Mega2560, but there's not enough memory SRAM for all the functions i need, and now, i connect Raspberry and Arduino by I2C.


Thanks in advance,


Axel


Hi Axel


Personally I do not have examples using Raspberry Pi

However, what you need to focus on is serial communications


Once you can send text from Pi to a terminal, then you have ability for Nextion

Then it is simple text commands terminated by three 0xFFs


There certainly are threads.  Use search bar above

Thanks Patrick,
I'm more an Arduino user, it's more than 1 year i didn't use my raspberry

On arduino, my code works perfectly, but... for my project, there's 24 pages on Nextion + 33 double state buttons, 129 simple buttons, and 19 text zone... after just compiling the code for this, it's 96% of SRAM used, and i have again a lot of functions to put inside...

This is the reason i took back my RPI ;-)

But to program it, it's another history... and as i understand on the web, no one is able to use correctly the raspberry with the Nextion screen

On the library for RPI here on ITEAD, there's no examples... no code, no tutorial,...
I'm not a noob but here, i'm completely lost...


Or you could look at ESP8266. Plenty of SRAM and WiFi connectivity all in one 32bit SOC. Program in C++ in Arduino IDE. Widely used and now maturing some, there's absolutely heaps of ready to go software examples available. And best of all it's about $5  :) 

Have you considered adding an I2C or SPI SRAM to Arduino?

@ indev2  

This is a good idea ! but i'm not sure there's enough I/O, i need to check it ! there's about 25 relays, 4 ds18b20 (only 1 pin) DS3231 and TEA5767, PT2258, PT2323 in I2C, module BK8002 in serial1, Nextion in serial2, and HC-05 in serial3 (SoftwareSerial can help...) IR led, IR receptor, 5.1 decoder, HDMI selector, DHT11, android tvbox,...
For all of this, the Mega2560 was perfect, but... too little in memory lol, i suppose there's some possibilities to use ESP8266 for the nextion screen, and to follow the instructions to the mega2560 by I2C or SPI ;-)
BTW, i will check it seriously ! thanks for your advice !


@ Patrick Martin,

Yes, i considered it, but a bit too fastidious, when i checked on the forums, many people says it's too slow (of course, now we should check what they say by too slow...) here, my project is a 5.1 amplifier very complete for the first part, the second part is a mini domotic system, and the third part is 2 fish tank controller, it means it should react very quickly...

HMI
(3.18 MB)

Patrick,


I already checked it, but there's nothing inside ! (sorry for your colleague which wrote it)
They just show a printscreen, but no explanation how to use the different functions


Thanks ;-)

indev2,

I checked the ESP8266, it's perfect ! 
SPI, I2C, and 2 serial connectors, 32k SRAM, i can link it very easily with the mega board ! 

Thanks a lot ! i'll order it now ;-)

Just a quick clarification, Gerry and I are users voice to Itead.


Simple serial:

  change t0's Text is t0.txt="Hello"ÿÿÿ

  change n0's Value is n0.val=234ÿÿÿ


Press event of Page 0 component .id 7 sends

   0x65 0x00 0x07 0x01 0xFF 0xFF 0xFF

   - when you receive this, handle it with your function

Release event of Page 1 component .id 6 sends

   0x65 0x01 0x06 0x00 0xFF 0xFF 0xFF

   - when you receive this, handle it with your function


Nothing inside?

 - I see the ino file for the CompButton

 - I can further go up the github tree for the library

https://github.com/itead/Segnix/tree/master/libraries/itead_Nextion

Is this not Segnix that you are after??


If you aren't willing to help yourself

 - nothing I can do further



Patrick,

Thanks for your advices, and i would like to clarify some things too.


As i told in the first post, i'm an Arduino user, not Raspberry, for me the RPI wil help me just to do a server (it's my usage, i know it can do much more, but it's not for me, i much more prefer Arduino) then, yes, first i was in the RPI with Segnix, but another solution proposed by indev2 is much more better for me, and opens some other possibilities for me in the future


I'm not a noob in arduino, but i'm not a programmer, i never learn it, like a lot of makers, we learn by ourself, by tutorials, retro-engineering,...


Maybe i'm stupid, but i think that a company like ITEAD, if they sell something, they should be able to provide some examples, tutorials,... like Arduino, RPI,... did it !


It's good that Gerry and you are here to help, if not it was my first and last Nextion screen, because the ITEAD staff doesn't provide a lot of things...


By the way, thanks for your explanations ;-)



As I support Nextion, I learned something today.

Segnix is the new name of Itead-OS-SDK (changed Nov 22,2014)


Time functions, PWM, GPIO, UART, I2C, SPI with an Arduno compatible API

All open source, full lib, documented API, Segnix API chm/html formatted

Examples galore



@Alex

I forgot the main tree link to Segnix https://github.com/itead/Segnix

I am just going to point out the irony here.


You state your strength is Arduino, not Pi.

You state Itead should be able to provide examples


And yet Segnix (Itead-OS-SDK) was created by Itead (as I learned last hour)

 as an open source project to turn a Pi into an Arduino compatible.

And there are tonnes of examples and .ino files

  - geared exactly your strengths

Including a Segnix version of Nextion


When I Google "raspberry pi nextion display"

  https://www.google.ca/?gws_rd=ssl#q=raspberry+pi+nextion+display&*&spf=381

I get 1.120,000 results and the Itead Blog is second spot (I gave you this link above)

   - How to use Nextion to work with Raspberry Pi?

   https://www.itead.cc/blog/how-to-use-nextion-to-work-with-raspberry-pi


This page provided the link to Segnix on github Step 1:

   Nextion example HMI/ino in Step 3

But only 5 steps to get Segnix running with Nextion, not just screen shots


Segnix Nextion library

https://github.com/itead/Segnix/tree/master/libraries/itead_Nextion


Sorry, but it looks like everything you were asking for

   Utilize a Pi2 geared to your Arduino strengths.


I won't argue against the compute power of the ESP8266, that's a fools position.

Reviewing:

   install the Segnix library, I check exemples, but nothing about the screen...


libraries folder has itead_Nextion folder.  Everything there.

Patrick,

Segnix was installed on my RPI, but i was unable to work with it (that's why i created this post)

And when indev2 explain about esp8266, i choose this solution because it suits my knowledge !

I will never go against RPI or Intel Edison or others, just, it doesn't suits my skills, and my interrest.


Do you really think i didn't check on google ?


I continue to say : ITEAD have NO CORRECT SUPPORT FOR THEIR SCREEN !


As you say in many post, you didn't use arduino, and you use Intel Edison, i suppose it's more convenient for you no ?

Same for me with Arduino ! there is no point or irony, i was thinkink the objective of a forum was to help, not to insist on an inconvenient solution when a convenient was found no ?


But now i know like some other people says, it was my first and last nextion screen.


And i will not continue to argue here for nothing.


Have a nice day.