GithubHelp home page GithubHelp logo

fiskeben / bmp085 Goto Github PK

View Code? Open in Web Editor NEW
10.0 1.0 10.0 20 KB

A node.js module for reading a BMP085 barometer sensor.

JavaScript 100.00%
sensor i2c javascript pressure bmp085 bosch npm-package

bmp085's Introduction

Welcome to my home page!

Under construction

Go enthusiast and Kubernetes helmsman working at @apparatno.

๐Ÿ—„๏ธ My repositories are mostly old rubbish but there are also some interesting IoT stuff and Go libraries.

โœ‹ If you need any help with Go development, please reach out. You can reach me via:

bmp085's People

Contributors

fiskeben avatar jheising avatar rzr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

bmp085's Issues

Failed to set address

using this code as test.js:


var BMP085 = require('bmp085'),
barometer = new BMP085({
'mode': 1,
'address': 0x77,
'device': '/dev/i2c-1'
});

barometer.read(function (data) {
console.log("Temperature:", data.temperature);
console.log("Pressure:", data.pressure);
});


results in this:

/home/pi/node_modules/bmp085/node_modules/i2c/lib/i2c.coffee:57
wire.setAddress(address);
^
TypeError: Failed to set address
at i2c.setAddress (/home/pi/node_modules/bmp085/node_modules/i2c/lib/i2c.coffee:57:12)
at i2c.readBytes (/home/pi/node_modules/bmp085/node_modules/i2c/lib/i2c.coffee:88:12)
at BMP085.readWord (/home/pi/node_modules/bmp085/bmp085.js:108:15)
at /home/pi/node_modules/bmp085/bmp085.js:133:14
at Array.forEach (native)
at BMP085.calibrate (/home/pi/node_modules/bmp085/bmp085.js:132:31)
at BMP085.read (/home/pi/node_modules/bmp085/bmp085.js:256:10)
at Object. (/home/pi/test.js:8:11)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)


The sensor is correctly recognized as it can be seen in:

pi@raspi1 ~ $ sudo i2cdetect -y 1

 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- 77
pi@raspi1 ~ $

Build error due to old I2C dependency

Build error due to old I2C dependency.

On Raspberry Pi Jessie Lite using node v0.12.6 with npm 2.11.2 received build error below.

gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 4.1.13+
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/adafruit-io-basics/raspberry_pi/node_modules/bmp085/node_modules/i2c
gyp ERR! node -v v0.12.6
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok 
npm ERR! Linux 4.1.13+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.6
npm ERR! npm  v2.11.2
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
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! Please include the following file with any support request:
npm ERR!     /home/pi/adafruit-io-basics/raspberry_pi/node_modules/bmp085/npm-debug.log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.