我运行corlorme的工程报错


(mefwei) #1

我直接采用的ro run app.js
出现了如下问题:
➜ colorme-nodejs git:(master) ✗ ro run app.js
use adb: /usr/local/lib/node_modules/rokidos-cli/tools/adb
app.js: 1 file pushed. 0.7 MB/s (1871 bytes in 0.003s)
LumenLight ctor

initialize

LumenClient ctor client

still not bind to serv of proxy is nil, try to bind to LUMEN service …

lumen serv proxy is nil …
now fetch proxy …

get shared buffer with totally size: 68 data buf size: 36

=== led light info ===
platform: 3
f size: 36
led count: 12
fps: 30
pxl format: 3

LumenLight ctor

initialize

LumenClient ctor client

still not bind to serv of proxy is nil, try to bind to LUMEN service …

lumen serv proxy is nil …
now fetch proxy …

get shared buffer with totally size: 68 data buf size: 36

=== led light info ===
platform: 3
f size: 36
led count: 12
fps: 30
pxl format: 3

/usr/lib/node_modules/@rokid/vui/lib/client/index.js:206
throw new Error(${appid} is invalid);
^

Error: is invalid
at Immediate.setImmediate (/usr/lib/node_modules/@rokid/vui/lib/client/index.js:206:13)
at runCallback (timers.js:649:20)
at tryOnImmediate (timers.js:622:5)
at processImmediate [as _immediateCallback] (timers.js:594:5)


【Q&A】答疑时间到,每周开发者问题及解答在此
(yorkiefixer) #2

hi 能提供下你的 app.js 吗?还有你详细的运行步骤


(mefwei) #3

我的详细执行步骤就是从github上下载colorme-nodejs这个工程,
然后cd到这个目录下面, npm install -g安装nodejs依赖包
连接好开发板
然后执行ro run app.js,
出错信息在正文里

app.js文件是这个文件,github上有URL:https://github.com/RokidSkills/colorme-nodejs

‘use strict’;

const light = require(’@rokid/lumen’);
const words = {
red: [
‘红豆生南国,春来发几枝’,
‘落霞与孤鹫齐飞,秋水共长天一色’,
‘友谊是红色的,它代表着热情’,
],
yellow: [
‘千里黄云白日曛,北风吹雁雪纷纷’,
‘黄黄的花瓣是过渡色’,
],
skyblue: [
‘秋天,那永远是蓝湛湛的天空’,
],
green: [
‘两岸青山相对出,孤帆一片日边来’,
‘绿牡丹像翡翠’,
],
black: [
‘黑云翻墨未遮山,白雨跳珠乱入船’,
‘我喜欢的你有颜色’,
‘没有结果的爱情,只要开了花,颜色就是灿烂的’,
],
};

function fill(color) {
light.removeAllLayers();
const layer = light.createLayer(’*’, { speed: 0.7 });
layer.fade(‘black’, color).then(() => {
return layer.fade(color, ‘black’);
});
}

module.exports = require(’@rokid/vui’)({
onrequest(data, action) {
let tts;
if (data.intent === ‘change_color’) {
const color = data.slots.colortype.value;
if (color === ‘红色’) {
fill(‘red’);
tts = words.red[Math.floor(Math.random() * words.red.length)];
} else if (color === ‘黄色’) {
fill(‘yellow’);
tts = words.yellow[Math.floor(Math.random() * words.yellow.length)];
} else if (color === ‘蓝色’) {
fill(‘skyblue’);
tts = words.skyblue[Math.floor(Math.random() * words.skyblue.length)];
} else if (color === ‘绿色’) {
fill(‘green’);
tts = words.green[Math.floor(Math.random() * words.green.length)];
} else {
tts = ‘要让我变色吗?’;
}
} else if (data.intent === ‘color_min’) {
fill(‘black’);
tts = words.black[Math.floor(Math.random() * words.black.length)];
} else {
tts = ‘要让我变色吗?’;
}
this.say(tts, () => this.exit());
}
});%


(yorkiefixer) #4

Hi 我们的开发板中应该自带这个应用了,在 /opt/apps/colorme 目录下,rokidos-cli 工具的 install 命令暂时不可用,需要手动按照 https://github.com/Rokid/rokidos-linux-docs/blob/master/development/overview.md 中的应用目录结构手动推送到 /data/apps 目录下。