Hi,
here is something wrong, my lcd runs on i2c-1 address 20
/usr/local/pimatic-app# i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
I can display whatever i want with some python scripts,
This dont work for me
{
"plugin": "lcd",
"bus": "/dev/i2c-1",
"rows": 2,
"cols": 16
},
This also dont work:
{
"plugin": "lcd",
"bus": "/dev/i2c-1",
"address": 20,
"rows": 2,
"cols": 16
},
19:40:19.375 [pimatic-homeduino] info: Connected to homeduino device.
Possibly unhandled Error: Cannot write to device
at i2c.writeByte (/usr/local/pimatic-app/i2c.coffee:51:10)
at i2c.writeByteAsync (eval at makeNodePromisifiedEval (/usr/local/pimatic-app/node_modules/pimatic-lcd/node_modules/i2c-lcd/node_modules/bluebird/js/main/promisify.js:201:12), :12:22)
at /usr/local/pimatic-app/node_modules/pimatic-lcd/node_modules/i2c-lcd/lib/lcd.js:68:26
at tryCatch1 (/usr/local/pimatic-app/node_modules/pimatic-lcd/node_modules/i2c-lcd/node_modules/bluebird/js/main/util.js:45:21)
at Promise$_callHandler as _callHandler
at Promise$_settlePromiseFromHandler as _settlePromiseFromHandler
at Promise$_settlePromiseAt as _settlePromiseAt
at Async$_consumeFunctionBuffer as _consumeFunctionBuffer
at Async$consumeFunctionBuffer (/usr/local/pimatic-app/node_modules/pimatic-lcd/node_modules/i2c-lcd/node_modules/bluebird/js/main/async.js:40:14)
at process._tickCallback (node.js:415:13)
19:40:22.105 [pimatic] info: new device "EasyBox"...
But if i change the lcd-config-schema.coffee default and remove "address" from config.json pimatic startup without errors:
module.exports = {
title: "lcd plugin config options"
type: "object"
properties:
bus:
description: "i2c bus device"
type: "string"
default: "/dev/i2c-1"
address:
description: "address of the device"
type: "number"
default: 0x20
rows:
description: "number of rows (lines) of the LCD"
type: "number"
default: 2
cols:
description: "number of cols (characters in a line) of the LCD"
type: "number"
default: 16
but if i set a rule like this it will run and say "displaying xx on line 1" but nothing happend on line 1
"rules": [
{
"id": "aa",
"name": "aa",
"rule": "if $syssensor1.cpu changes then display "CPU: {$syssensor1.cpu}%" on lcd line 1",
"active": true,
"logging": true
}
i also see in my logs a error in the first install of pimatic-lcd:
19:17:29.044 [pimatic] info: loading plugin: "pimatic-sunrise" (0.8.0)
19:17:29.209 [pimatic-cron] info: the time is: Sat Jan 03 2015 19:17:29 GMT+0100 (CET)
19:17:29.534 [pimatic-sunrise] info: Your location is set to lat: 53.682185431, long: 9.749752655
Possibly unhandled TypeError: Failed to set address
at i2c.setAddress (/usr/local/pimatic-app/node_modules/pimatic-lcd/node_modules/i2c-lcd/node_modules/i2c/lib/i2c.coffe
e:64:10)
at i2c.writeByte (/usr/local/pimatic-app/node_modules/pimatic-lcd/node_modules/i2c-lcd/node_modules/i2c/lib/i2c.coffee
:81:10)
at i2c.writeByteAsync (eval at makeNodePromisifiedEval (/usr/local/pimatic-app/node_modules/pimatic-lcd/node_modules/i
2c-lcd/node_modules/bluebird/js/main/promisify.js:201:12), :12:22)
at /usr/local/pimatic-app/node_modules/pimatic-lcd/node_modules/i2c-lcd/lib/lcd.js:68:26
at tryCatch1 (/usr/local/pimatic-app/node_modules/pimatic-lcd/node_modules/i2c-lcd/node_modules/bluebird/js/main/util.
js:45:21)
at Promise$_callHandler [as _callHandler](/usr/local/pimatic-app/node_modules/pimatic-lcd/node_modules/i2c-lcd/node_m
odules/bluebird/js/main/promise.js:660:13)
at Promise$_settlePromiseFromHandler [as _settlePromiseFromHandler](/usr/local/pimatic-app/node_modules/pimatic-lcd/n
ode_modules/i2c-lcd/node_modules/bluebird/js/main/promise.js:675:18)
at Promise$_settlePromiseAt [as _settlePromiseAt](/usr/local/pimatic-app/node_modules/pimatic-lcd/node_modules/i2c-lc
d/node_modules/bluebird/js/main/promise.js:845:14)
at Async$_consumeFunctionBuffer as _consumeFunctionBuffer
at Async$consumeFunctionBuffer (/usr/local/pimatic-app/node_modules/pimatic-lcd/node_modules/i2c-lcd/node_modules/bluebird/js/main/async.js:40:14)
at process._tickCallback (node.js:415:13)
19:17:29.811 [pimatic-homeduino] info: Connected to homeduino device.
19:17:38.676 [pimatic] info: new device "EasyBox"...
It looks like something (address) is hardcode or the installation was wrong...