Start a new topic

Touch not working


I hope you are doing well. I am trying to build my first project on nextion 3.2" basic LCD but I am having issues. Touch events are not responding for single components except page touch events.File attached

Am I missing something, Can you help me?

(10.1 KB)

Hi Muhammad

I have reviewed your attached HMI file.  Compiled and in the Debug Simulator

My observations are

   Send Component ID for each component is being transmitted

   In the attached HMI you have no event code in any of the events other than Page PostInitialize Event

   The timer is set to attempt to execute an empty event every 400ms

   click r0,1 - empty event

   click r1,1 - empty event

   click page0,1 - empty event

   tsw 255,1 is redundant as there have been no components where touch was disabled.

Unless there is mcu code that is working with the HMI, I am not certain what wouldn't be working.

I would recommend against triggering empty events.

If it is that your touch sensor has become corrupted as a result

  1. Create an empty HMI file for your device
  2. Save this as RestoreTouch.HMI
  3. In the Page Postinitialization Event put touch_j
  4. Compile this new HMI
  5. Format your microSD card to FAT32
  6. Open Build Folder
  7. Copy RestoreTouch.tft to yur microSD
  8. Power off Nextion device
  9. Insert microSD
  10. Power on Nextion device - allow firmware to upgrade to this tft
  11. When "Successed" - power off device and remove microSD
  12. Power up Nextion device - calibrate touch sensor
After this has been completed, your device touch should once again be fine.

There is no need to include touch_j in every HMI build - only when touch sensor is corrupted.
There remains the possibility rapid touch will overload the Rx/Tx buffer.


Thanks for prompt response. 

I am not inserting SD card at the moment, I am programming using FTDI. Do I need to use SD card?

You may benefit from the Nextion User Manual page that has some tutorials and articles.

Radio buttons are round checkboxes UNTIL programmed to behave as radio buttons.

- Article on Radio Buttons can be found in the Nextion Gallery here

To have your graphical button operate some event will need to issue:

  • p0.pic=1 // swap graphical button picture to picture #1 with green light
  • p0.pic=0 // swap graphical button picture to picture #0 with no light

The best place to discuss approaches for code is under the category Free Chat
- Itead Studios only offers level 2 hardware support to ensure device is functioning.

Transferring over serial FTDI should be okay ... just remember that SD is a reliable backup.

Yes I did tried p0.pic=0

but the issue as I mentioned is touch events are not being sent for any component but If I activate Page event then it responds

and yes in debug simulator it works fine (only simulation,) as I click on simulation buttons responds, but on hardware touch isnt being accepted for components

Can you send simple project that can react on press of a button, I hope it may help me quickly analyze the issue

Thanks, I got it working after calibrating touch. Thanks a lot!

I have icecream.hmi attached to the article for v38 radio buttons.

I also have keypass.hmi attached on second page Example Keyboard

There are examples in the Nextion User Manual for entry and advance applications

Glad you got it working again.

Be cautious not to overload the serial RX/TX buffers, hardware wise, they are limited to 8 bytes.

Send over serial that which is necessary (try to not send the unnecessary such as send component ID when not debugging - after debug turn off if not needed)

Reserve the use of tsw for advanced use later when you are attempting advanced applications

Try to only trigger Events that have a series of commands in the event.

I will try to minimize event call for serial communication.