Code: Select all
from kivy.uix.scrollview import ScrollViewAs for the second problem, I don't know. I've no idea how the screensaver works. I don't have one running on mine.
Code: Select all
from kivy.uix.scrollview import ScrollViewCode: Select all
setterm -powersave off -blank 0 Code: Select all
#! /bin/sh
### BEGIN INIT INFO
# Provides: ssvoff
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 5
# Default-Stop: 0 1 6
# Short-Description: stops sreenblanking
# Description: prevents setterm to blank the screen after the default time
### END INIT INFO
setterm -powersave off -blank 0
Code: Select all
sudo apt-get install mopidy-spotify
Code: Select all
pi@raspberrypi ~/RPi-InfoScreen-Kivy $ python main.py
[INFO ] [Logger ] Record log in /home/pi/.kivy/logs/kivy_16-02-14_11.txt
[INFO ] [Kivy ] v1.9.2-dev0
[INFO ] [Python ] v2.7.3 (default, Mar 18 2014, 05:13:23)
[GCC 4.6.3]
[INFO ] [Factory ] 179 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 ] [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 - 800
[INFO ] [MTD ] </dev/input/event0> range position Y is 0 - 480
[INFO ] [MTD ] </dev/input/event0> range touch major is 0 - 0
[INFO ] [GL ] NPOT texture support is available
[INFO ] [HIDMotionEvent] using <FT5406 memory based driver>
[INFO ] [HIDMotionEvent] <FT5406 memory based driver> range ABS X position is 0 - 800
[INFO ] [HIDMotionEvent] <FT5406 memory based driver> range ABS Y position is 0 - 480
[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 ] [HIDMotionEvent] <FT5406 memory based driver> range position X is 0 - 800
[INFO ] [MTD ] </dev/input/event0> rotation set to 0
[INFO ] [HIDMotionEvent] <FT5406 memory based driver> range position Y is 0 - 480
^C[INFO ] [Base ] Leaving application in progress...
Traceback (most recent call last):
File "main.py", line 52, in <module>
InfoScreenApp().run()
File "/usr/local/lib/python2.7/dist-packages/kivy/app.py", line 828, in run
runTouchApp()
File "/usr/local/lib/python2.7/dist-packages/kivy/base.py", line 487, in runTouchApp
EventLoop.window.mainloop()
File "/usr/local/lib/python2.7/dist-packages/kivy/core/window/window_egl_rpi.py", line 89, in mainloop
self._mainloop()
File "/usr/local/lib/python2.7/dist-packages/kivy/core/window/window_egl_rpi.py", line 84, in _mainloop
EventLoop.idle()
File "/usr/local/lib/python2.7/dist-packages/kivy/base.py", line 327, in idle
Clock.tick()
File "/usr/local/lib/python2.7/dist-packages/kivy/clock.py", line 512, in tick
self._process_events()
File "/usr/local/lib/python2.7/dist-packages/kivy/clock.py", line 641, in _process_events
for event in events[:]:
KeyboardInterrupt







Code: Select all
127.0.0.1 - - [17/Mar/2016 21:53:34] "GET /api/londonbus/view HTTP/1.1" 200 58
192.168.0.20 - - [17/Mar/2016 21:53:35] "POST / HTTP/1.1" 200 11829Code: Select all
http://192.168.0.211:8089/api/londonbus/viewCode: Select all
{"status": "error", "message": "Could not change screen."}Code: Select all
http://192.168.0.211:8089/api/football/disableCode: Select all
{"status": "error", "message": "Could not disable football screen."}Cheers. I'll try to do a bit of debugging myself (i.e. throw in a few print statements).elParaguayo wrote:Dirk,
Thanks for the bug report. The web interface is a bit experimental as I have no prior experience of writing things like that.
That said, I thought it was working ok when I posted the code. Let me take a look tomorrow (or Saturday) and I'll see if I can fix this for you.
elP
Code: Select all
def view(self, screen):
try:
self.infoscreen.switch_to(screen)Code: Select all
'NoneType' object has no attribute 'switch_to'Code: Select all
>>>>>>>>>>>>>>>>>>>>>>>>>> webapi.py: self.infoscreen = infoscreen.base
self.infoscreen: None
>>>>>>>>> set base <<<<<<
self.base: <core.infoscreen.InfoScreen object at 0xb1bfc1f0>Based on this I put a very crude test in place: add sleep(10) before https://github.com/elParaguayo/RPi-Info ... ce.py#L225elParaguayo wrote:This is the section that should stop that part:
https://github.com/elParaguayo/RPi-Info ... #L215-L217
Maybe I need to be more explicit and get it to check for the "base" attribute too before starting the server. Easy enough fix if so.
Code: Select all
while infoapp is None:
infoapp = App.get_running_app()
if infoapp and infoapp.base is None:
infoapp = None
sleep(1)Code: Select all
infoapp = App.get_running_app()Code: Select all
def start_web(appdir, webport, apiport, debug=False):
"""Starts the webserver on "webport"."""
infoapp = None
while infoapp is None:
infoapp = App.get_running_app()
if infoapp and infoapp.base is None:
infoapp = None
sleep(1)
ws = InfoScreenWebServer(infoapp, appdir, apiport)
ws.run(host="0.0.0.0", port=webport, debug=debug)