ESP32 + Nextion

Hello, new challenge awaits me...
I got this code from the internet, it's for Arduino and Nextion.
On Arduino it works well. On ESP32 no. The buttons seem not to work. The LEDs light up, as a setup. But nothing happens. Any idea?
If I send data from a BME280 + ESP32 to the Nextio as txt no problem, reads and updates the data on the display, but simple buttons or dual state nothing to do.
I also modified the files Nextion.h,Hardaware.h and put txt extension to the files NextionUplod.h and NextionUpload.ccp as described by the site Nextion.ca,tutorial ESP32.
I tried them all.
Thanks
chipxx :confused:

ps allego codice

#include "Nextion.h"

const int led_01 = 12;
const int led_02 = 14;
const int led_03 = 27;

NexButton b0   = NexButton(0, 4, "b0");
NexDSButton bt0 = NexDSButton(0, 1, "bt0");
NexDSButton bt1 = NexDSButton(0, 2, "bt1");
NexDSButton bt2 = NexDSButton(0, 3, "bt2");

                        
NexTouch *nex_listen_list[] = 
{
    &b0,
    &bt0,&bt1,&bt2,
    NULL
};

void b0_Apagar(void *ptr);
void Funcion_bt0(void *ptr);
void Funcion_bt1(void *ptr);
void Funcion_bt2(void *ptr);

void setup(void)
{      
    nexInit();//Inicio la comunicacion entre el Arduino y la Pantalla
      
    pinMode(led_01, OUTPUT);  
    pinMode(led_02, OUTPUT);  
    pinMode(led_03, OUTPUT);  
   
    digitalWrite(led_01, HIGH); 
    digitalWrite(led_02, HIGH); 
    digitalWrite(led_03, HIGH); 
   
    //Registro  el llamado a la funcion del evento de Dual State Button
    b0.attachPop(b0_Apagar);
    bt0.attachPop(Funcion_bt0, &bt0);
    bt1.attachPop(Funcion_bt1, &bt1);
    bt2.attachPop(Funcion_bt2, &bt2);
}

void loop(void)
{   
   nexLoop(nex_listen_list);
}

void b0_Apagar(void *ptr)
{
    digitalWrite(led_01, HIGH); 
    digitalWrite(led_02, HIGH); 
    digitalWrite(led_03, HIGH); 
}

void Funcion_bt0(void *ptr){
    uint32_t Estado_dual;
    bt0.getValue(&Estado_dual);
    
    if(Estado_dual){digitalWrite(led_01, LOW);}
    else{digitalWrite(led_01, HIGH); }
}

void Funcion_bt1(void *ptr){
    uint32_t Estado_dual;
    bt1.getValue(&Estado_dual);
    
     if(Estado_dual){digitalWrite(led_02, LOW);}
    else{digitalWrite(led_02, HIGH); }
}

void Funcion_bt2(void *ptr){
    uint32_t Estado_dual;
    bt2.getValue(&Estado_dual);
    
    if(Estado_dual){digitalWrite(led_03, LOW);}
    else{digitalWrite(led_03, HIGH); }
}

Hi Chip,

I've been watching this since you posted and I see no one has tried to help.

I'm afraid I don't know either, but the general experience of using Nextion displays with the Nextion libraries is not good. I suggest you give up using the libraries and use either the methods I set out in 'using Nextion displays with Arduino' or, if you prefer, follow Seithan's 'Tutorial on how to write code with Nextion and Arduino'.

With either my methods or Seithan's you'll get help.

Search youtube Andreas Spiess, has done several tutorials on Nextion and ESP32 and it seems, from the comments of users, that it works. From today I'm following them. If my little brain comes to understand something about it I'll publish the solution. Try it yourself, at least we are in 2... See you soon.
chipxx

If my little brain comes to understand something about it I'll publish the solution.

Maybe in time you will become the Nextion library expert on here.

Try it yourself

I'll give it a miss, I don't like the libraries, thanks.