无法成功启动Raspberry Pi 3上的Kivy应用程序,3.5英寸触摸屏
问题描述:
我遵循了关于将Kivy安装到Raspberry Pi的每个指南。无法成功启动Raspberry Pi 3上的Kivy应用程序,3.5英寸触摸屏
我的触摸屏完全正常,我不认为Kivy没有正确启动与此有关。
试图启动各种Kivy演示将导致似乎是部分启动,但然后它只会挂....也许我的config.ini配置不正确?
例如,运行示例/演示/图片 '蟒蛇main.py'/给我:
[INFO ] [Logger ] Record log in /home/pi/.kivy/logs/kivy_16-04-25_12.txt
[INFO ] [Kivy ] v1.9.2-dev0
[INFO ] [Python ] v2.7.9 (default, Mar 8 2015, 00:52:26)
[GCC 4.9.2]
[INFO ] [Factory ] 193 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_gif, img_pygame, img_pil (img_ffpyplayer ignored)
[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 ] [Text ] Provider: pygame
[INFO ] [OSC ] using <multiprocessing> for socket
[INFO ] [ProbeSysfs ] device match: /dev/input/event0
[INFO ] [MTD ] Read event from </dev/input/event0>
[INFO ] [ProbeSysfs ] device match: /dev/input/event0
[INFO ] [HIDInput ] Read event from </dev/input/event0>
[INFO ] [Base ] Start application main loop
[INFO ] [MTD ] </dev/input/event0> range position X is 0 - 4095
[INFO ] [MTD ] </dev/input/event0> range position Y is 0 - 4095
[INFO ] [MTD ] </dev/input/event0> range touch major is 0 - 0
[INFO ] [MTD ] </dev/input/event0> range touch minor is 0 - 0
[INFO ] [MTD ] </dev/input/event0> range pressure is 0 - 255
[INFO ] [MTD ] </dev/input/event0> axes invertion: X is 0, Y is 0
[INFO ] [MTD ] </dev/input/event0> rotation set to 0
[INFO ] [HIDMotionEvent] using <ADS7846 Touchscreen>
[INFO ] [HIDMotionEvent] <ADS7846 Touchscreen> range ABS X position is 0 - 4095
[INFO ] [HIDMotionEvent] <ADS7846 Touchscreen> range ABS Y position is 0 - 4095
[INFO ] [HIDMotionEvent] <ADS7846 Touchscreen> range ABS pressure is 0 - 65535
然后它只是挂起,直到永远。没有窗口弹出,什么都没有。
同样的事情发生在触摸屏上,通过SSH运行,并通过tightvncserver远程桌面运行。
更新: 没有好消息,但一些更多的细节。与裸机应用(https://kivy.org/docs/guide/basic.html#quickstart)用键盘中断运行:
[INFO ] [Logger ] Record log in /home/pi/.kivy/logs/kivy_16-04-26_17.txt
[INFO ] [Kivy ] v1.9.2-dev0
[INFO ] [Python ] v2.7.9 (default, Mar 8 2015, 00:52:26)
[GCC 4.9.2]
[INFO ] [Factory ] 193 symbols loaded
[DEBUG ] [Cache ] register <kv.lang> with limit=None, timeout=None
[TRACE ] [Builder ] load file /home/pi/kivy/kivy/data/style.kv
[TRACE ] [Parser ] parsing 1271 lines
[TRACE ] [Parser ] got directive <kivy 1.0>
[TRACE ] [Builder ] build rule for <Label>
[TRACE ] [Builder ] build rule for <-Button,-ToggleButton>
[TRACE ] [Builder ] build rule for <BubbleContent>
[TRACE ] [Builder ] build rule for <BubbleButton>
[TRACE ] [Builder ] build rule for <Slider>
[TRACE ] [Builder ] build rule for <ProgressBar>
[TRACE ] [Builder ] build rule for <SplitterStrip>
[TRACE ] [Builder ] build rule for <Scatter>
[TRACE ] [Builder ] build rule for <RelativeLayout>
[TRACE ] [Builder ] build rule for <Image,AsyncImage>
[TRACE ] [Builder ] build rule for <EffectWidget>
[TRACE ] [Builder ] build rule for <TabbedPanelContent>
[TRACE ] [Builder ] build rule for <TabbedPanelStrip>
[TRACE ] [Builder ] build rule for <StripLayout>
[TRACE ] [Builder ] build rule for <TabbedPanelHeader>
[TRACE ] [Builder ] build rule for <Selector>
[TRACE ] [Builder ] build rule for <TextInput>
[TRACE ] [Builder ] build rule for <TextInputCutCopyPaste>
[TRACE ] [Builder ] build rule for <CodeInput>
[TRACE ] [Builder ] build rule for <TreeViewNode>
[TRACE ] [Builder ] build rule for <TreeViewLabel>
[TRACE ] [Builder ] build rule for <StencilView>
[TRACE ] [Builder ] build rule for <FileChooserListLayout>
[TRACE ] [Builder ] build rule for <FileChooserListView>
[TRACE ] [Builder ] build template for [[email protected]+TreeViewNode]
[TRACE ] [Builder ] build rule for <FileChooserIconLayout>
[TRACE ] [Builder ] build rule for <FileChooserIconView>
[TRACE ] [Builder ] build template for [[email protected]]
[TRACE ] [Builder ] build rule for <FileChooserProgress>
[TRACE ] [Builder ] build rule for <Switch>
[TRACE ] [Builder ] build rule for <ModalView>
[TRACE ] [Builder ] build rule for <Popup>
[TRACE ] [Builder ] build rule for <SpinnerOption>
[TRACE ] [Builder ] build rule for <Spinner>
[TRACE ] [Builder ] build rule for <ActionBar>
[TRACE ] [Builder ] build rule for <ActionView>
[TRACE ] [Builder ] build rule for <ActionSeparator>
[TRACE ] [Builder ] build rule for <ActionButton,ActionToggleButton>
[TRACE ] [Builder ] build rule for <ActionLabel>
[TRACE ] [Builder ] build rule for <ActionGroup>
[TRACE ] [Builder ] build rule for <ActionCheck>
[TRACE ] [Builder ] build rule for <[email protected]>
[TRACE ] [Builder ] build rule for <[email protected]>
[TRACE ] [Builder ] build rule for <ActionPrevious>
[TRACE ] [Builder ] build rule for <ActionGroup>
[TRACE ] [Builder ] build rule for <ActionOverflow>
[TRACE ] [Builder ] build rule for <ActionDropDown>
[TRACE ] [Builder ] build template for [[email protected]]
[TRACE ] [Builder ] build rule for <AccordionItem>
[TRACE ] [Builder ] build rule for <SettingSpacer>
[TRACE ] [Builder ] build rule for <SettingItem>
[TRACE ] [Builder ] build rule for <SettingBoolean>
[TRACE ] [Builder ] build rule for <SettingString>
[TRACE ] [Builder ] build rule for <SettingPath>
[TRACE ] [Builder ] build rule for <SettingOptions>
[TRACE ] [Builder ] build rule for <SettingTitle>
[TRACE ] [Builder ] build rule for <SettingSidebarLabel>
[TRACE ] [Builder ] build rule for <SettingsPanel>
[TRACE ] [Builder ] build rule for <Settings>
[TRACE ] [Builder ] build rule for <InterfaceWithSidebar>
[TRACE ] [Builder ] build rule for <InterfaceWithSpinner>
[TRACE ] [Builder ] build rule for <MenuSpinner>
[TRACE ] [Builder ] build rule for <MenuSidebar>
[TRACE ] [Builder ] build rule for <ContentPanel>
[TRACE ] [Builder ] build rule for <InterfaceWithTabbedPanel>
[TRACE ] [Builder ] build rule for <ScrollView>
[TRACE ] [Builder ] build rule for <VideoPlayerPreview>
[TRACE ] [Builder ] build rule for <VideoPlayerAnnotation>
[TRACE ] [Builder ] build rule for <VideoPlayer>
[TRACE ] [Builder ] build rule for <CheckBox>
[TRACE ] [Builder ] build rule for <ScreenManager>
[TRACE ] [Builder ] build rule for <[email protected]>
[TRACE ] [Builder ] build rule for <[email protected]>
[TRACE ] [Builder ] build rule for <[email protected]>
[TRACE ] [Builder ] build rule for <ColorWheel>
[TRACE ] [Builder ] build rule for <ColorPicker>
[DEBUG ] [Cache ] register <kv.image> with limit=None, timeout=60
[DEBUG ] [Cache ] register <kv.atlas> with limit=None, timeout=None
[TRACE ] [Image ] Unable to use <gif> as loader!
[TRACE ]
Traceback (most recent call last):
File "/home/pi/kivy/kivy/core/__init__.py", line 129, in core_register_libs
level=0)
File "/home/pi/kivy/kivy/core/image/img_ffpyplayer.py", line 7, in <module>
import ffpyplayer
ImportError: No module named ffpyplayer
[INFO ] [Image ] Providers: img_tex, img_dds, img_gif, img_pygame, img_pil (img_ffpyplayer ignored)
[DEBUG ] [Cache ] register <kv.texture> with limit=1000, timeout=60
[DEBUG ] [Cache ] register <kv.shader> with limit=1000, timeout=3600
[INFO ] [Text ] Provider: pygame
[DEBUG ] [App ] Loading kv <./my.kv>
[DEBUG ] [App ] kv <./my.kv> not found
[INFO ] [Window ] Provider: egl_rpi
[DEBUG ] [Window ] Actual display size: 720x480
[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>
[DEBUG ] [Shader ] Fragment compiled successfully
[INFO ] [Shader ] vertex shader: <Compiled>
[DEBUG ] [Shader ] Vertex compiled successfully
[DEBUG ] [ImagePygame ] Load </home/pi/kivy/kivy/data/glsl/default.png>
[TRACE ] [Image ] '/home/pi/kivy/kivy/data/glsl/default.png', populate to textures (1)
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[TRACE ] [Builder ] Found 1 rules for <kivy.uix.label.Label object at 0x74333458>
[DEBUG ] [Resource ] add </usr/share/fonts/truetype> in path list
[DEBUG ] [Resource ] add </usr/share/fonts/truetype/freefont> in path list
[DEBUG ] [Resource ] add </usr/share/fonts/truetype/roboto> in path list
[DEBUG ] [Resource ] add </usr/share/fonts/truetype/openoffice> in path list
[DEBUG ] [Resource ] add </usr/share/fonts/truetype/dejavu> in path list
[DEBUG ] [Resource ] add </usr/share/fonts/truetype/gentium-basic> in path list
[DEBUG ] [Resource ] add </usr/local/share/fonts> in path list
[DEBUG ] [Resource ] add </home/pi/kivy/kivy/data/fonts> in path list
[INFO ] [OSC ] using <multiprocessing> for socket
[DEBUG ] [Base ] Create provider from mouse
[INFO ] [Base ] Start application main loop
[INFO ] [GL ] NPOT texture support is available
[TRACE ] [Builder ] call_fn <kivy.graphics.vertex_instructions.Rectangle object at 0x74317650>, key=size, value=<code object <module> at 0x76553890, file "/home/pi/kivy/kivy/data/style.kv", line 9>, 'self.texture_size'
[TRACE ] [Builder ] call_fn => value=[79, 18]
[TRACE ] [Builder ] call_fn <kivy.graphics.vertex_instructions.Rectangle object at 0x74317650>, key=texture, value=<code object <module> at 0x76553608, file "/home/pi/kivy/kivy/data/style.kv", line 8>, 'self.texture'
[TRACE ] [Builder ] call_fn => value=<Texture hash=1945546224 id=0 size=(79, 18) colorfmt='rgba' bufferfmt='ubyte' source=None observers=1>
[TRACE ] [Builder ] call_fn <kivy.graphics.vertex_instructions.Rectangle object at 0x74317650>, key=pos, value=<code object <module> at 0x765538d8, file "/home/pi/kivy/kivy/data/style.kv", line 10>, 'int(self.center_x - self.texture_size[0]/2.), int(self.center_y - self.texture_size[1]/2.)'
[TRACE ] [Builder ] call_fn => value=(320, 231)
^C[INFO ] [Base ] Leaving application in progress...
Traceback (most recent call last):
File "main.py", line 11, in <module>
MyApp().run()
File "/home/pi/kivy/kivy/app.py", line 828, in run
runTouchApp()
File "/home/pi/kivy/kivy/base.py", line 487, in runTouchApp
EventLoop.window.mainloop()
File "/home/pi/kivy/kivy/core/window/window_egl_rpi.py", line 89, in mainloop
self._mainloop()
File "/home/pi/kivy/kivy/core/window/window_egl_rpi.py", line 84, in _mainloop
EventLoop.idle()
File "/home/pi/kivy/kivy/base.py", line 327, in idle
Clock.tick()
File "/home/pi/kivy/kivy/clock.py", line 499, in tick
usleep(1000000 * (sleeptime - sleep_undershoot))
File "/home/pi/kivy/kivy/clock.py", line 292, in usleep
_libc_usleep(int(microseconds))
KeyboardInterrupt
我最好的猜测是它要么缺少ffpyplayer模块或者是与EGL。
更新2: 那么,我重新在我的Windows Kivy基本应用程序比较日志(应用程序成功启动在我的Windows基维)。 ffplayer错误仍然存在,导致我相信这是某种EGL问题。
答
也许这个tutorial可以帮到你。它使用与您一样的控制器(ADS7846)。只需跳过GPIO部分即可。存在其中文件~/.kivy/config.ini
在[输入]部分得到改变的一部分:
mouse = mouse
mtdev_%(name)s = probesysfs,provider=mtdev
hid_%(name)s = probesysfs,provider=hidinput
答
我目前与Eleduino 10.1英寸电容式触摸屏面临同样的问题。我设法解决配置文件的问题:〜/ .kivy/config.ini 转到[input]部分并评论一切。然后,添加以下行:
test = mtdev,/dev/input/event3
ntrig = mtdev,/dev/input/event1
我确切地说。虽然这个特定的配置部分似乎与输入接口有关。我甚至无法成功启动应用程序。 –
嗯......你说得对。你至少应该得到一个错误信息... – salomonderossi