gfurtadoalmeida / esp32-driver-nextion

ESP32 driver for Nextion displays.
MIT License
17 stars 7 forks source link

Initialisation error #1

Closed shaurya0406 closed 3 years ago

shaurya0406 commented 3 years ago

I am getting this error: E (371) example: could not init nextion device

and I don't think its a hardware issue as I am able to communicate with Nextion display using Arduino library on UART2 ie Serial2 in Arduino.

gfurtadoalmeida commented 3 years ago

Hi @shaurya0406,

Would you mind providing an example code and what the returned error code is? Most functions return a nex_err_t, which has its values taken from "code.h".

Have you implemented the communication interface as shown in the Installation Instructions?

Could you implement the macros NEX_LOG* on the "common_infra.h" file, to write the error messages to some place? I still have to figure it out how to make a better error logging.

shaurya0406 commented 3 years ago

I was referring to this code

https://github.com/gfurtadoalmeida/esp32-driver-nextion/blob/master/examples/listen_button_released.c

and I am using ESP-IDF

gfurtadoalmeida commented 3 years ago

That example is using a baud rate of 115200. Is that the same baud rate configured on you Nextion device? By default, all devices use 9600.

By the way, this is the repo for my generic Nextion library :laughing:

shaurya0406 commented 3 years ago

oh ok so should I shift to that repo? and I tried with 9600 baud rate as well. Got the same error.

gfurtadoalmeida commented 3 years ago

I've just transfered it :thumbsup: Give me some hours while I try that code on my hardware.

gfurtadoalmeida commented 3 years ago

Hi @shaurya0406 can you try it? You'll need to delete and clone again because the submodule (iot-lib-nextion) was updated. All tests passed and it worked on my hardware.

shaurya0406 commented 3 years ago

Yes, it's working properly. Thank you.