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 on piTFT causes Warning Traceback #2790

Open
czerwe opened this Issue Dec 25, 2014 · 9 comments

Comments

Projects
None yet
5 participants
@czerwe
Copy link

czerwe commented Dec 25, 2014

Hi,

i have an PiTFT Capacitive Screen and running Kivy in 1.9.0dev (checkout from 22.12.2014).

If i startup an basic kivy application and touch the screen i get following error:

[INFO              ] Logger: Record log in /home/pi/.kivy/logs/kivy_14-12-03_24.txt
[INFO              ] Kivy v1.9.0-dev
[INFO              ] Python: v2.7.3 (default, Mar 18 2014, 05:13:23)
[GCC 4.6.3]
[INFO              ] Factory: 172 symbols loaded
[INFO              ] Image: Providers: img_tex, img_dds, img_pygame, img_gif (img_sdl2, img_ffpyplayer, img_pil ignored)
[INFO              ] Text: Provider: pygame
[INFO              ] Window: Provider: egl_rpi
[INFO              ] GL: OpenGL version <OpenGL ES 2.0>
[INFO              ] GL: OpenGL vendor <Broadcom>
[INFO              ] GL: OpenGL renderer <VideoCore IV HW>
[INFO              ] GL: OpenGL parsed version: 2, 0
[INFO              ] GL: Shading version <OpenGL ES GLSL ES 1.00>
[INFO              ] GL: Texture max size <2048>
[INFO              ] GL: Texture max units <8>
[INFO              ] Shader: fragment shader: <Compiled>
[INFO              ] Shader: vertex shader: <Compiled>
[INFO              ] Window: virtual keyboard not allowed, single mode, not docked
[INFO              ] OSC: using <multiprocessing> for socket
[INFO              ] ProbeSysfs: device match: /dev/input/event2
[INFO              ] HIDInput: Read event from </dev/input/event2>
[INFO              ] Base: Start application main loop
[INFO              ] HIDMotionEvent: using <ft6x06_ts>
[INFO              ] GL: NPOT texture support is available
[INFO              ] HIDMotionEvent: <ft6x06_ts> range position X is 0 - 4095
[INFO              ] HIDMotionEvent: <ft6x06_ts> range position Y is 0 - 4095
[INFO              ] HIDMotionEvent: <ft6x06_ts> range pressure is 0 - 255
[WARNING           ] stderr: Exception in thread Thread-1:
[WARNING           ] stderr: Traceback (most recent call last):
[WARNING           ] stderr:   File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
[WARNING           ] stderr:     self.run()
[WARNING           ] stderr:   File "/usr/lib/python2.7/threading.py", line 505, in run
[WARNING           ] stderr:     self.__target(*self.__args, **self.__kwargs)
[WARNING           ] stderr:   File "/usr/local/lib/python2.7/dist-packages/kivy/input/providers/hidinput.py", line 598, in _thread_run
[WARNING           ] stderr:     process_as_multitouch(*infos)
[WARNING           ] stderr:   File "/usr/local/lib/python2.7/dist-packages/kivy/input/providers/hidinput.py", line 388, in process_as_multitouch
[WARNING           ] stderr:     process(l_points)
[WARNING           ] stderr:   File "/usr/local/lib/python2.7/dist-packages/kivy/input/providers/hidinput.py", line 509, in process
[WARNING           ] stderr:     touch = HIDMotionEvent(device, tid, args)
[WARNING           ] stderr:   File "/usr/local/lib/python2.7/dist-packages/kivy/input/motionevent.py", line 286, in __init__
[WARNING           ] stderr:     self.depack(args)
[WARNING           ] stderr:   File "/usr/local/lib/python2.7/dist-packages/kivy/input/providers/hidinput.py", line 56, in depack
[WARNING           ] stderr:     self.sx = args['x']
[WARNING           ] stderr: KeyError: 'x'`

Could this be related to: #2656?

What do i miss?

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@czerwe

This comment has been minimized.

Copy link
Author

czerwe commented Dec 30, 2014

Hi,
obviously i missing the proper configuration for the PiTFT in the .kivy/config.ini.
I tried to add following:

[input]
mouse = mouse
pitft = hidinput,/dev/input/touchscreen,max_position_x=320,max_position_y=240
%(name)s = probesysfs,provider=hidinput

but it didin't work out. Although the error output changing.
Does anybody have experience how to configure Kivy to run with the PiTFT touch correctly? I running kivy without the X11 with the FBCP as described in #2656.

@czerwe

This comment has been minimized.

Copy link
Author

czerwe commented Jan 1, 2015

Hi,

i found out an configuration which is almost working for me:
[input]
pitft = mtdev,/dev/input/touchscreen,max_position_x=240,max_position_y=320

Wth hidinput i get always the problem that he's not able to unpack x (and y as well, since none of them exists in the parameters).

The provider mtdev is working better but now i have the same rotation problem as it is fixed in the hidinput during issue #2656 . Is is possible to move this additional option to the mtdev provider as well?

@tito tito added the platform-rpi label Jan 18, 2015

@tito

This comment has been minimized.

Copy link
Member

tito commented Jan 18, 2015

Can you post a trace of your touchscreen event from evtest? And explain what you did to make it crash?

Just to ensure the issue is something we can fix or not, and maybe hidinput got the fix not mtdev, or the inverse.

@czerwe

This comment has been minimized.

Copy link
Author

czerwe commented Jan 18, 2015

Hi,

i made an workaround by using the mtdev provider and implemented an rotate agruments based on the changes done by tshirtman in an early stage from #2656 (i saw already that the. But hidinput seems to miss the x and y axis informations inside the parameters. When i printed the arguments from the hidinput i wasn't able to find the x and y inside.

my current configuration string (remember that i altered the mtdev provider) is:

pitft = mtdev,/dev/input/touchscreen,max_position_x=240,max_position_y=320,invert_y=1,invert_x=0,rotate=90

I attach an output from evtest. It's just an random output i hope that's ok:

Event: time 1418829326.904420, ++++++++++++++ SYN_MT_REPORT ++++++++++++
Event: time 1418829326.904420, -------------- SYN_REPORT ------------
Event: time 1418829326.916576, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 186
Event: time 1418829326.916576, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 174
Event: time 1418829326.916576, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 127
Event: time 1418829326.916576, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 1418829326.916576, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 127
Event: time 1418829326.916576, ++++++++++++++ SYN_MT_REPORT ++++++++++++
Event: time 1418829326.916576, type 3 (EV_ABS), code 0 (ABS_X), value 186
Event: time 1418829326.916576, type 3 (EV_ABS), code 1 (ABS_Y), value 174
Event: time 1418829326.916576, -------------- SYN_REPORT ------------
Event: time 1418829326.928769, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 186
Event: time 1418829326.928769, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 174
Event: time 1418829326.928769, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 127
Event: time 1418829326.928769, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 1418829326.928769, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 127
Event: time 1418829326.928769, ++++++++++++++ SYN_MT_REPORT ++++++++++++
Event: time 1418829326.928769, -------------- SYN_REPORT ------------
Event: time 1418829326.941926, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 183
Event: time 1418829326.941926, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 172
Event: time 1418829326.941926, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 127
Event: time 1418829326.941926, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 1418829326.941926, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 127
Event: time 1418829326.941926, ++++++++++++++ SYN_MT_REPORT ++++++++++++
Event: time 1418829326.941926, type 3 (EV_ABS), code 0 (ABS_X), value 183
Event: time 1418829326.941926, type 3 (EV_ABS), code 1 (ABS_Y), value 172
Event: time 1418829326.941926, -------------- SYN_REPORT ------------
Event: time 1418829326.953720, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 183
Event: time 1418829326.953720, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 172
Event: time 1418829326.953720, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 127
Event: time 1418829326.953720, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 1418829326.953720, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 127
Event: time 1418829326.953720, ++++++++++++++ SYN_MT_REPORT ++++++++++++
Event: time 1418829326.953720, -------------- SYN_REPORT ------------
Event: time 1418829326.967242, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 180
Event: time 1418829326.967242, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 170
Event: time 1418829326.967242, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 127
Event: time 1418829326.967242, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 1418829326.967242, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 127
Event: time 1418829326.967242, ++++++++++++++ SYN_MT_REPORT ++++++++++++
Event: time 1418829326.967242, type 3 (EV_ABS), code 0 (ABS_X), value 180
Event: time 1418829326.967242, type 3 (EV_ABS), code 1 (ABS_Y), value 170
Event: time 1418829326.967242, -------------- SYN_REPORT ------------
Event: time 1418829326.976816, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 177
Event: time 1418829326.976816, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 169
Event: time 1418829326.976816, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 127
Event: time 1418829326.976816, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 1418829326.976816, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 127
Event: time 1418829326.976816, ++++++++++++++ SYN_MT_REPORT ++++++++++++
Event: time 1418829326.976816, type 3 (EV_ABS), code 0 (ABS_X), value 177
Event: time 1418829326.976816, type 3 (EV_ABS), code 1 (ABS_Y), value 169
Event: time 1418829326.976816, -------------- SYN_REPORT ------------
Event: time 1418829326.989163, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 175
Event: time 1418829326.989163, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 168
Event: time 1418829326.989163, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 127
Event: time 1418829326.989163, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 1418829326.989163, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 127
Event: time 1418829326.989163, ++++++++++++++ SYN_MT_REPORT ++++++++++++
Event: time 1418829326.989163, type 3 (EV_ABS), code 0 (ABS_X), value 175
Event: time 1418829326.989163, type 3 (EV_ABS), code 1 (ABS_Y), value 168
Event: time 1418829326.989163, -------------- SYN_REPORT ------------
Event: time 1418829327.001628, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 172
Event: time 1418829327.001628, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 168
Event: time 1418829327.001628, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 127
Event: time 1418829327.001628, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 1418829327.001628, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 127
Event: time 1418829327.001628, ++++++++++++++ SYN_MT_REPORT ++++++++++++
Event: time 1418829327.001628, type 3 (EV_ABS), code 0 (ABS_X), value 172
Event: time 1418829327.001628, -------------- SYN_REPORT ------------
Event: time 1418829327.012777, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 170
Event: time 1418829327.012777, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 167
Event: time 1418829327.012777, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 127
Event: time 1418829327.012777, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 1418829327.012777, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 127
Event: time 1418829327.012777, ++++++++++++++ SYN_MT_REPORT ++++++++++++
Event: time 1418829327.012777, type 3 (EV_ABS), code 0 (ABS_X), value 170
Event: time 1418829327.012777, type 3 (EV_ABS), code 1 (ABS_Y), value 167
Event: time 1418829327.012777, -------------- SYN_REPORT ------------
Event: time 1418829327.024800, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 167
Event: time 1418829327.024800, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 166
Event: time 1418829327.024800, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 127
Event: time 1418829327.024800, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 1418829327.024800, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 127
Event: time 1418829327.024800, ++++++++++++++ SYN_MT_REPORT ++++++++++++
Event: time 1418829327.024800, type 3 (EV_ABS), code 0 (ABS_X), value 167
Event: time 1418829327.024800, type 3 (EV_ABS), code 1 (ABS_Y), value 166
Event: time 1418829327.024800, -------------- SYN_REPORT ------------
Event: time 1418829327.037109, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 164
Event: time 1418829327.037109, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 166
Event: time 1418829327.037109, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 127
Event: time 1418829327.037109, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 1418829327.037109, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 127
Event: time 1418829327.037109, ++++++++++++++ SYN_MT_REPORT ++++++++++++
Event: time 1418829327.037109, type 3 (EV_ABS), code 0 (ABS_X), value 164
Event: time 1418829327.037109, -------------- SYN_REPORT ------------
Event: time 1418829327.050370, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 161
Event: time 1418829327.050370, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 166
Event: time 1418829327.050370, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 127
Event: time 1418829327.050370, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 1418829327.050370, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 127
Event: time 1418829327.050370, ++++++++++++++ SYN_MT_REPORT ++++++++++++
Event: time 1418829327.050370, type 3 (EV_ABS), code 0 (ABS_X), value 161
Event: time 1418829327.050370, -------------- SYN_REPORT ------------
Event: time 1418829327.061740, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 159
Event: time 1418829327.061740, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 166
Event: time 1418829327.061740, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 127
Event: time 1418829327.061740, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 1418829327.061740, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 127
Event: time 1418829327.061740, ++++++++++++++ SYN_MT_REPORT ++++++++++++
Event: time 1418829327.061740, type 3 (EV_ABS), code 0 (ABS_X), value 159
Event: time 1418829327.061740, -------------- SYN_REPORT ------------
Event: time 1418829327.075492, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 157
Event: time 1418829327.075492, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 166
Event: time 1418829327.075492, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 127
Event: time 1418829327.075492, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 1418829327.075492, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 127
Event: time 1418829327.075492, ++++++++++++++ SYN_MT_REPORT ++++++++++++
Event: time 1418829327.075492, type 3 (EV_ABS), code 0 (ABS_X), value 157
Event: time 1418829327.075492, -------------- SYN_REPORT ------------
Event: time 1418829327.085103, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 155
Event: time 1418829327.085103, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 166
Event: time 1418829327.085103, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 127
Event: time 1418829327.085103, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 1418829327.085103, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 127
Event: time 1418829327.085103, ++++++++++++++ SYN_MT_REPORT ++++++++++++
Event: time 1418829327.085103, type 3 (EV_ABS), code 0 (ABS_X), value 155
Event: time 1418829327.085103, -------------- SYN_REPORT ------------
Event: time 1418829327.097075, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 152
Event: time 1418829327.097075, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 166
Event: time 1418829327.097075, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 127
Event: time 1418829327.097075, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 1418829327.097075, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 127
Event: time 1418829327.097075, ++++++++++++++ SYN_MT_REPORT ++++++++++++
Event: time 1418829327.097075, type 3 (EV_ABS), code 0 (ABS_X), value 152
Event: time 1418829327.097075, -------------- SYN_REPORT ------------
Event: time 1418829327.108871, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 150
Event: time 1418829327.108871, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 166
Event: time 1418829327.108871, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 127
Event: time 1418829327.108871, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 1418829327.108871, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 127
Event: time 1418829327.108871, ++++++++++++++ SYN_MT_REPORT ++++++++++++
Event: time 1418829327.108871, type 3 (EV_ABS), code 0 (ABS_X), value 150
Event: time 1418829327.108871, -------------- SYN_REPORT ------------
Event: time 1418829327.120898, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 0
Event: time 1418829327.120898, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 0
Event: time 1418829327.120898, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1418829327.120898, -------------- SYN_REPORT ------------

Due to my move from one flat to an small house i am not able to answer that fast (we still have only limited Internet), sorry for some delays.

Thanks for you answer.

@czerwe

This comment has been minimized.

Copy link
Author

czerwe commented Jan 19, 2015

Oh i forgot the question about what i did.
The error occures the first time i touch the screen after application startup, regardless where and which type of widget i touch.

@tpulatha

This comment has been minimized.

Copy link
Contributor

tpulatha commented Jul 9, 2015

I had the exact same issue. Fixed it by using the mtdev input provider and adding rotation to the mtdev input in kivy. (fixed another bug along the way) I will create a pull request as soon as possible.

@tpulatha

This comment has been minimized.

Copy link
Contributor

tpulatha commented Jul 9, 2015

Added in #3494

@darkopevec

This comment has been minimized.

Copy link
Contributor

darkopevec commented Oct 5, 2016

issue fixed with #4646

@stale

This comment has been minimized.

Copy link

stale bot commented Oct 7, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 7, 2017

@dessant dessant removed the stale label May 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment