[collectd] BMP280 barometric pressure sensor
Phil Endecott
spam_from_collectd at chezphil.org
Fri Sep 14 20:00:16 CEST 2018
Phil Endecott wrote:
> I have acquired a BMP280 barometric pressure sensor. This is a newer
> version of the BMP085 which is supported by collectd's barometer plugin.
> Has anyone investigated this device for collectd support? If not, I
> will see if I can hack the current BMP085 driver to work with it.
I have modified barometer.c from collectd 5.7 to support the BMP280.
Note that this is against version 5.7 because that is what I have from
Debian stable, but I don't believe that porting it forward to newer
collectd would involve more than trivial changes.
The BMP280 is similar in many respects to the BMP085 and much of the
code is copied-and-pasted, but there is an important difference in its
normal mode of operation. The BMP085 takes a reading when it is commanded
to do so, and the driver code includes a wait to allow the reading to
happen before fetching the result. Although the BMP280 could be used
in that way, its recommended mode for most applications is for the
device to take readings autonomously. The driver uses this mode,
currently with a hard-coded interval between readings of 1 second.
This code has had a modest amount of testing and appears to work as
expected; I can't really tell if the numeric code is exactly right as
I don't have anything more accurate to compare the results with.
The source is here: http://chezphil.org/tmp/barometer.c
Regards, Phil.
More information about the collectd
mailing list