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

Touch event callback not getting called #8

Closed
stijnb1234 opened this issue May 6, 2024 · 3 comments
Closed

Touch event callback not getting called #8

stijnb1234 opened this issue May 6, 2024 · 3 comments
Labels
invalid This doesn't seem right

Comments

@stijnb1234
Copy link

stijnb1234 commented May 6, 2024

Description

I implemented the driver using the example in the README. When I touch my screen, I don't get a call on the callback.

Reproduction Steps

  1. Use example code.
  2. Upload screen to Nextion device.
  3. No callback is getting called.

Expected behavior

It should just call the callback function.

Actual behavior

Nothing

Display serie.

Discovery

Display model.

NX4832F035

IDF version.

v5.2.1

Espressif SoC revision.

ESP32-WROOM-32U

Debug Logs.

No response

Other information

Do I need to change anything in the Nextion config / scripts to make the callback event work?

bool Touchscreen::init() {
  nextion = nextion_driver_install(TOUCH_UART_PORT, TOUCH_BAUDRATE,
                                   TOUCH_TX_PIN, TOUCH_RX_PIN);
  ESP_OK_CHECK_RETURN(nextion_init(nextion));

  if (!nextion_event_callback_set_on_touch(nextion, callback_touch_event)) {
    ESP_LOGE(TAG, "Failed to set touch event callback");
    return false;
  }

  return true;
}

/* static */ void Touchscreen::callback_touch_event(nextion_on_touch_event_t event) {
  ESP_LOGI(TAG, "Touch event: page_id=%d, component_id=%d", event.page_id,
           event.component_id);
}
@stijnb1234 stijnb1234 added the bug Something isn't working label May 6, 2024
@gfurtadoalmeida
Copy link
Owner

Hi @stijnb1234, please provide the logs sent to the terminal.

@stijnb1234
Copy link
Author

Issue resolved, I feel a bit dumb now, you have to check the "Send Component ID" checkbox in the Editor on the buttons you want to get the event called for.

@gfurtadoalmeida
Copy link
Owner

No problems, I've done that too 😄

The documentation was updated, with your observation added at Configure Component for Touch.

@gfurtadoalmeida gfurtadoalmeida added invalid This doesn't seem right and removed bug Something isn't working labels Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants