gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 03:36:35 24 4
gpt4 key购买 nike

尝试将 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com