Kivy Touch Screen for Raspberry Pi

Here's the scenario: I wrote gui using the python Kivy frame , and I want to run it on raspberry pi with this touch screen . I did an excellent installation, and the TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen FRAMEBUFFER=/dev/fb1 nohup startx &xwindow desktop is getting working. However, I could not get the qiwi-gi to work. I was able to get a tkinter test application that works fine, setting an environment variable DISPLAY.

I tried putting the following at the top of my kivy application, but to no avail:

os.environ['SDL_VIDEODRIVER'] = 'fbcon'
os.environ['SDL_FBDEV'] = '/dev/fb1'
os.environ['SDL_MOUSEDRV'] = 'TSLIB'
os.environ['SDL_MOUSEDEV'] = '/dev/input/touchscreen'

When I run my application, this is the debug output:

[INFO   ] [Logger      ] Record log in /home/pi/.kivy/logs/kivy_14-04-21_10.txt
[INFO   ] Kivy v1.8.1-dev
[INFO   ] [Python      ] v2.7.3 (default, Mar 18 2014, 05:13:23) 
[GCC 4.6.3]
[INFO   ] [Factory     ] 157 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_pygame, img_gif (img_pil ignored)
[INFO   ] [Text        ] Provider: pygame
[INFO   ] [Loader      ] using a thread pool of 2 workers
[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   ] [GL          ] NPOT texture support is available
[INFO   ] [OSC         ] using <multiprocessing> for socket
[INFO   ] [ProbeSysfs  ] device match: /dev/input/event0
[INFO   ] [HIDInput    ] Read event from </dev/input/event0>
[INFO   ] [Base        ] Start application main loop
[INFO   ] [HIDMotionEvent] using <stmpe-ts>

(-) ..; , - . , , , pygame, kivy pygame.

:

  • - , , , DISPLAY FBDEV. , directfb fbcon.
  • kivy google

- , .

. !

+4
2

. SPI SPI, : http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus

Kivy Raspberry Pi, SPI X11. , GLES SPI .

.. , GLES X11

+3

, , /boot/config.txt

disable_overscan=1

fbcp

fbcp &

, , ( kivy python3.4):

python3.4 kivy/examples/demo/showcase/main.py

kivy running on SPI display

Touch , , y .

0

Source: https://habr.com/ru/post/1537413/


All Articles