GithubHelp home page GithubHelp logo

seithan / easynextionlibrary Goto Github PK

View Code? Open in Web Editor NEW
113.0 113.0 30.0 417 KB

A simple library for Nextion display that uses only four functions. You can easily benefit from Nextion's wide range of features and advantages in just a few easy steps. The library uses a custom protocol that can prove to be a powerful tool for advanced users as it can be easily modified to meet one’s needs.

License: MIT License

C++ 86.14% C 13.86%
nextion

easynextionlibrary's People

Contributors

seithan avatar zer0-bit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

easynextionlibrary's Issues

Errors handling when writing to incorrect nextion objects

First - Great library :)
I think I found an issue though. If you write to an incorrect object it screws things up and you get random behavior like not capturing button presses, etc.
I did a writeNumber("b0",10); instead of the correct writeNumber("b0.val",10);
There is no easy way to catch the error, and I might have expected that write would just not happen.
But Nextion display gives and error back "1A FF FF FF" which I think causes your routine to get lost.
It would be great if your library could catch these error codes and call a user routing "Nextion_error()" or something like that in a similar way that you call trigger0() functions. It would be great if you passed the string that was sent to the nextion that caused the error to this error routine "Nextion_error(String)". That way the error handler could then help with debug.

How to change globals variables?

Please how can change globals variable in nextion? In HMI I create variable var1 and set vscope as global. But when I send myNex.writeNum("var1.val=",123); it is not function. Why?

interrupt

Hi
When I wont to save in eeprom, sometimes I got an error. Save at wrong location and not right number
It is possible that library use some interrupts? I try to use nointerrups() command, but in this case also EEPROM function doesn't work

Crashes when nextion display disconnected

Hello,

please how check what is Nextion Display wired / connected to Arduino / ESP32? I try declare global variable on display and try somethink this:

in loop:

if (myNex.readNumber("page0.va0.val") == 44) { //test připojení nextion displeje, v global proměnné page0.va0.val je uloženo 44
            myNex.NextionListen();
        }

and when I need write to display:

if (myNex.readNumber("page0.va0.val") == 44) { //test nextion connection- in global variable page0.va0.valis save number 44
            if (Serial2.availableForWrite()) {

but it seems that ESP32 crashes when display is not connected. Please do you have any ideas?

Thanks Jan

Example with len superior of 02

I cannot find any example with second parameter (len) superior of 02
I tried to do this to catch the next 3 bytes:

Nextion button:

printh 23 03 4c 01 01

C++ code:

    case 'L':
      Serial.println(_serial->read());
      break;

the above code reports 01 only, and not the entire combination like "01 01"

Is there anything to combine both in single variable?
Or how do you do in your cases?

EDIT: when first posted I said it reports twice but I was wrong. It is reporting only once

FR Reed Touch Coordinates

Thanks for the great work in this library and i have to ask for help. In my project i need to handle touch coordinates enabled with command: sendxy=1
The returned data is:
67 (02 DA)x (00 D2)y (01 or 00 pressed and released) FF FF FF
Could you please help me to implement that future in the existing library class.

I try to put this code but not working correctly
`
// public variables
uint16_t touchX;
uint16_t touchY;
boolean EasyNex::NextionListen(){
.
.
.
if(_start_char == 'g'){ // And when we find the character #
for(int i = 0; i < 5; i++){ // If the command is 'R' (read Number) go on read the number and store them in the numeric buffer
_numericBuffer[i] = _serial->read();
}
delay(3);

      int _checkNextByte = _serial->peek();  // We take the four bytes. Are they the correct ones we expected?
                                             // Or we have some unwanted data (garbage data) that comes to the Serial.
                                             // To ensure that, we check what is the next byte on Serial.
                                             // If everything is as it should be, the next byte must be a '#',
                                             // which means a command is following, or the Serial must be empty.
                                             // In this way, we lower the chances of having a bad reading.
                                             // But nothing is completely unavoidable.
      
      
      
      if(_checkNextByte == 35 || _checkNextByte == -1){ // Check the next byte. 35 = '#',  -1 = empty Serial
        
        // We can continue with the little endian conversion
        _numberValue = _numericBuffer[4];
        _numberValue <<= 8;
        if (_numberValue == 1){
          isPressed = true;
        }else{
          isPressed = false;
        }
        _numberValue = _numericBuffer[3];
        _numberValue <<= 8;
        _numberValue |= _numericBuffer[2];
        _numberValue <<= 8;
        touchX = _numberValue;
        _numberValue = _numericBuffer[1];
        _numberValue <<= 8;
        _numberValue |= _numericBuffer[0];
        touchY = _numberValue; 
        _waitingForNumber = true;         // Means that we found the correct number and we are going to send it         
        
      }else{  // Else if the Serial is not empty, and the next byte is not 35, then this data doesn't belong to us
        _tmr1 = millis();
        while(_checkNextByte != 35){  // So we send them back where they came from.
          _serial->read();
          _checkNextByte = _serial->peek();
          if((millis() - _tmr1) > 5UL){ 
            break;
          }
        }
        _waitingForNumber = true;     // means that a readNumber command found and we have the number stored
        _numberValue = 777777;        // The false return value of bad reading.
        return _numberValue;
      }
}
  if(_start_char == '#'){            // And when we find the character #
  _len = _serial->read();          // Create local variable (len) / read and store the value of the second byte
                                   // <len> is the lenght (number of bytes following) 
  _tmr1 = millis();
  _cmdFound = true;
  
  while(_serial->available() < _len){     // Waiting for all the bytes that we declare with <len> to arrive              
    if((millis() - _tmr1) > 100UL){         // Waiting... But not forever...... 
      _cmdFound = false;                  // tmr_1 a timer to avoid the stack in the while loop if there is not any bytes on _serial
      break;                            
    }                                     
  }                                   
  if(_cmdFound == true){                  // So..., A command is found (bytes in _serial buffer egual more than len)
    _cmd1 = _serial->read();              // Read and store the next byte. This is the command group
    readCommand();                        // We call the readCommand(), 
                                          // in which we read, seperate and execute the commands
		}
	}
}

return _cmdFound;
}

`

Change value of multiple numbers

First off, I'm very impressed with your library. It is the by far the best Nextion library I have used so far. Unfortunately, I'm experiencing a very elementary problem. I have 2 numbers on the Nextion display (on the same page).

When I run these two lines, n0 updates as expected:

myNex.writeNum("n0.val", nex_temp);
myNex.writeNum("n0.val", nex_temp);

When I run these two lines, neither n0 or n1 update:

myNex.writeNum("n0.val", nex_temp);
myNex.writeNum("n1.val", nex_temp);

When I run these two lines, n2 updates as expected:

myNex.writeNum("n2.val", nex_temp);
myNex.writeNum("n2.val", nex_temp);

I seemingly can't write to more than one number.

(solved) Collect sleep information

Hi,
I've discovered your awesome library and I have a request.
To stop sending commands for refreshing values to Nextion, I'd like to be informed when Nextion is in sleep mode.
I've seen that the display sends 0x86 but I haven't found how to collect it wih your library

TriggerX where X > 9 cause kernel panic followed by reboot

// Demonstrate crash when triggerxx where xx < 9
// Possible cause: hexadecimal case statements in callTriggers.cpp dont't compile correctly for ESP32 starting on line 67
// See core dump towards the bottom for cryptic details
// -- mikeseiler2 (at) gmail.com

#include "EasyNextionLibrary.h"

EasyNex myNex(Serial2); // Create an object of EasyNex class with the name < myNex >
// Set as parameter the Hardware Serial you are going to use

void setup() {
myNex.begin(9600); // Begin the object with a baud rate of 9600 // !! change to 115200 on next upload
// If no parameter was given in the begin(), the default baud rate of 9600 will be used
Serial.begin(115200);
myNex.writeStr("page page0"); // rename this with the next refactoring
}

void loop() {
delay(1); // read every milliseconds
myNex.NextionListen(); // This function must be called repeatedly to response touch events
// from Nextion touch panel. Actually, you should place it in your loop function.
}

void trigger0(){ // OK
Serial.println(0);
}

void trigger1(){
Serial.println(1); // OK
}

void trigger2(){
Serial.println(2); // OK
}

void trigger3(){
Serial.println(3); // OK
}

void trigger4(){
Serial.println(4); // OK
}

void trigger5(){
Serial.println(5); // not tested
}

void trigger6(){
Serial.println(6); // not tested
}

void trigger7(){
Serial.println(7); // OK
}
void trigger8(){
Serial.println(8); // OK
}

void trigger9(){
Serial.println(9); // OK
}
/*
Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x00000000 PS : 0x00060f30 A0 : 0x800d1236 A1 : 0x3ffb1f30
A2 : 0x3ffc00b4 A3 : 0x00000000 A4 : 0x00003df2 A5 : 0x00005980
A6 : 0x00060f20 A7 : 0x00000000 A8 : 0x800d10e0 A9 : 0x3ffb1f10
A10 : 0x3f400f5c A11 : 0x00000000 A12 : 0x3ffb8274 A13 : 0x00000000
A14 : 0x3ffb82a9 A15 : 0x3ffb0060 SAR : 0x0000000a EXCCAUSE: 0x00000014
EXCVADDR: 0x00000000 LBEG : 0x4000c28c LEND : 0x4000c296 LCOUNT : 0x00000000

Backtrace: 0x00000000:0x3ffb1f30 0x400d1233:0x3ffb1f50 0x400d1019:0x3ffb1f70 0x400d0d0b:0x3ffb1f90 0x400d1ab1:0x3ffb1fb0 0x40088215:0x3ffb1fd0

Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:8896
load:0x40080400,len:5816
entry 0x400806ac

*/

void trigger10(){
Serial.println(10); //CRASH !!!
}

void trigger11(){ // CRASH !!!
Serial.println(11);
}

void trigger12(){ // CRASH !!!
Serial.println(12);
}

Where is the zip file on Github

I was trying to download your library from Github but can't find the zip file that you say I should see using the second download method that you specify in your Readme.md file.
Am I missing something?

Software Serial Pin definition

Hi
Im trying to use your library but where are you defining your software serial pin allocations/definitions?
surley it suppose to be in the main example and not hidden in library somewhere? im trying to use it on a NANO that does not have multiple serials so need to use other pins

Crashes on ESP32

Hello, this library on ESP 32 sometimes crashes:

Guru Meditation Error: Core  1 panic'ed (InstrFetchProhibited). Exception was unhandled.
Core 1 register dump:
PC      : 0x00000000  PS      : 0x00060230  A0      : 0x800e1ba0  A1      : 0x3ffcfb10
A2      : 0x3ffc4e20  A3      : 0x00000000  A4      : 0x63fd4400  A5      : 0x00000000  
A6      : 0x00000fff  A7      : 0x00060f23  A8      : 0x800e1c32  A9      : 0x00000054
A10     : 0x00000000  A11     : 0x00000000  A12     : 0x00005317  A13     : 0x00004c80  
A14     : 0x00050023  A15     : 0x3ffbb554  SAR     : 0x0000000a  EXCCAUSE: 0x00000014
EXCVADDR: 0x00000000  LBEG    : 0x4000c28c  LEND    : 0x4000c296  LCOUNT  : 0x00000000  

ELF file SHA256: 0000000000000000

Backtrace: 0x00000000:0x3ffcfb10 0x400e1b9d:0x3ffcfb30 0x400d64a5:0x3ffcfb50 0x400febdd:0x3ffcfc00 0x40090f1a:0x3ffcfc20
  #0  0x00000000:0x3ffcfb10 in ?? ??:0
  #1  0x400e1b9d:0x3ffcfb30 in EasyNex::NextionListen() at .pio\libdeps\Windows\Easy Nextion Library\src/EasyNextionLibrary.cpp:278
  #2  0x400d64a5:0x3ffcfb50 in loop() at src/main.cpp:1172
  #3  0x400febdd:0x3ffcfc00 in loopTask(void*) at C:\.platformio\packages\framework-arduinoespressif32\cores\esp32/main.cpp:23
  #4  0x40090f1a:0x3ffcfc20 in vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1)

On main.cpp 23 is #include <Wire.h> and on main.cpp 1172 is myNex.NextionListen(); .

With connected Nextion diplay it crash sometimes, when i disconnected Nextion displat it carsh wery offen (cca every five minutes). Please how fix it? Thanks.

input buffer overflow

I found that if the Nextion generates too much input and the serial input buffer backs up. It looks like this is not detected properly and the Arduino crashes and reboots. Library probably writes past the end of an arrray.
Here is how I created the problem.
I put a half second sleep in my main loop - to test for problems.
I then opened a page on nextion with a couple of buttons that call trigger functions trigger0 and trigger1.
Trigger0 and trigger1 just update a text box and change the color of the button.

rapidly hitting the buttons caused trigger calls to be queued up and slowly processed one per half second.
I was impressed that many were queued and that everything kept working.
but with rapid button pressing (10 or twenty quick presses). The arduino crashed. I repeaded this several times and it consistently crashes.

I would have expected that button pushes would eventually just get dropped. Ideally the error would be caught and an error function called to log the error. But it would be ok to just detect the overflow and drop commands.

Thanks for the nice library - really helpful as its much nicer to use that others.

ESP32 Crash

When using your code in arduino to run a ESP32, any trigger events over 09 causes the MCU to crash and reset,
i have a print 23 02 54 0A (Trigger 10) from my display button, and void trigger0A() in my code and the MCU resets when the button is pressed on the screen. any susgetions as to where i am going wrong or is this a bug?

Now Fixed. I was not uisng trigger10() in my arduino code, And it was late....

Thanks you by the way for a great bit of code. :)

How to read NEXTION special returns with EasyNex ?

Hi Seithan,
I find your library very simple and very practical to use. She is great!
But I have a question: for an application, I need both custom commands and also tactile feedback from the Nextion (65 xx xx xx FF FF FF) and special feedback from the screen (such FE FF FF FF or 04) for using twfile.
How could these Nextion returns be easily integrated into the EasyNex library?

Thank you in advance for your reply.
Have a good day.
Joel

Reduce Execution Time for NextionListen()

First, I love your library!!!

One thing I have noticed is that NextionListen() takes almost 1000ms to execute. Here is the code I'm using in the loop() to calculate the execution time.

    int hz1 = millis();
    myNext.NextionListen();
    Serial.println("NextionListen..." + String(millis()-hz));

NextionListen...975

Is there a way to reduce the execution time for NextionListen?

I'm running on a Arduino Compatable ESP32 at 80MHz

Thanks for any help

myNex.readNumber()

In my case i have a Variable in nextion(ntu).
ntu.val=489
In Arduino code:
uint32_t number = 0;
number = myNex.readNumber("ntu.val");
Serial.println(number);

But the output(Serial.println(number);) is "4294967066".
Not the real val(489).

NEXTION is not displaying the data sent to it

I am working on a project using an ESP32-S3 and Nextion display. I found your library and felt is was a perfect fit for my minimal coding skills. Everything works when using the NEXTION simulator, but when I interface with the display nothing I send gets displayed.
I submitted a detailed explanation in a request for help on the arduino forum and was wondering if you can talk a look and LMK if you have any advice/suggestion on how to fix my problem. The details start with post #3. The link is:
https://forum.arduino.cc/t/esp32-s3-and-nextion-7-intelligent-display/1091880/

ESP32 serial communication issue with Nextion

I am having trouble writing data from ESP32 serial2 to Nextion. I can receive hits from the Nextion but don't seem to be able to write anything is this anything you have come across?

Using Serial2 on ESP32 with redefined pins

Hi there,

I need to connect to redefined Serial2 pins. Standard-pins would be 16/17 for UART2, but I need to be using 5/14. My attempt is as follows, but doesn't seem to work... Any ideas? :)

#include "EasyNextionLibrary.h"
#define RXD2 5
#define TXD2 14

EasyNex nextion(Serial2);

void setup() {
  Serial.begin(115200); //USB
  Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2); //Nextion
  nextion.begin(9600);
}

Custom objectnames

Hello, I was just wondering if this lib supported Custom objectnames?

for example:
myNex.writeStr("SomthingStupid.txt", "Hello World");

not running with nextion NX3224T024_011 and wemos d1

Hello, i have used example "Trigger" with a wemos d1 and a nodemcu, both with nextion NX3224T024_011, but i have gone crazy no change, buttons do nothing.
Nextion take 5v from an external source.
I have connected to rx and tx pins and serial to 9600
i tryed to use a previous version of library 1.04 and 1.03 but no success.
So i don't know if there is i'm missing.. Any help is appreciated.

How to read page name

Now i need the printh Line for reading that the page was changed.
How can i do it without printh 23 02 50 01 ?

How is it possible to send the page name like this:
print "#2P"
print pages.txt
printh 0xFF .....

void loop(){
myNex.NextionListen();
if(myNex.currentPageId != myNex.lastCurrentPageId){
newPageLoaded = true;
currentpage = myNex.readStr("pages.txt");
myNex.writeStr("t1.txt",currentpage);
newPageLoaded = false;
myNex.lastCurrentPageId = myNex.currentPageId;
lastpage = currentpage;
}
}

Bildschirmfoto 2020-08-19 um 14 51 12

Turkish Characters

Hello I use this func myNex.writeStr and its can not send turkish characters, How can I fix it ? And Thanks for this beautiful library :) it is very simple to use it ı think better than iteadlib.

You are my saver.. thanks

Hey !!! Guy. really you are my saver..
I had some problem esp32 connect nextion.
even follow nextion ITEADLIB... it is pretty has a lot of issues. and unstable.
So, I was thinking about giving up this product.
There were many cases where it went well and suddenly stopped working,
Sometimes, communication was impossible at all.
By the way, I found your documentation and this helped me a lot with the project I was trying to do.
So, it seems that I once again gained hope for development.
First of all, I really really appreciate your efforts. Thanks
ESP32 work well and No problem.
I tested whole day and night.

Invalid reading from Nextion

Hi
I try to read data from display. If I'm on main page0 it work OK
xx = myNex.readNumber("popravi_prog.n11m.val"); Serial.println(xx);
but if I'm on some other page I got an "xxx" number.
n11m is mark as global. Also in nextion debuger work OK.

Intermittent triggerX() detection and currentPage

Hi!

Hope you can help, I've been working on a digital dash project and came across your library which makes things WAAAY cleaner for my use.

Firstly, a quick summary of the hardware/software:

  • Arduino UNO R3
  • Nextion 7" Intelligent series screen NX8048P070_011
  • Nextion editor v 1.65.0

Firstly, I was having trouble getting the currentPage value, and when trying to get it using the global dp variable it was REALLY slow, so abandoned that and went looking for a different solution.

My idea was to trigger a function by getting the Nextion to send a hex string as documented such as :

printh 23 02 54 01

as per:

Screenshot 2022-12-29 at 15 18 27

01 for page 1, 02 for page 2 on the button touch release event. That appears to work fine in the Nextion simulator/debug, and sometimes it works OK when changing page, the Arduino picks it up and will set the global Arduino Int to the current page, which I push out to the Nextion for testing inside the loop().

Sketch as an example:


#include "EasyNextionLibrary.h"

EasyNex myNex(Serial);

int currentPage=1;

void setup() {
  myNex.begin(115200);  
  delay(500);  // This delay is just in case the nextion display didn't start yet, to be sure it will receive the following command
}

void loop() {  
  myNex.NextionListen();
  myNex.writeStr("gearposition.txt", String(currentPage)); // these two fields are extant in the dash, just using for debug here
  myNex.writeNum("pageNum.val", currentPage);
}

void trigger1(){
  currentPage=1;
}
void trigger2(){
  currentPage=2;
}
void trigger3(){
  currentPage=3;
}

I've reduced the code to a minimum above (and have tried this here as well) with the same results, it doesn't always update the page number, I'll sometimes end up with page three showing '1' or '2', page one showing '2' or '3' etc.

Am I doing something wrong? Any ideas?

Thanks very much!

Peter.

GIVE THIS ERROR

libraries\EasyNextionLibrary\EasyNextionLibrary.cpp.o (symbol from plugin): In function `EasyNex::callTriggerFunction()':

(.text+0x0): multiple definition of `EasyNex::callTriggerFunction()'

sketch\ARFTHERM.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1

HardwareSerial selection

Hi, as in title, i was wondering if there's any possibility to switch to other HardwareSerial ports and map pins on it, i'm using an ESP32 and would be nice to try Hardware Serial 2 (with pin 32 and 33) because i'm already using the first serial as monitor for testing on usb.

Thanks

Cannot use software serial

When compiling on a arduino micro i do get this error

no matching function for call to 'EasyNex::EasyNex(SoftwareSerial&)'

I am wondering do i have to change this line in easyNextionLibrary.h
EasyNex(HardwareSerial& serial); ???
any advice would be appriciated

Sending string to textbox on nextion

Hello,
first of all thank you for the library. Made my first steps much easier :-)
Second, maybe my problem is not with your library, in that case sorry for troubling you!

Setup: NX3224T024, NodeMCU with ESP8266.
Display is on, Triggers created by Buttons on the Nextion are executed. From the ESP8266 i am connected to my MQTT broker -> communication is up and running both ways.

When i try to read a global variable from the nextion, i only get ERROR.
When i try to write text into a textbox, it only works with a string but not with a variable created. If i send the variable back over MQTT i get the proper value...

Function (callback from MQTT PubSubClient)

void callback(String topic, byte* payload, unsigned int length) {
String payloadStr;

//convert payload to String
for (int i = 0; i < length; i++) {
payloadStr += (String)payload[i];
}
payloadStr = payloadStr.substring(1,payloadStr.length() -1); //removing the "" from the string
myNex.writeStr("tempOut.txt", "6.9"); <-- this works
myNex.writeStr("tempIn.txt", payloadStr); <-- this does not work
}
if i change the two write commands, the other textbox is filled with the "6.9"...

Thanks
Erik

Unable to read/write values from/to Nextion

First of all like many people posting here many thanks for this super library. It allows many people like me who is not impressed by the Nextion library and forum which is non existant to be able to use the Nextion displays.

I have been using the EasyNextionLibrary with an ESP32 for many months without any issues other then fixing normal development bugs. With all the good documentation I was able to develop a complex application using the library with the trigger() functionality.

I have been able to read/write values from/to variables using the readNumber/writeNum without any problem. Suddenly I can't read/write anymore. When reading a number with the following code: TempToReach = yNex.readNumber("nTempToReach.val"), I get an error. Same thing when trying to write with: myNex.writeNum("nDateYear.val", RTCYear); the value is not updated on the Nextion like it was before.

What is strange is that I know the communication between the Nextion and the ESP32 works because I put Serial.print commands in the ESP32 code and I print when I get to the ESP32 after the Nextion executes the printh 23 02 54 XX.

Any idea what may have cause this functionality to cease functioning after so many months? I tried many small tutorial files with the same issue.

Read data from EEPROM of nextion to arduino and store as float or veriable.

Thanks for this great work it help me alot and save my time.

I am working on a project where I store all variable and float reading on nextion EEPROM. No I want to read that data over the serial with below command so every time when run the setup it will store all variable on arduino from nextion. because I am facing the issue when I read directly from nextion with "myNex.read Number" it missed first variable .

rept 30,20 // sends 20 bytes from EEPROM addresses 30 to 49 to serial// byte of data is not ASCII text of byte value, but raw byte

Thanks,

serial baud rate

with this command the screen works but slowly, myNex.begin(9600)
i tried to write myNex.begin(115200);
but screen can' read anything.
thanks

Read Variables

Hello,

I don´t see a function to read/write Nextion´s variables.
Is there a way to make it work?
Thanks

problem with myNex.writeStr("tX.txt+") ?

Hi,
im using an NX4827T043 and with the following code:

     myNex.writeStr("t9.txt", "DoW");
     myNex.writeStr("t9.txt+", " hours"); 
     myNex.writeStr("t9.txt+", " mins");
     myNex.writeStr("t9.txt+", " dd/mm/yyyy");     

the full text should be displayed, but i obtain this output:

photo_2021-03-22_22-17-11

The full code can be found in :
https://github.com/VicenteYago/AdvancedWeatherStation/blob/seithanM/src/OW2nextion/OW2nextion.ino

lines 173-176.

Btw, i want to say that I tested all the available libraries, and this is the best one in quality and documentation. Good work!

Trigger limit 50 ?

Hello Mr. Seithan, first I come to congratulate this magnificent library is the best, I would like to know in the Trigger function, its limit is 50? because mine only works up to 50, if so, how to increase?

Sorry for my english.

readNumber() not working with SoftwareSerial

As SoftwareSerial is more felxible and doesn't block Serial for debugging i changed the library to use SoftwareSerial.

EasyNex::EasyNex(SoftwareSerial& serial)

I get the trigger1 events as well i can write numbers or strings. But readNumber() is not working at all. Always returns 777777

Already tried playing with the timeouts, but still no luck.

Would you add support for SoftwareSerial or help to find the cause of readNumber() not working?
Appreciate your hard work!

#T on triger Serial.println

Hello,

I Use Easy Nextion Library@^1.0.6, baud 115200. Send data to display works ok, but receive (by press button on disple f.e.) not works.

For example in triger0 I have Serial.println("button pressed"), but in terminal from ESP32 print this:

image

Next messages from terminal ESP32 are ok, but all from triggers it print only #T .

I dont know why. Plese help me.

Many thaks,

Jan

Unable to Read Strings Back (readStr())

Seithan;

I've run into the same problem as in issue #24. As you suggested there, I modified the EasyNextionLibrary.cpp for ERROR, ERROR1, ERROR2, and ERROR3 and now I'm getting ERROR2 each time I try to read back a string (line 129, if 0x70 is not detected). The odd thing is that I was able to read them back previously, but I must have changed something unwittingly and messed things up.

  • I lengthened the wait time on line 128 from 100UL to 200UL, but it made no difference.
  • I have checked that the commons (GND) are the same for both the Nextion and the MKRZero board (actually a P1AM-GPIO board).
  • I've tried different baud rates, 4800 to 19200, but that doesn't seem to make any difference either.
  • The signals to/from the Nextion are passing through 3.3V to 5V level shifters.

Thanks for your time in this. Otherwise a great library

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.