pimatic / pimatic-homeduino

Pimatic plugin for using 433mhz devices and sensors with a connected Arduino with homeduino sketch
https://pimatic.org/
GNU General Public License v2.0
37 stars 29 forks source link

Cannot read property 'length' of undefined - using HomeduinoRFShutter - class,Shutter 4 protocol #53

Closed mwittig closed 8 years ago

mwittig commented 8 years ago

This has originally been reported as https://github.com/pimatic/pimatic/issues/782 by @TRIROG and on forum - http://forum.pimatic.org/topic/969/homeduinorfshutter-shutter3-how

It can be reproduced as described in https://github.com/pimatic/pimatic/issues/782 Stacktrace:

14:00:23.516 [pimatic] error: Cannot read property 'length' of undefined
14:00:23.537 [pimatic] debug: TypeError: Cannot read property 'length' of undefined
14:00:23.537 [pimatic] debug:>    at Object.module.exports.map (/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/rfcontroljs/lib/helper.js:24:20)
14:00:23.537 [pimatic] debug:>    at Object.protocolInfo.encodeMessage (/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/rfcontroljs/lib/protocols/shutter4.js:92:24)
14:00:23.537 [pimatic] debug:>    at Object.module.exports.encodeMessage (/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/rfcontroljs/lib/controller.js:199:24)
14:00:23.537 [pimatic] debug:>    at Board.rfControlSendMessage (/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/lib/board.js:255:24)
14:00:23.537 [pimatic] debug:>    at /home/pi/pimatic-app/node_modules/pimatic-homeduino/homeduino.coffee:335:27
14:00:23.537 [pimatic] debug:>    at tryCatcher (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/util.js:26:23)
14:00:23.537 [pimatic] debug:>    at Promise._settlePromiseFromHandler (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/promise.js:507:31)
14:00:23.537 [pimatic] debug:>    at Promise._settlePromiseAt (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/promise.js:581:18)
14:00:23.537 [pimatic] debug:>    at Promise._settlePromiseAtPostResolution (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/promise.js:245:10)
14:00:23.537 [pimatic] debug:>    at Async._drainQueue (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/async.js:128:12)
14:00:23.537 [pimatic] debug:>    at Async._drainQueues (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/async.js:133:10)
14:00:23.537 [pimatic] debug:>    at Async.drainQueues (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/async.js:15:14)
14:00:23.537 [pimatic] debug:>    at process._tickDomainCallback (node.js:459:13)
Icesory commented 8 years ago

all shutter protocols are implemented as command protocols and the HomdeuinoRFShutter device cant handle such a protocol at the moment. I will look what it needs to fix this.

mwittig commented 8 years ago

@Icesory Sorry, I did not recognize you have fixed this already. So forget about my commit (which is on my fork anyway).

Icesory commented 8 years ago

Your solution looks great too, but it lacks now the support of switch protocols.

And i have seen, i have forgot some assertion checks for right command strings.