In your weewx.conf file, do you have the following?

##############################################################################

# Options for extension 'bme280wx'
[Bme280wx]
    temperature_must_have = ""
    humidityKeys = inHumidity
    pressureKeys = pressure
    pressure_must_have = outTemp
    i2c_port = 1
    humidity_must_have = ""
    i2c_address = 0x77
    usUnits = US
    temperatureKeys = inTemp

##############################################################################

On Monday, June 22, 2020 at 10:16:03 AM UTC-4, Troy Roberts wrote:
>
> Hello,
>
> I am having some issues getting BME280 pressure data into my weewx data. I 
> am currently capturing data from an Acurite 5n1 using SDR which is running 
> off a raspberry pi 3. The weewx version is 4.1.1 and all my data is 
> uploading with no issue. I wanted to added pressure data so I followed the 
> guide at (https://gitlab.com/wjcarpenter/bme280wx), which led me to (
> https://pypi.org/project/RPi.bme280/) to get i2c ports up and running. 
> After getting that setup and running the following code, I am able to read 
> all the data from the BME280 sensor.
>
> import smbus2import bme280
> port = 1address = 0x76bus = smbus2.SMBus(port)
> calibration_params = bme280.load_calibration_params(bus, address)
> # the sample method will take a single reading and return a# 
> compensated_reading objectdata = bme280.sample(bus, address, 
> calibration_params)
> # the compensated_reading class has the following 
> attributesprint(data.id)print(data.timestamp)print(data.temperature)print(data.pressure)print(data.humidity)
> # there is a handy string representation tooprint(data)
>
>
> With the following output:
> pi@raspberrypi:~/Desktop $ python BME280_Test.py
> d8bceed7-07e4-499f-a28e-c29928734eab
> 2020-06-22 09:55:51.107513
> 25.5355866359
> 1016.85232725
> 46.2092222928
> compensated_reading(id=d8bceed7-07e4-499f-a28e-c29928734eab, timestamp=
> 2020-06-22 09:55:51.107513, temp=25.536 °C, pressure=1016.85 hPa, humidity
> =46.21 % rH)
>
>
> After that, I've ran the wee_extension --install command to install 
> bme280wx. I then stop weewx and then started it again and I keep getting 
> the following error:
>
> Jun 22 09:58:36 raspberrypi weewx[455] INFO user.sdr: startup process 
> 'rtl_433 -M utc -F json'
> Jun 22 09:58:36 raspberrypi weewxd: bme280: bme280wx configuration 
> {u'temperature_must_have': u'', u'humidityKeys': u'inHumidity', 
> u'pressureKeys': u'pressure', u'pressure_must_have': u'inTemp', 
> u'i2c_port': u'1', u'humidity_must_have': u'', u'i2c_address': u'0x76', 
> u'usUnits': u'US', u'temperatureKeys': u'inTemp'}
> Jun 22 09:58:36 raspberrypi weewx[455] INFO user.sdr: shutdown process 
> rtl_433 -M utc -F json
> Jun 22 09:58:47 raspberrypi weewx[455] INFO user.sdr: timed out waiting 
> for stderr-thread
> Jun 22 09:58:47 raspberrypi weewx[455] CRITICAL __main__: Caught 
> unrecoverable exception:
> Jun 22 09:58:47 raspberrypi weewx[455] CRITICAL __main__:     ****  
> 'module' object has no attribute 'load_calibration_params'
> Jun 22 09:58:47 raspberrypi weewx[455] CRITICAL __main__:     ****  
> Traceback (most recent call last):
> Jun 22 09:58:47 raspberrypi weewx[455] CRITICAL __main__:     ****    File 
> "/usr/share/weewx/weewxd", line 148, in main
> Jun 22 09:58:47 raspberrypi weewx[455] CRITICAL __main__:     ****      
> engine = weewx.engine.StdEngine(config_dict)
> Jun 22 09:58:47 raspberrypi weewx[455] CRITICAL __main__:     ****    File 
> "/usr/share/weewx/weewx/engine.py", line 75, in __init__
> Jun 22 09:58:47 raspberrypi weewx[455] CRITICAL __main__:     ****      
> self.loadServices(config_dict)
> Jun 22 09:58:47 raspberrypi weewx[455] CRITICAL __main__:     ****    File 
> "/usr/share/weewx/weewx/engine.py", line 138, in loadServices
> Jun 22 09:58:47 raspberrypi weewx[455] CRITICAL __main__:     ****      
> obj = weeutil.weeutil.get_object(svc)(self,config_dict)
> Jun 22 09:58:47 raspberrypi weewx[455] CRITICAL __main__:     ****    File 
> "/usr/share/weewx/user/bme280wx.py", line 61, in __init__
> Jun 22 09:58:47 raspberrypi weewx[455] CRITICAL __main__:     ****      
> self.calibration_params = bme280.load_calibration_params(self.bus, 
> self.address)
> Jun 22 09:58:47 raspberrypi weewx[455] CRITICAL __main__:     ****  
> AttributeError: 'module' object has no attribute 'load_calibration_params'
> Jun 22 09:58:47 raspberrypi weewx[455] CRITICAL __main__:     ****  
> Exiting.
>
> I'm not sure why this is occurring because I don't get this error running 
> the test code above which calls the 'load_calibration_params' Any ideas?
>
> Thanks,
> Troy
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/f2c96141-2314-4b5a-89c6-aa8e24e576d5o%40googlegroups.com.

Reply via email to