Code Monkey home page Code Monkey logo

adafruit_python_bmp's Introduction

DEPRECATED LIBRARY Adafruit Python BMP

This library has been deprecated!

the bmp085 and bmp180 are no longer made, and are replaced by the bmp280 + friends

we are now only using our circuitpython sensor libraries in python

we are leaving the code up for historical/research purposes but archiving the repository.

check out this guide for using the bmp280 with python! https://learn.adafruit.com/adafruit-bmp280-barometric-pressure-plus-temperature-sensor-breakout

Adafruit Python BMP

Python library for accessing the BMP series pressure and temperature sensors like the BMP085/BMP180 on a Raspberry Pi or Beaglebone Black.

Designed specifically to work with the Adafruit BMP085/BMP180 pressure sensors ----> https://www.adafruit.com/products/1603

To install, download the library by clicking the download zip link to the right and unzip the archive somewhere on your Raspberry Pi or Beaglebone Black. Then execute the following command in the directory of the library:~~

sudo python setup.py install

Make sure you have internet access on the device so it can download the required dependencies.

See examples of usage in the examples folder.

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

Written by Tony DiCola for Adafruit Industries. MIT license, all text above must be included in any redistribution

adafruit_python_bmp's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adafruit_python_bmp's Issues

Self Calibration p8 value

works on my piA+ but pressure values are a bit off. Checked the self.cal_p8 value in the datasheet which shows -14600 rather than the -14500 value in the code.

BMP085 ERROR AFTER UPDATING RASPBIAN AND KERNEL

  • Raspberry Pi with Raspbian operating system, updated today (apt-get update, apt-get dIst-upgrade) with latest kernel (sudo rpi-update).

  • Python version 2.7.

  • Error message you are receiving:
    Traceback (most recent call last):
    File "simpletest.py", line 37, in
    sensor = BMP085.BMP085()
    File "build/bdist.linux-armv6l/egg/Adafruit_BMP/BMP085.py", line 67, in init
    File "build/bdist.linux-armv6l/egg/Adafruit_GPIO/I2C.py", line 63, in get_i2c_device
    File "build/bdist.linux-armv6l/egg/Adafruit_GPIO/I2C.py", line 55, in get_default_bus
    RuntimeError: Could not determine default I2C bus for platform.

  • My python program was working prior to updating my Raspberry Pi B. After updating received the above error. The above error was received using the simpletest.py example. Also received with my python script. i2cdetect displays the address of the BMP085.

pi@raspberrypiLights:~/Adafruit_Python_BMP/examples $ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- 3c -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- 77

Fixed myself. Installed Adafruit Python GPIO Library.

Raspbian install error and related issues

Hi: I got this to work once, but now fails weirdly due to the setup.py file and the non-standard (and somewhat hacky) Raspbian python environment. I'm still trying to replicate the "working" part using your sensor module, and the reason I had to install it again is because the other Python sensor code (which also worked fine) stopped working after I installed your Python modules for the BMP sensor. The sensor board I'm working with has three sensors integrated (SHT10, BMP085, and MPU6050) but the required Python modules break each other when the upstream "install" is run. Proper packaging as *.debs would avoid all of this pip/easy_install nonsense, which turns out to be anything but easy. I'm through debugging this stuff for now and I will make some proper git/versioned ebuilds for what I need (conference deadlines are approaching fast) and put them in our arm testing overlay (I do Gentoo and Yocto, which is plenty enough already). Please consider packaging an actual release of your modules and either package the dependencies or push it up to Raspbian and get them to do it. It's currently not possible for an OS/distribution developer to install multiple sensor modules in the latest 09-09 Raspbian using the available tools/docs (such as they are) so I really don't see how a "normal" user could do it.

Munin plugins not working

When testing the munin plugin:
python munin/i2c_pressure

I get the error:

File "munin/i2c_pressure", line 4, in
from Adafruit_BMP085 import BMP085
ImportError: No module named Adafruit_BMP085

Is there a quick fix for this? I would really like to intergrate this to munin.

Release to PyPI

Could you kindly release this library to PyPI so users can easily install it via pip install command?

Update examples/google_spreadsheet.py to use oAuth2

Error received while running examples/google_spreadsheet.py:

Logging sensor measurements to temp_log every 30 seconds.
Press Ctrl-C to quit.
/usr/local/lib/python2.7/dist-packages/gspread/client.py:73: Warning:
            ClientLogin is deprecated:
            https://developers.google.com/identity/protocols/AuthForInstalledApps?csw=1

            Authorization with email and password will stop working on April 20, 2015.

            Please use oAuth2 authorization instead:
            http://gspread.readthedocs.org/en/latest/oauth2.html


  """, Warning)
Unable to login and get spreadsheet.  Check email, password, spreadsheet name.

IOError: [Errno 110] Connection timed out

Using the simpletest.py I get constant errors

python simpletest.py 
Traceback (most recent call last):
  File "simpletest.py", line 37, in <module>
    sensor = BMP085.BMP085()
  File "/usr/lib/python2.7/site-packages/Adafruit_BMP/BMP085.py", line 68, in __init__
    self._load_calibration()
  File "/usr/lib/python2.7/site-packages/Adafruit_BMP/BMP085.py", line 72, in _load_calibration
    self.cal_AC2 = self._device.readS16BE(BMP085_CAL_AC2)   # INT16
  File "/usr/lib/python2.7/site-packages/Adafruit_GPIO/I2C.py", line 195, in readS16BE
    return self.readS16(register, little_endian=False)
  File "/usr/lib/python2.7/site-packages/Adafruit_GPIO/I2C.py", line 172, in readS16
    result = self.readU16(register, little_endian)
  File "/usr/lib/python2.7/site-packages/Adafruit_GPIO/I2C.py", line 159, in readU16
    result = self._bus.read_word_data(self._address,register) & 0xFFFF
IOError: [Errno 110] Connection timed out

I'm not sure what is causing this. I have one other sensor on the i2c bus.

i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- 77  

The only way I can get it to show me anything is if I do something like

value = None
while value is None:
  try:
    value = BMP085.BMP085().read_pressure()
    print 'Pressure = {0:0.2f} Pa'.format(value)
  except:
    pass

Even then I seem to get wild values

Pressure = 1092309.00 Pa

So I'm not sure if my sensor is buggered, or if the voltage is dropping too much on the 3.3v line to run both sensors (the other sensor is an si1145). The si1145 seems to have the same error and needs a similar solution when I use it.

So it's either the voltage, or something related to daisy chaining the two sensors on the same i2c bus

EDIT:
Just did some more testing, ran the simpletest.py in a loop and monitored the voltage, it was a constant 3.34v, so that's fine.
I also tried each sensor on it's own, and it still had the timeout issue. So now I think it must be related to my RPi or my kernel config.

\

Thank you for opening an issue on an Adafruit Python library repository. To
improve the speed of resolution please review the following guidelines and
common troubleshooting steps below before creating the issue:

  • Do not use GitHub issues for troubleshooting projects and issues. Instead use
    the forums at http://forums.adafruit.com to ask questions and troubleshoot why
    something isn't working as expected. In many cases the problem is a common issue
    that you will more quickly receive help from the forum community. GitHub issues
    are meant for known defects in the code. If you don't know if there is a defect
    in the code then start with troubleshooting on the forum first.

  • If following a tutorial or guide be sure you didn't miss a step. Carefully
    check all of the steps and commands to run have been followed. Consult the
    forum if you're unsure or have questions about steps in a guide/tutorial.

  • For Python/Raspberry Pi projects check these very common issues to ensure they don't apply:

    • If you are receiving an ImportError: No module named... error then a
      library the code depends on is not installed. Check the tutorial/guide or
      README to ensure you have installed the necessary libraries. Usually the
      missing library can be installed with the pip tool, but check the tutorial/guide
      for the exact command.

    • Be sure you are supplying adequate power to the board. Check the specs of
      your board and power in an external power supply. In many cases just
      plugging a board into your computer is not enough to power it and other
      peripherals.

    • Double check all soldering joints and connections. Flakey connections
      cause many mysterious problems. See the guide to excellent soldering for examples of good solder joints.

If you're sure this issue is a defect in the code and checked the steps above
please fill in the following fields to provide enough troubleshooting information.
You may delete the guideline and text above to just leave the following details:

  • Platform/operating system (i.e. Raspberry Pi with Raspbian operating system,
    Windows 32-bit, Windows 64-bit, Mac OSX 64-bit, etc.): INSERT PLATFORM/OPERATING
    SYSTEM HERE

  • Python version (run python -version or python3 -version): INSERT PYTHON
    VERSION HERE

  • Error message you are receiving, including any Python exception traces: INSERT
    ERROR MESAGE/EXCEPTION TRACES HERE
    *

  • List the steps to reproduce the problem below (if possible attach code or commands
    to run): LIST REPRO STEPS BELOW

Doesn't work with Python 3.4

I tried using this library in both Python 2 and 3 with a BMP180 sensor from Adafruit. It works great with version 2.7.x, but I'm having 'unsupported operand type(s)' errors when trying to use this library with Python 3.4:

screen shot 2015-06-02 at 15 24 01

Please note that the sensor seems to be recognized, as shows the following screenshot:

screen shot 2015-06-02 at 15 25 08

I'm working with a Raspberry Pi model B if that helps.

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.