如何在Ubuntu 15.04上运行johnny-five?

时间:2015-07-14 17:31:16

标签: javascript node.js ubuntu-15.04 johnny-five

$ node hello.js 
1436894483255 Device(s) /dev/ttyUSB0  
1436894483279 Connected /dev/ttyUSB0  
1436894493287 Device or Firmware Error A timeout occurred while connecting to the Board. 

Please check that you've properly flashed the board with the correct firmware. 

See: https://github.com/rwaldron/johnny-five/wiki/Getting-Started#trouble-shooting 
events.js:87
      throw Error('Uncaught, unspecified "error" event.');
            ^
Error: Uncaught, unspecified "error" event.
    at Error (native)
    at Board.emit (events.js:87:13)
    at Board.log (/usr/lib/node_modules/johnny-five/lib/board.js:623:8)
    at Board.(anonymous function) [as error] (/usr/lib/node_modules/johnny-five/lib/board.js:634:14)
    at Board.<anonymous> (/usr/lib/node_modules/johnny-five/lib/board.js:407:12)
    at Timer.listOnTimeout (timers.js:119:15)

我在Ubuntu上安装了node和johnny-five并连接了Arduino Nano。但它引发了上述错误。

2 个答案:

答案 0 :(得分:1)

在运行节点应用之前,尝试打开arduino:

$ arduino

转到文件&gt;例子&gt; Firmata,然后选择 StandardFirmata

一旦打开将其上传到您的arduino。

完成后,您应该能够毫无问题地运行您的节点应用程序

答案 1 :(得分:0)

arduino IDE可能正在保持与主板的连接。试着关闭它。