ev3dev / ev3dev-lang

(deprecated) language bindings for ev3dev sensors, motors, LEDs, etc.
GNU General Public License v2.0
56 stars 39 forks source link

stop lcd going back to menu #175

Closed absentdream closed 7 years ago

absentdream commented 7 years ago

hi i am using bottle (web server) to remote control ev3 but when i update the screen image it reverts back to menu after 1 sec (ish)...

`from bottle import route, request, run, template import requests import time import ev3dev.ev3 as ev3 from PIL import Image, ImageDraw, ImageFont, ImageOps

@route('/motor//timed//') def index(name,time_sp,speed_sp): m = ev3.LargeMotor(name) m.run_timed(time_sp=time_sp, speed_sp=speed_sp) while 'running' in m.state: time.sleep(0.01) return template('motor name: {{name}} timed', name=name)

@route('/eyes/') def index(name): logo = Image.open('data/images/' + name + '.bmp') lcd = ev3.Screen() lcd.draw.bitmap((0, 0), ImageOps.invert(logo.convert("L"))) lcd.update() return template('eyes name: {{name}}', name=name)

run(host='192.168.0.33', port=8080)`

any ideas how to stop it reverting to menu..

WasabiFan commented 7 years ago

The problem is that Brickman (the program that displays the menu) still thinks it has control of the display. If you use the on-screen menu to run your script, that should solve the problem, because that means that Brickman knows that another program is using the display. Otherwise, see the bottom of the page here: https://sites.google.com/site/ev3python/learn_ev3_python/screen

absentdream commented 7 years ago

spot on thanks.. using "sudo chvt 6" to switch screen ...