adafruit / adafruit_python_bmp Goto Github PK
View Code? Open in Web Editor NEWPython library for accessing the BMP series pressure and temperature sensors like the BMP085/BMP180 on a Raspberry Pi or Beaglebone Black.
License: MIT License
Python library for accessing the BMP series pressure and temperature sensors like the BMP085/BMP180 on a Raspberry Pi or Beaglebone Black.
License: MIT License
@tdicola Do you know of any plans to add support for Adafruit BMP280 Barometric Pressure + Temperature Sensor Breakout?
This user is looking to use the BMP280 with the Raspberry Pi:
BMP280 SPI CONNECTIONS RASPBERRY
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.
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.
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.
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:
Please note that the sensor seems to be recognized, as shows the following screenshot:
I'm working with a Raspberry Pi model B if that helps.
please someone delete this issue. sorry.
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.
Could you kindly release this library to PyPI so users can easily install it via pip install
command?
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.
Hello,
using a Banana PI with Debian 8.6.
git clone https://github.com/adafruit/Adafruit_Python_BMP
cd Adafruit_Python_BMP
sudo python3 setup.py install
compilation terminated.
error: Setup script exited with error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
arm-linux-gnueabihf-gcc (Debian 4.9.2-10) 4.9.2
How to fix this ?
Hey,
i got a problem while using this library.
I receive pressure values which are way too low...I mean I expect round about 1013 hPa, and I get 96466 Pa, which is equal to 964 hPa, so where are the missing 50 hPa?
Do I have to adjust the sensor?
I am using this one: http://www.amazon.de/Adafruit-Luftdruck--Temperatur--H%C3%B6hensensor-BMP180/dp/B00KLBTR4I/ref=sr_1_1?ie=UTF8&qid=1433182269&sr=8-1&keywords=adafruit+bmp
Thanks.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.