Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger functions not calling properly, general problem with printh function calls #70

Open
eforekim opened this issue Feb 3, 2025 · 1 comment

Comments

@eforekim
Copy link

eforekim commented Feb 3, 2025

I am using esp32-WroomU with nextion nx8048k07-011c. Specifically trigger functions are a problem but other functions using printh on nextion side are also an issue.
I am trying to use the trigger functions of the library by invoking them using printh 23 02 54 xx(relevant hex code) but the trigger only seems to go through only one third of the time. I have done many variations of the same code to pinpoint the problem to describe more accurately, but the circumstances seem to arbitrarily effect the result, I say this because the conditions that make currentpageid related printh calls work do not make the trigger printh calls work.
Here is the problem code as simple as I can make it.
`
#include "EasyNextionLibrary.h" // Include EasyNextionLibrary
#define Buzzer 25

EasyNex myNex(Serial); // 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
// If no parameter was given in the begin(), the default baud rate of 9600 will be used
pinMode(BUZZER, OUTPUT);
}

void loop(){
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(){ //This only gets called about one third of the time regardless of current page, the string/ num value I am changing or where the trigger function is called.
digitalWrite(Buzzer, HIGH);
myNex.writeStr("b0.txt", "aaaaa");
}
`
sidenote: I managed to make the currentpageid sending printh calls work by only using them in the preinitialize event and the last page visited must have a pageexit event. otherwise they work only one third of the time as well

@cattledogGH
Copy link

but other functions using printh on nextion side are also an issue.

There have been two postings in the past year on the Arduino forum about serial output issues with intelligent series displays. My conclusion is that there is some sort of hardware issue with that model.

https://forum.arduino.cc/t/esp32-with-nextion-hmi-serial-interfacing-issue/1098346/1

https://forum.arduino.cc/t/nextion-intelligent-display-easynextionlibrary-trigger-problem/1320986/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants