difficulties with differences between weewx and weewxd

47 views
Skip to first unread message

Patrick Sifford

unread,
Jul 10, 2026, 10:16:54 AM (3 days ago) Jul 10
to weewx-user
Hello...    I am new to this group and have been trying to get weewx up and running on a Raspberry pi 4 with Debian GNU/Linux

I have had great success with my initial setup:
      Acurite Atlas sensor
     RTL-433/SDR
     weewx 5.4.0
      Hubitat Interface

      This has been running nicely for a few day and I have been able to add data to the Hubitat Interface.

     during this I have had no issues with either weewx or weewxd

     I have now decided to add a BMP280 to get pressure sensor data.  I have successfully loaded the libraries (took several attempts)

   I have been able to run a test-bmp250.py file and obtain the appropriate data back from the system.

    I then started integrating with weewx.   initially I had issues with both weewxd and weewx.   I would get an error:

        : Traceback (most recent call last):
Jul 10 09:11:29 raspberrypi weewxd[2198]:   File "/usr/share/weewx/weewxd.py", line 226, in <module>
Jul 10 09:11:29 raspberrypi weewxd[2198]:     main()
Jul 10 09:11:29 raspberrypi weewxd[2198]:     ~~~~^^
Jul 10 09:11:29 raspberrypi weewxd[2198]:   File "/usr/share/weewx/weewxd.py", line 121, in main
Jul 10 09:11:29 raspberrypi weewxd[2198]:     engine = weewx.engine.StdEngine(config_dict)
Jul 10 09:11:29 raspberrypi weewxd[2198]:   File "/usr/share/weewx/weewx/engine.py", line 89, in __init__
Jul 10 09:11:29 raspberrypi weewxd[2198]:     self.loadServices(config_dict)
Jul 10 09:11:29 raspberrypi weewxd[2198]:     ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
Jul 10 09:11:29 raspberrypi weewxd[2198]:   File "/usr/share/weewx/weewx/engine.py", line 157, in loadServices
Jul 10 09:11:29 raspberrypi weewxd[2198]:     obj = weeutil.weeutil.get_object(svc)(self, config_dict)
Jul 10 09:11:29 raspberrypi weewxd[2198]:           ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
Jul 10 09:11:29 raspberrypi weewxd[2198]:   File "/usr/share/weewx/weeutil/weeutil.py", line 1405, in get_object
Jul 10 09:11:29 raspberrypi weewxd[2198]:     module = importlib.import_module(module_name)
Jul 10 09:11:29 raspberrypi weewxd[2198]:   File "/usr/lib/python3.13/importlib/__init__.py", line 88, in import_module
Jul 10 09:11:29 raspberrypi weewxd[2198]:     return _bootstrap._gcd_import(name[level:], package, level)
Jul 10 09:11:29 raspberrypi weewxd[2198]:            ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jul 10 09:11:29 raspberrypi weewxd[2198]:   File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
Jul 10 09:11:29 raspberrypi weewxd[2198]:   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
Jul 10 09:11:29 raspberrypi weewxd[2198]:   File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
Jul 10 09:11:29 raspberrypi weewxd[2198]:   File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
Jul 10 09:11:29 raspberrypi weewxd[2198]:   File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
Jul 10 09:11:29 raspberrypi weewxd[2198]:   File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
Jul 10 09:11:29 raspberrypi weewxd[2198]:   File "/etc/weewx/bin/user/BMP280_service.py", line 6, in <module>
Jul 10 09:11:29 raspberrypi weewxd[2198]:     import adafruit_bmp280
Jul 10 09:11:29 raspberrypi weewxd[2198]: ModuleNotFoundError: No module named 'adafruit_bmp280'
Jul 10 09:11:29 raspberrypi systemd[1]: weewx.service: Main process exited, code=exited, status=1/FAILURE
Jul 10 09:11:29 raspberrypi systemd[1]: weewx.service: Failed with result 'exit-code'.

After playing with several group and ownership issues I was successful in running weewxd and ingesting pressure, altitude, and temperature data in to weewx and into hubitat!!!!!!!

However, when trying to run weewx (using the sudo systemctl start weewx command) I still get the same response.

I have put as much as I know in the weewx group.  the BMP library ("Adafruit_BMP280_Library) got loaded into my home directory. with weewx as the group and owner.

At a lost...   to be soo close and yet soo far.  Has anyone run into a situation where weewxd and weewx return different results?

thanks
Patrick Sifford

Vince Skahan

unread,
Jul 10, 2026, 1:35:47 PM (2 days ago) Jul 10
to weewx-user
The basic problem is systemd doesn't know that you added more libraries in an unexpected location. 

From some google and weewx-user searches there seem to be a couple things to try....

Edit the ExecStart section in /usr/lib/systemd/system/weewx.service to prepend setting PYTHONPATH
     ExecStart=PYTHONPATH=/etc/weewx/bin:/usr/share/weewx:/home/me/some/path/here weewxd /etc/weewx/weewx.conf

Or add a line in the [Service] section there to set PYTHONPATH similarly
    Environment=/etc/weewx/bin:/usr/share/weewx:/home/me/some/path/here

Obviously use whatever path you installed things into.  You'll likely have to 'sudo systemctl daemon-reload' after editing that file before testing.

Disclaimer - I didn't test the above...

Patrick Sifford

unread,
Jul 10, 2026, 1:42:06 PM (2 days ago) Jul 10
to weewx-user
Vince...   I will give that a try!!   

I did just do a test..    I ran:
sudo weewxd /etc/weewx/weewx.conf

and I have the same error...   where running
weewxd   I dont get the error

What is the normal place for the adafruit_bmp280 to be located?

Thanks

Vince Skahan

unread,
Jul 10, 2026, 1:55:26 PM (2 days ago) Jul 10
to weewx-user
v5 runs as unprivileged user 'weewx' not as root, so sudo should never be needed other after installation.

In order to test you need to run your command as user 'weewx' not as you...

# open a bash shell as user weewx:
sudo -u weewx bash

# verify this returns 'weewx' as the output
whoami

# then run the weewxd command and see how it looks:
PYTHONPATH=/etc/weewx/bin:/usr/share/weewx:/home/me/some/path/here weewxd /etc/weewx/weewx.conf

And then exit the bash shell you opened above.

I don't really have a great solution for how to add python libraries using 'pip' to a system running a dpkg installation of weewx.  I 'suppose' you could add the libraries into the same place in PYTHONPATH that weewx expects already but that's even messier.  Try setting the PYTHONPATH and see if you can get it working...

Patrick Sifford

unread,
Jul 10, 2026, 2:14:15 PM (2 days ago) Jul 10
to weewx-user
just ran your bash...   whoami is weewx

I don't normally run it as sudo...     i did that as a test to see if i could figure out what was happenning.  

I am happy that I can run it as me... using weewxd...   however when the system boots it runs the service (I believe as root) and that is an issue  I do know that if I commit out the data_service line (in weewx.conf) for the BMP280   all works no matter how I start it.  (but then I am not getting the pressure data).

I have run the three suggestions and have not had any luck.

I am going to try to install  the BMP drivers in /etc/weewx and see if that helps...   although that process was a bit of a issue!!!

THanks
Ill let you know how that goes

Vince Skahan

unread,
Jul 10, 2026, 2:22:17 PM (2 days ago) Jul 10
to weewx-user
Sorry - can't help more not seeing any logs nor transcripts of what/how you installed whatever you added.

This is why I run only weewx venv installations here.  Much simpler and predictable for me FWIW.  Just activate the venv and add stuff into it then no gymnastics required.

Patrick Sifford

unread,
Jul 10, 2026, 2:54:53 PM (2 days ago) Jul 10
to weewx-user
Vince,

Looks like it is up and running!!!!   You helped alot...  Got me thinking about the process that I went through.  When I was first installing the drivers and libraries I was getting errors during the installation process.  One of the on-line helps said that those are common and to use pipx to install.  I believe that this created the libraries and drivers in a virtual environment causing the various properties issues.

I went back and re-installed the approriate drivers using --break-system-packages (still gave me a warning which i choose to ignore).   This seems to be allowing it to run with the weewxd...    or as a service that starts up at system boot.

Thanks for your help...    It was HUGH

Patrick

Reply all
Reply to author
Forward
0 new messages