Pressure Readings with BME280

64 views
Skip to first unread message

wxwatching

unread,
Sep 29, 2020, 11:03:31 PM9/29/20
to weewx-user
I followed the installation guide here:



I ran a test script like this:

import Adafruit_BME280

sensor = Adafruit_BME280.BME280(t_mode=Adafruit_BME280.BME280_OSAMPLE_8, p_mode=Adafruit_BME280.BME280_OSAMPLE_8, h_mode=Adafruit_BME280.BME280_OSAMPLE_8)
degrees = sensor.read_temperature()
pascals = sensor.read_pressure()

print (degrees)
print (pascals)

The output of that is:

25.034087635501418

However, when I try to get Weewx to read the data from the BME280, the output of the syslog on a restart never gets past these lines:

Sep 29 22:55:45 raspberrypi systemd[1]: Starting LSB: weewx weather system...
Sep 29 22:55:45 raspberrypi weewx[9610] INFO __main__: Initializing weewx version 4.1.1
Sep 29 22:55:45 raspberrypi weewx[9610] INFO __main__: Using Python 3.7.3 (default, Jul 25 2020, 13:03:44) #012[GCC 8.3.0]
Sep 29 22:55:45 raspberrypi weewx[9610] INFO __main__: Platform Linux-5.4.51-v7+-armv7l-with-debian-10.4
Sep 29 22:55:45 raspberrypi weewx[9610] INFO __main__: Locale is 'en_US.UTF-8'
Sep 29 22:55:45 raspberrypi weewx[9610] INFO __main__: PID file is /var/run/weewx.pid
Sep 29 22:55:45 raspberrypi weewx[9598]: Starting weewx weather system: weewx.
Sep 29 22:55:45 raspberrypi systemd[1]: Started LSB: weewx weather system.

In my weewx.conf, these added lines do not seem to work.

[BME280]
    col_pres = pressure
    col_temp = ''
    sl_denominator = 0.99715048109  # https://www.raspberrypi.org/forums/viewtopic.php?t=154262
    BME280_lib_location = '/home/pi/Adafruit_Python_BME280'


[Engine]

    [[Services]]
        # This section specifies the services that should be run. They are
        # grouped by type, and the order of services within each group
        # determines the order in which the services will be run.
        prep_services = weewx.engine.StdTimeSynch
        data_services = ,
        process_services = weewx.engine.StdConvert, weewx.engine.StdCalibrate, weewx.engine.StdQC, weewx.wxservices.StdWXCalculate, user.weather34.Weather34RealTime
        archive_services = weewx.engine.StdArchive
        restful_services = weewx.restx.StdStationRegistry, weewx.restx.StdWunderground, weewx.restx.StdPWSweather, weewx.restx.StdCWOP, weewx.restx.StdWOW, weewx.restx.StdAWEKAS
        report_services = weewx.engine.StdPrint, weewx.engine.StdReport
        # following line is the BME280 pressure sensor
        data_services = user.bme280.bme


 I have to comment out  the BME section and the data_services line in the Engine section in order to get Weewx to work properly again.

Any ideas on my problem?

wxwatching

unread,
Sep 29, 2020, 11:04:10 PM9/29/20
to weewx-user

rich T

unread,
Sep 29, 2020, 11:15:34 PM9/29/20
to weewx-user
I don't have any issues when using this driver for my BME280 sensor. 

https://gitlab.com/wjcarpenter/bme280wx

Glenn McKechnie

unread,
Sep 30, 2020, 12:26:51 AM9/30/20
to weewx...@googlegroups.com
Have you got debug turned on in weewx.conf (debug = 1)? Probably
should be for this.

In bme280.py it has the following...
[...]
# Inherit from the base class StdService:
class bmp(StdService):
[...]

You are calling...
user.bme280.bme

I believe that should be ...
user.bme280.bmp

also , I don't think you can have 2 entries for data_services . In
this case comment out the original one.
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to weewx-user+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/570ec2fd-facd-4761-bb75-08fee58f2b84o%40googlegroups.com.
>


--


Cheers
Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie
Reply all
Reply to author
Forward
0 new messages