First time working with ESP32 and Nextion HMI display. Having issues updating a text object on the Nextion HMI display via ESP32. Looked through a bunch of similar posts but nothing seems to work for me. Hoping someone with more experience can help.
MCU: esp32-wroom-32s
HMI: Nextion NX3224F028_011
Connections:
ESP32 micro-usb to PC
ESP32 RX2 (GPIO16) to Nextion TX
ESP32 TX2 (GPIO17) to Nextion RX
ESP32 VCC to Nextion 5V
ESP32 GND to Nextion GND
void setup() {
Serial.begin(9600); // For debugging
Serial2.begin(115200, SERIAL_8N1, 16, 17);
}
void loop() {
Serial.println("sending data to Serial2");
Serial2.print("t0.txt=");
Serial2.print("Hello");
Serial2.write("0xff");
Serial2.write("0xff");
Serial2.write("0xff");
delay(1000);
}
I receive the output to Serial but the t0 object does not update. Tried this with a couple different boards. Works fine using Arduino.
Any ideas? Please let me know if you need any more info.
Post two simple schematics showing how you have connected this to Arduino and another for ESP32. Show all connections, power, ground, and any other hardware devices connected to it.
Thanks, I tried that, same issue. I have one more board I can try. If that doesn't work, I'll probably look into using Arduino to update the HMI display and use the esp32 for it's wifi capabilities. Would be nice to not have to do that but, it is what it is.
The ESP is a 3V3 device and the Nextion is a 5V device. You need to place a level translator between the ESP 32 and the Nextion. The reason it works with the Arduino is it is a 5V processor and is using the appropriate logic levels.