【发布时间】:2019-07-24 14:20:55
【问题描述】:
我正在尝试在 Pepper 上加载一个网站,例如“www.google.com”
我确定我们连接在同一个网络上。我也试过在 ShowApp Dialog 上做“http://www.google.com”。
我看过这个指南:http://kokorobot.com/2016/08/08/how-to-use-pepper-tablet
class MyClass(GeneratedClass):
def __init__(self):
GeneratedClass.__init__(self)
def onLoad(self):
self.isRunning = False
def onUnload(self):
self.isRunning = False
def _getTabletService(self):
tabletService = None
try:
tabletService = self.session().service("ALTabletService")
except Exception as e:
self.logger.error(e)
return tabletService
def onInput_onStart(self):
if self.isRunning:
return # already running, nothing to do
self.isRunning = True
# We create TabletService here in order to avoid
# problems with connections and disconnections of the tablet during the life of the application
tabletService = self._getTabletService()
appName = self.packageUid()
state = False
if appName:
if tabletService:
if tabletService.loadApplication(appName):
tabletService.loadUrl("www.google.com") self.logger.info("Successfully set application: %s" % appName)
tabletService.showWebview()
state = True
else:
self.logger.warning("Got tablet service, but failed to set application: %s" % appName)
else:
self.logger.warning("Couldn't find tablet service, so can't set application: %s" % appName)
if state:
self.onSuccess()
else:
self.onFailure()
【问题讨论】:
-
您遇到了什么问题?平板电脑是否出现错误、显示白屏或黑屏?你的控制台输出是什么?
-
白屏,404错误未找到nginx
标签: pepper