linux - 对象 <#BeagleBone> 没有方法 'i2cConfig' 尝试使用 Beaglebone-IO 运行 MPU6050

标签 linux node.js beagleboneblack johnny-five

尝试将 MPU6050 连接到在 Beaglebone-IO 下运行 Debian、Node.js 和 Johnny-Five 的 Beaglebone Black。

使用 Johnny-Five 示例初始化 MPU6050:

var imu = new five.IMU({
  controller: "MPU6050"
});

每次发生错误时:

TypeError: Object #<BeagleBone> has no method 'i2cConfig'
at EventEmitter.Drivers.MPU6050.initialize.value (/root/node_modules/johnny-five/lib/imu.js:42:12)
at Object.Drivers.get (/root/node_modules/johnny-five/lib/imu.js:345:12)
at Accelerometer.Controllers.MPU6050.initialize.value (/root/node_modules/johnny-five/lib/accelerometer.js:65:34)
at new Accelerometer (/root/node_modules/johnny-five/lib/accelerometer.js:319:10)
at IMU.Controllers.MPU6050.initialize.value (/root/node_modules/johnny-five/lib/imu.js:368:31)
at new IMU (/root/node_modules/johnny-five/lib/imu.js:506:10)
at Board.io.on.socket.on.newspeed (/root/rov/server/server.js:56:13)
at Board.emit (events.js:92:17)
at process._tickCallback (node.js:419:13)

我猜这与 i2c 配置有关,因为我无法使用 npm install i2c 安装 i2c,它总是输出:

make: *** [Release/obj.target/i2c/src/i2c.o] Error 1
make: Leaving directory `/root/node_modules/i2c/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/share/node-            gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit     (child_process.js:809:12)
gyp ERR! System Linux 3.8.13-bone70
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /root/node_modules/i2c
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! i2c@0.2.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the i2c@0.2.1 install script.
npm ERR! This is most likely a problem with the i2c package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls i2c
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.8.13-bone70
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "i2c"
npm ERR! cwd /root/rov/server
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /root/rov/server/npm-debug.log
npm ERR! not ok code 0

请帮忙!

最佳答案

看起来 Beaglebone-IO 尚未获得更新的 I2C 支持:https://github.com/julianduque/beaglebone-io/pull/16/files

关于linux - 对象 <#BeagleBone> 没有方法 'i2cConfig' 尝试使用 Beaglebone-IO 运行 MPU6050,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31346274/

相关文章:

linux - df -h 返回 98% full 时如何执行命令

java - 基本 javafx 应用程序中由 NullPointer 引起的 InvocationTargetException

node.js - Knex Js 返回与原始 SQL 不同的输出

node.js - 如何重命名nodejs项目?

networking - Beaglebone black 上的 ping 和 opkg 更新问题

c++ - 来自 Windows 的交叉编译 GNU ARM (BeagleBoneBlack)。 *.elf : "No such file or directory" 上的运行时错误

c++ - 无法用 64 位 g++ 编译 32 位

python - 从多个源 IP 发送流量 Scapy

javascript - Node 脚本永远不会结束

c++ - 共享对象加载 : version Qt_5 not defined in file