Weewx Version: 5.0.2-1 issues post upgrade

138 views
Skip to first unread message

meteo219

unread,
Feb 22, 2024, 2:12:08 AMFeb 22
to weewx-user
Hello Weewx Users,

I upgraded weewx tonight on my raspberry pi to version 5.0.2-1 and since doing so, I had some major reconfiguration issues to get things working again.  I upgraded via apt upgrade -y and then choose Y when asked if I wanted to upgrade weewx.conf.  I am thinking that I should have gone with the default of N there.

That said, I was able to fix most things myself by following instructions I found here:


I am using SDR for most of my data and BME280 for pressure.

The code that I am using for those products in /etc/weewx.conf looks like this:

[SDR]
    # This section is for the software-defined radio driver.

    # The driver to use
    driver = user.sdr

    cmd = /usr/bin/rtl_433 -M utc -F json -R 40

    [[sensor_map]]
        outTemp = temperature.04A5.Acurite5n1PacketV2
        outHumidity = humidity.04A5.Acurite5n1PacketV2
        windDir = wind_dir.04A5.Acurite5n1PacketV2
        windSpeed = wind_speed.04A5.Acurite5n1PacketV2
        rain_total = rain_total.04A5.Acurite5n1PacketV2

[Bme280wx]
    i2c_port = 1
    i2c_address = 0x77
    usUnits = US
    temperatureKeys = inTemp
    temperature_must_have = ""
    pressureKeys = pressure
    pressure_must_have = outTemp
    humidityKeys = inHumidity
    humidity_must_have = ""

I already installed modules using apt:

apt install python3-smbus2
apt install python3-bme280

That said, I am not seeing any pressure data from bme280.  I ran weectl extension install  bme280wx-master.zip and that added under [[Services]] this line:

data_services = user.bme280wx.Bme280wx

When I restart weewx, I see these errors with debug on:

2024-02-22T01:52:50.936407-05:00  weewxd[11578]: CRITICAL __main__:     ****    File "/etc/weewx/bin/user/bme280wx.py", line 58, in __init__
2024-02-22T01:53:00.940567-05:00  weewxd[11578]: DEBUG weewx.engine: Loading service user.bme280wx.Bme280wx
2024-02-22T01:53:00.941284-05:00 weewxd.py: bme280: bme280wx configuration {'i2c_port': '1', 'i2c_address': '0x77', 'usUnits': 'US', 'temperatureKeys': 'inTemp', 'temperature_must_have': '', 'pressureKeys': 'pressure', 'pressure_must_have': 'outTemp', 'humidityKeys': 'inHumidity', 'humidity_must_have': ''}

Line 58 of the above file is: self.bus = smbus2.SMBus(self.port) if that helps.

i2c
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- 77

Any ideas on this one?  Things were working great before this upgrade.  I am thinking that I need an updated version of the bme280 script but not sure what is wrong.

Thanks,

Jeff


Pierre-Yves

unread,
Feb 22, 2024, 8:08:09 AMFeb 22
to weewx-user
Hello Jeff,

For having my BME280 working properly with Weewx 5.0.2.1, I had to add this permission: "sudo usermod -aG i2c weewx".
Did you add it already ?

Pierre-Yves

Jeff Chabot

unread,
Feb 22, 2024, 8:41:09 AMFeb 22
to weewx...@googlegroups.com
Hi Pierre-Yves,

Thanks for the suggestion, I just ran that command, uninstalled the extension and reinstalled it.  Unfortunately, either it didn't help or I am seeing new issues.  Here are the new errors I am seeing when installing the bme280wx-master.zip extension:

2024-02-22T08:24:09.936591-05:00 raspberrypi weewxd[861]: Exception in thread stdout-thread:
2024-02-22T08:24:09.937508-05:00 raspberrypi weewxd[861]: Traceback (most recent call last):
2024-02-22T08:24:09.937920-05:00 raspberrypi weewxd[861]:   File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
2024-02-22T08:24:09.939853-05:00 raspberrypi weewxd[861]:     self.run()
2024-02-22T08:24:09.940435-05:00 raspberrypi weewxd[861]:   File "/etc/weewx/bin/user/sdr.py", line 198, in run
2024-02-22T08:24:09.940815-05:00 raspberrypi weewxd[861]: Exception in thread stderr-thread:
2024-02-22T08:24:09.941172-05:00 raspberrypi weewxd[861]: Traceback (most recent call last):
2024-02-22T08:24:09.941502-05:00 raspberrypi weewxd[861]:   File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
2024-02-22T08:24:09.942416-05:00 raspberrypi weewxd[861]:     for line in iter(self._fd.readline, ''):
2024-02-22T08:24:09.943319-05:00 raspberrypi weewxd[861]: ValueError: PyMemoryView_FromBuffer(): info->buf must not be NULL
2024-02-22T08:24:09.944357-05:00 raspberrypi weewxd[861]:     self.run()
2024-02-22T08:24:09.945285-05:00 raspberrypi weewxd[861]:   File "/etc/weewx/bin/user/sdr.py", line 198, in run
2024-02-22T08:24:09.946172-05:00 raspberrypi weewxd[861]:     for line in iter(self._fd.readline, ''):
2024-02-22T08:24:09.946998-05:00 raspberrypi weewxd[861]: ValueError: PyMemoryView_FromBuffer(): info->buf must not be NULL
2024-02-22T08:24:09.947862-05:00 raspberrypi weewxd[861]: INFO user.sdr: shutdown complete
2024-02-22T08:24:09.948348-05:00 raspberrypi weewxd[861]: CRITICAL __main__: Caught OSError: [Errno 121] Remote I/O error
2024-02-22T08:24:09.952604-05:00 raspberrypi weewxd[861]: CRITICAL __main__:     ****  Traceback (most recent call last):
2024-02-22T08:24:09.953116-05:00 raspberrypi weewxd[861]: CRITICAL __main__:     ****    File "/usr/share/weewx/weewxd.py", line 160, in main
2024-02-22T08:24:09.953514-05:00 raspberrypi weewxd[861]: CRITICAL __main__:     ****      engine = weewx.engine.StdEngine(config_dict)
2024-02-22T08:24:09.953891-05:00 raspberrypi weewxd[861]: CRITICAL __main__:     ****               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-22T08:24:09.954261-05:00 raspberrypi weewxd[861]: CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 89, in __init__
2024-02-22T08:24:09.954633-05:00 raspberrypi weewxd[861]: CRITICAL __main__:     ****      self.loadServices(config_dict)
2024-02-22T08:24:09.955000-05:00 raspberrypi weewxd[861]: CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 157, in loadServices
2024-02-22T08:24:09.955366-05:00 raspberrypi weewxd[861]: CRITICAL __main__:     ****      obj = weeutil.weeutil.get_object(svc)(self, config_dict)
2024-02-22T08:24:09.955737-05:00 raspberrypi weewxd[861]: CRITICAL __main__:     ****            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-22T08:24:09.956185-05:00 raspberrypi weewxd[861]: CRITICAL __main__:     ****    File "/etc/weewx/bin/user/bme280wx.py", line 61, in __init__
2024-02-22T08:24:09.956573-05:00 raspberrypi weewxd[861]: CRITICAL __main__:     ****      self.calibration_params = bme280.load_calibration_params(self.bus, self.address)
2024-02-22T08:24:09.956997-05:00 raspberrypi weewxd[861]: CRITICAL __main__:     ****                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-22T08:24:09.957365-05:00 raspberrypi weewxd[861]: CRITICAL __main__:     ****    File "/usr/lib/python3/dist-packages/bme280/__init__.py", line 154, in load_calibration_params
2024-02-22T08:24:09.957686-05:00 raspberrypi weewxd[861]: CRITICAL __main__:     ****      compensation_params.dig_T1 = read.unsigned_short(0x88)
2024-02-22T08:24:09.958039-05:00 raspberrypi weewxd[861]: CRITICAL __main__:     ****                                   ^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-22T08:24:09.958418-05:00 raspberrypi weewxd[861]: CRITICAL __main__:     ****    File "/usr/lib/python3/dist-packages/bme280/reader.py", line 40, in unsigned_short
2024-02-22T08:24:09.958786-05:00 raspberrypi weewxd[861]: CRITICAL __main__:     ****      return self._bus.read_word_data(self._address, register) & 0xffff
2024-02-22T08:24:09.959133-05:00 raspberrypi weewxd[861]: CRITICAL __main__:     ****             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-22T08:24:09.959500-05:00 raspberrypi weewxd[861]: CRITICAL __main__:     ****    File "/usr/lib/python3/dist-packages/smbus2/smbus2.py", line 474, in read_word_data
2024-02-22T08:24:09.959849-05:00 raspberrypi weewxd[861]: CRITICAL __main__:     ****      ioctl(self.fd, I2C_SMBUS, msg)
2024-02-22T08:24:09.960296-05:00 raspberrypi weewxd[861]: CRITICAL __main__:     ****  OSError: [Errno 121] Remote I/O error
2024-02-22T08:24:09.960694-05:00 raspberrypi weewxd[861]: CRITICAL __main__:     ****  Waiting 10 seconds then retrying...

This may or may not be helpful, but when I try to run the python extension: bme280wx.py from a command line, I am getting these errors:
/etc/weewx/bin/user#python3 bme280wx.py

  File "/etc/weewx/bin/user/bme280wx.py", line 8, in <module>
    import weewx
ModuleNotFoundError: No module named 'weewx'

Please note, when I uninstall the above extension, weewx works fine without the pressure data.

Thanks again in advance!

Jeff

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/-qmJU5-ON1U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/37300b2e-8d98-4a48-8a38-6314b736a5acn%40googlegroups.com.

Jeff Chabot

unread,
Feb 22, 2024, 9:50:25 AMFeb 22
to weewx...@googlegroups.com
I fixed my issue today by modifying the bme280wx-master/install.py script to use the correct i2c_address: 'i2c_address': '0x77'.  It was set to 0x76.  I then uninstalled the extension and reinstalled it.

Thanks again!

Jeff

On Thu, Feb 22, 2024 at 8:08 AM Pierre-Yves <pyb...@gmail.com> wrote:

Pierre-Yves

unread,
Feb 22, 2024, 10:01:08 AMFeb 22
to weewx-user

I read this on your log: OSError: "[Errno 121] Remote I/O error"...

Prior installing the BME280 extension, I installed the AS3935 one and I had also to add gpio to weewx group to make my AS3935 lightining detector working.

Maybe try this: "sudo usermod -a -G gpio weewx"

Pierre-Yves

unread,
Feb 22, 2024, 10:08:19 AMFeb 22
to weewx-user
Ok Jeff nice. Sure, it couldn't work with a bad i2c address ;-)

PY
Reply all
Reply to author
Forward
0 new messages