parautenbach / WeeWX-BME280

Simplistic PWS (Personal Weather Station) and driver using a BME280 chip with the WeeWX software
10 stars 2 forks source link

Ugg.... AttributeError: module 'bme280' has no attribute #2

Open kevinkey619 opened 2 years ago

kevinkey619 commented 2 years ago

What am I doing wrong? I've installed, uninstalled, and reinstalled and still no luck.

ewx[4017] CRITICAL main: Caught unrecoverable exception: weewx[4017] CRITICAL main: module 'bme280' has no attribute 'load_calibration_params' weewx[4017] CRITICAL main: Traceback (most recent call last):

weewx[4017] CRITICAL main: **** File "/usr/share/weewx/weewxd", line 147, in main

weewx[4017] CRITICAL main: **** engine = weewx.engine.StdEngine(config_dict)

weewx[4017] CRITICAL main: **** File "/usr/share/weewx/weewx/engine.py", line 93, in init

weewx[4017] CRITICAL main: **** self.loadServices(config_dict)

weewx[4017] CRITICAL main: **** File "/usr/share/weewx/weewx/engine.py", line 161, in loadServices

weewx[4017] CRITICAL main: **** obj = weeutil.weeutil.get_object(svc)(self, config_dict)

weewx[4017] CRITICAL main: **** File "/usr/share/weewx/user/bme280wx.py", line 61, in init

weewx[4017] CRITICAL main: **** self.calibration_params = bme280.load_calibration_params(self.bus, self.address)

weewx[4017] CRITICAL main: **** AttributeError: module 'bme280' has no attribute 'load_calibration_params'

weewx[4017] CRITICAL main: **** Exiting.

parautenbach commented 2 years ago

Probably because you're running a newer version of WeeWX than what I've built this against. It seems like there was an interface change. Which version are you running?

I don't actively use this anymore, but I'll see if I can make the necessary changes some time soon.

kevinkey619 commented 2 years ago

weewx 4.8.0

Thanks.

parautenbach commented 2 years ago

I knew this sounded familiar to me and I just remembered: You either don't have the BME280 Python library installed (as per the README), or you have the wrong library installed. You have a file called bme280.py somewhere that Python is loading, but it's the wrong library.

kevinkey619 commented 2 years ago

I've check and I only have the one library.

kevinkey619 commented 2 years ago

pi@ubuntu:~/Downloads $ pip list | grep -i bme

RPi.bme280 0.2.4 WARNING: There was an error checking the latest version of pip. pi@ubuntu:~/Downloads $

parautenbach commented 2 years ago

In my system I have v0.2.3. Latest version seems to mostly fix an issue with local time vs UTC.

Go to https://github.com/rm-hull/bme280 and experiment with the scripts there to ensure you can open a Python REPL and interact with your BME280 using this library.