ballaswag / guppyscreen

A native Touch UI for 3D Printers running Klipper/Moonraker.
GNU General Public License v3.0
166 stars 14 forks source link

Touchscreen keypad not debounced? #76

Closed MrDix closed 3 weeks ago

MrDix commented 1 month ago

When I try to enter a temperature using the on-screen keypad of my K1, each number appears 2-3 times. I'm unable to enter a single digit quickly enough. For instance, I can't set the bed temperature to exactly 100°C; I can only reach 99°C or 111°C. However, the regular menu buttons and the file chooser touchscreen work flawlessly. I have installed the latest version of the guppy screen, which was updated via the on-screen update feature.

I assume this issue isn't common, otherwise, I believe others would have mentioned it. Is there a debouncing option for the keypad that I might not be aware of, or could there be another problem?

Thank you for your hard work and all the fantastic tools you've developed for the K1!

Best regards, Th0mas

ballaswag commented 1 month ago

Please share a short video showing the behavior. Will take a look.

MrDix commented 1 month ago

Currently its printing but as soon as it is done I'll shoot the video. Thank you for the quick reply!

MrDix commented 1 month ago

Here is a short video which shows the problem on my Creality K1 with guppy screen 0.0.22-beta (and previous versions): https://youtu.be/K0vR7zI4lQ8?si=K-fFl_c5kAdxBMX3

ballaswag commented 1 month ago

This is new to me. This happens even before 0.0.22-beta? Give latest 0.0.23-beta a try (nothing specific was added to handle this behavior though).

MrDix commented 1 month ago

It was happening with my previous version as well but I can not tell you if it worked in an (much) earlier version as I have never typed temperatures on the screen before. I've updated to 0.0.23-beta an the problem persisted.

ajs123 commented 1 month ago

I'm chiming in because I helped with a pulldown menu issue that could be related. @MrDix - If you go to Options (the gear) then System, do the switches for the last two options seem to work properly? When you tap once as you would on the numeric keypad, does a switch ever go off then immediately back on?

I have no experience with lvgl, but I'm wondering whether some of these resistive touchpads are bouncier than others. Looking through lvgl, I'm seeing its tick timer being used only to detect long presses, i.e., not to debounce. If this is the case, the culprit could be the Creality /dev/input/event0 touchpad driver but debounce should be possible.

MrDix commented 1 month ago

@ajs123 Thank you for joining in. The two switches in the System menu work flawless and have no bouncing problem on my screen like the keypad has. Have clicked several times on each of them and they always switched like expected.

chiksum commented 1 month ago

Yes this happened to me too, I am on 0.0.23-beta. The keyboard is unable to use.

mxfi commented 1 month ago

Adding in a +1 in terms of having the same multi tap, normal taps come out as 2-4 items (ie selecting 1 give 1111). When touch tapping it as fast as I can, I can make it give a single digit. This is new after updating guppy screen and helper script. I think when running last firmware (or whatever it was 2 weeks ago, I never had this issue, only after updating recently). I also noticed a bit of a burn in on the screen which I never experienced before, don't know if it's related.

Running 1.3.3.8 Creality and most recent guppy + helper script

ajs123 commented 1 month ago

@ballaswag this might be the kernel module behind /dev/input/event0. If so, it's simply reading the current state every 30 ms. If you think that a debounce in lv_tc_indev_drv_read_cb.c is appropriate, I don't mind writing one. I do not have this problem on my Nebula pad but it should be testable by setting a long debounce interval.

ballaswag commented 1 month ago

@ballaswag this might be the kernel module behind /dev/input/event0. If so, it's simply reading the current state every 30 ms. If you think that a debounce in lv_tc_indev_drv_read_cb.c is appropriate, I don't mind writing one. I do not have this problem on my Nebula pad but it should be testable by setting a long debounce interval.

I'm not sure debouncing is the actual issue. I'm running the latest on my K1 as well, but I can't reproduce the problem. The K1 path doesn't get wrapped by the lv_tc* stuff because it's calibrated as is. It directly interacts with evdev_read. The only thing that has changed was removing the coordinate clamping.

If anyone with this issue, please install 0.0.21-beta and see if the issue was present before.

MrDix commented 1 month ago

How can I downgrade guppyscreen? I've downloaded guppyscreen.tar.gz from assets list of release 0.0.21-beta, copied it to the printer, extracted it an run the guppyscreen/installer.sh but this installer uses curl to download and install the latest version.

ballaswag commented 1 month ago

Download guppyscreen.tar.gz here https://github.com/ballaswag/guppyscreen/releases/tag/0.0.21-beta

Stop guppyscreen: /etc/init.d/S99guppyscreen stop

tar xf guppyscreen.tar.gz Copy and replace guppyscreen with the new one. The restart it:

/etc/init.d/S99guppyscreen restart

MrDix commented 4 weeks ago

In version 0.0.21-beta the keypad is working flawless: Single click on any number buttons result in singe digits.

ballaswag commented 3 weeks ago

Nightly https://github.com/ballaswag/guppyscreen/releases/tag/nightly fixes the keyboard issue.

mxfi commented 3 weeks ago

https://github.com/ballaswag/guppyscreen/releases/tag/nightly

can confirm, nightly build fixes it. Had .23 beta before, uninstalled it through terminal and reinstalled it via nightly build command

"sh -c "$(wget --no-check-certificate -qO - https://raw.githubusercontent.com/ballaswag/guppyscreen/main/installer.sh)" -s nightly"

touch screen all working as it should. Did you figure out what the issue ended up being? And what is the nightly build? Just the most recent developments with test fixes?

ballaswag commented 3 weeks ago

Nightly is the latest development build. The fix is simple, I accidentally removed the indev driver initialization for the non-calibrated path:

https://github.com/ballaswag/guppyscreen/commit/97de810936e2628d57154f6db555b5bbf494656a

mxfi commented 3 weeks ago

Nightly is the latest development build. The fix is simple, I accidentally removed the indev driver initialization for the non-calibrated path:

97de810

Ah, still new to git and code, thanks for the fix and explaining it :)

downloaded newest beta 0.0.24 and it's working great!

Cheers

MrDix commented 3 weeks ago

Thank you very much and sorry for the late reply! I was away from home for three days due to an injury.

MrDix commented 3 weeks ago

It works perfectly again <3