I have the BMP085 working fine on one Raspberry Pi. I have just bought a couple of your BME280 modules and would like to use one on another Raspberry Pi, but of course your BMP085 code doesn't quite work (I expected this). It gives the wrong readings. Could you please advise what and how to update in that code for the BME280?
https://learn.adafruit.com/adafruit-bme ... t/overview
Thanks,
David
BME280 on the Raspberry Pi
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: BME280 on the Raspberry Pi
We don't have a library or tutorial for that yet. You can refer to the Arduino library for details of how to talk to the sensor.
- gm8arv
- Posts: 15
- Joined: Wed Mar 04, 2015 3:19 am
Re: BME280 on the Raspberry Pi
Thanks, Rick. I can certainly see some of the functions required and register definitions in the Arduino library, but transferring that into the Raspberry Pi Python environment is rather beyond me at the moment. I hope someone can make that transfer.
David
David
- gm8arv
- Posts: 15
- Joined: Wed Mar 04, 2015 3:19 am
Re: BME280 on the Raspberry Pi
Thanks, Rick. I've been able to get some numbers of out the device, but I' sure they aren't correct:adafruit_support_rick wrote:We don't have a library or tutorial for that yet. You can refer to the Arduino library for details of how to talk to the sensor.
raw = 532888
T1 = 27503
T2 = -1177
T3 = 12800
Making the temp = -0.048 deg C, I think. Do the above numbers look anything like what is seen with the Arduino? Can anyone compare results? There seems to be a difference in the code between Arduino and Raspberry PI in that one uses routines looking like little-endian and the other like big-endian, at least according to the function names!
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: BME280 on the Raspberry Pi
I really don't know. I'll see if anybody else has some ideas
- gm8arv
- Posts: 15
- Joined: Wed Mar 04, 2015 3:19 am
Re: BME280 on the Raspberry Pi
Probably resolved. The older chip has MSB first in the calibration registers, the newer has LSB first. I failed to spot that at first glance. No wonder the numbers were wrong. I now have correct values for temperature and pressure, this afternoon's task is to program humidity, where the calibration values are somewhat messily stored.
I also discovered when making a test program for the maths that Delphi's shift right is a logical shift, and not an arithmetic shift, thus failing to propagate the sign bit on negative integers. It's easy enough to make a SAR function, though.
Thanks for the help and encouragement, and for providing this new product.
I also discovered when making a test program for the maths that Delphi's shift right is a logical shift, and not an arithmetic shift, thus failing to propagate the sign bit on negative integers. It's easy enough to make a SAR function, though.
Thanks for the help and encouragement, and for providing this new product.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: BME280 on the Raspberry Pi
Please share your library when you get it going!
- gm8arv
- Posts: 15
- Joined: Wed Mar 04, 2015 3:19 am
Re: BME280 on the Raspberry Pi
Here's what I have so far. It needs some work to turn it into a library, but it serves my purpose. I've used floating point arithmetic rather than integers and shifts as I expect there's little time difference on the Raspberry Pi I'm using. As the temperature is used in both the pressure and humidity calculations, I have coded so that all three are calculated together, and then (for my purposes) saved as text files where they can be read as desired by an SNMP add-on.
If published, I would appreciate a reference: David J Taylor, Edinburgh. www.satsignal.eu
The code is, of course, based on Adafruit's BMP085.py, although all the copyright wasn't grabbed by the "Copy all to clipboard" I used in PuTTY to get the text from the Raspberry Pi to the Windows PC. Limited number of lines. I hope that hasn't clobbered the format too much!
If published, I would appreciate a reference: David J Taylor, Edinburgh. www.satsignal.eu
The code is, of course, based on Adafruit's BMP085.py, although all the copyright wasn't grabbed by the "Copy all to clipboard" I used in PuTTY to get the text from the Raspberry Pi to the Windows PC. Limited number of lines. I hope that hasn't clobbered the format too much!
- gm8arv
- Posts: 15
- Joined: Wed Mar 04, 2015 3:19 am
Re: BME280 on the Raspberry Pi
I sent an attachment - I hope it came through but I don't see where to find it.....
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: BME280 on the Raspberry Pi
To attach a zip file, use the 'Choose File' button, select the file on your computer, and then click the 'Add The File' button
- gm8arv
- Posts: 15
- Joined: Wed Mar 04, 2015 3:19 am
Re: BME280 on the Raspberry Pi
Well, Rick, that's just what I did, albeit source file rather than zipped. I'm having another go with a Zip file of the current variant now.
Could it be that if I get asked for the resistor value any attachment gets dropped and needs to be re-attached? That's the only thing I can think of.... Ah, perhaps I selected the file, but did not "ADD THE FILE".
David
Could it be that if I get asked for the resistor value any attachment gets dropped and needs to be re-attached? That's the only thing I can think of.... Ah, perhaps I selected the file, but did not "ADD THE FILE".
David
- Attachments
-
- BME280.zip
- (2.74 KiB) Downloaded 156 times
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: BME280 on the Raspberry Pi
Got it! Thanks
- ktownsend
- Posts: 1447
- Joined: Thu Nov 05, 2009 2:18 am
Re: BME280 on the Raspberry Pi
Hi David! Thanks for poking at this for the BME280. I've published some BME280 files on github here, adding you to the credits in the readme and in the main class: https://github.com/adafruit/Adafruit_Python_BME280 ... hopefully it will be useful to other customers that way, and they're more likely to stumble across it.
- gm8arv
- Posts: 15
- Joined: Wed Mar 04, 2015 3:19 am
Re: BME280 on the Raspberry Pi
Thanks for that!
I've provided a write-up of plotting the data remotely with SNMP and MRTG here:
http://www.satsignal.eu/raspberry-pi/mo ... tml#BME280
so I hope that will also be useful.
I've provided a write-up of plotting the data remotely with SNMP and MRTG here:
http://www.satsignal.eu/raspberry-pi/mo ... tml#BME280
so I hope that will also be useful.
- rexmarinus
- Posts: 6
- Joined: Mon Oct 05, 2015 1:47 pm
Re: BME280 on the Raspberry Pi
Hello
I have 2-3 extra rasberry pis and recently aquired an adafruit BME280 sensor.
Are there any instructions to follow in order to make them work together?
I am not a linux guy and completely newbie.
I just want to make a weather station myself.
I have no idea how to wire the sensor to the raspberry pi. (Which pins I have to connect to each other)
I have no idea which OS i have to install to the rpi
and I have no idea how to install whatever is needed to make the rpi read and display the sensors readings.
Any help would greatly appreciated.
Thanks!
I have 2-3 extra rasberry pis and recently aquired an adafruit BME280 sensor.
Are there any instructions to follow in order to make them work together?
I am not a linux guy and completely newbie.
I just want to make a weather station myself.
I have no idea how to wire the sensor to the raspberry pi. (Which pins I have to connect to each other)
I have no idea which OS i have to install to the rpi
and I have no idea how to install whatever is needed to make the rpi read and display the sensors readings.
Any help would greatly appreciated.
Thanks!
Please be positive and constructive with your questions and comments.