Close, Vince.  It was the extension that I installed "outside" the venv 
. . . you have to do it without sudo in the environment."

weectl extension install weewx-mqtt.zip
Using configuration file /home/pdunphy/weewx-data/weewx.conf
Install extension 'weewx-mqtt.zip' (y/n)? y
Extracting from zip archive weewx-mqtt.zip
Saving installer file to /home/pdunphy/weewx-data/bin/user/installer/mqtt
Saved copy of configuration as 
/home/pdunphy/weewx-data/weewx.conf.20240320154428
Finished installing extension mqtt from weewx-mqtt.zip

    This puts it in ~/weewx-data/bin/user where it's supposed to be.  Now, 
I have MQTT weather data on my LAN, which was the goal.

Paul VE1DX
On Wednesday, March 20, 2024 at 2:38:16 PM UTC-3 Vince Skahan wrote:

> You need to install paho-mqtt 'within' your python venv.  Activate the 
> venv then do 'pip3 install paho-mqtt'
>
> On Wednesday, March 20, 2024 at 10:17:24 AM UTC-7 Paul Dunphy wrote:
>
>>     I have mosquitto installed and communicating between two terminal 
>> sessions.  I'm running weewx 5.0.2 in a venv on a Pi 5, and it's working 
>> fine.  I followed Tom/Matthew's instructions here to set up MQTT:
>>
>> https://github.com/weewx/weewx/wiki/mqtt
>>
>>     It blows up because it can't find user.mqtt that I added to the 
>> weewx.conf file:
>>
>> [Engine]
>>     [[Services]]
>>         restful_services = ..., user.mqtt.MQTT
>>
>>
>>     Any thoughts on where I might have gone wrong?
>>
>> Paul VE1DX
>>
>> Mar 20 14:00:15 violet systemd[1]: Started weewx.service - WeeWX weather 
>> system.
>> Mar 20 14:00:15 violet sudo[711921]: pam_unix(sudo:session): session 
>> closed for user root
>> Mar 20 14:00:15 violet weewxd[711925]: INFO __main__: Initializing weewxd 
>> version 5.0.2
>> Mar 20 14:00:15 violet weewxd[711925]: INFO __main__: Command line: 
>> /home/pdunphy/weewx-venv/lib/python3.11/site-packages/weewxd.py 
>> /home/pdunphy/weewx-data/weewx.conf
>> Mar 20 14:00:15 violet weewxd[711925]: INFO __main__: Using Python 3.11.2 
>> (main, Mar 13 2023, 12:18:29) [GCC 12.2.0]
>> Mar 20 14:00:15 violet weewxd[711925]: INFO __main__: Located at 
>> /home/pdunphy/weewx-venv/bin/python3
>> Mar 20 14:00:15 violet weewxd[711925]: INFO __main__: Platform 
>> Linux-6.6.20+rpt-rpi-2712-aarch64-with-glibc2.36
>> Mar 20 14:00:15 violet weewxd[711925]: INFO __main__: Locale: 
>> 'en_GB.UTF-8'
>> Mar 20 14:00:15 violet weewxd[711925]: INFO __main__: Entry path: 
>> /home/pdunphy/weewx-venv/lib/python3.11/site-packages/weewxd.py
>> Mar 20 14:00:15 violet weewxd[711925]: INFO __main__: WEEWX_ROOT: 
>> /home/pdunphy/weewx-data
>> Mar 20 14:00:15 violet weewxd[711925]: INFO __main__: Configuration file: 
>> /home/pdunphy/weewx-data/weewx.conf
>> Mar 20 14:00:15 violet weewxd[711925]: INFO __main__: User module: 
>> /home/pdunphy/weewx-data/bin/user
>> Mar 20 14:00:15 violet weewxd[711925]: INFO __main__: Debug: 0
>> Mar 20 14:00:15 violet weewxd[711925]: INFO weewx.engine: Loading station 
>> type Vantage (weewx.drivers.vantage)
>> Mar 20 14:00:16 violet weewxd[711925]: INFO weewx.engine: StdConvert 
>> target unit is 0x10
>> Mar 20 14:00:16 violet weewxd[711925]: INFO weewx.wxservices: 
>> StdWXCalculate will use data binding wx_binding
>> Mar 20 14:00:16 violet systemd[1]: weewx.service: Main process exited, 
>> code=exited, status=1/FAILURE
>> Mar 20 14:00:16 violet python3[711925]: Traceback (most recent call last):
>> Mar 20 14:00:16 violet python3[711925]:   File 
>> "/home/pdunphy/weewx-venv/lib/python3.11/site-packages/weewxd.py", line 
>> 265, in <module>
>> Mar 20 14:00:16 violet python3[711925]:     main()
>> Mar 20 14:00:16 violet python3[711925]:   File 
>> "/home/pdunphy/weewx-venv/lib/python3.11/site-packages/weewxd.py", line 
>> 160, in main
>> Mar 20 14:00:16 violet python3[711925]:     engine = 
>> weewx.engine.StdEngine(config_dict)
>> Mar 20 14:00:16 violet python3[711925]:             
>>  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> Mar 20 14:00:16 violet python3[711925]:   File 
>> "/home/pdunphy/weewx-venv/lib/python3.11/site-packages/weewx/engine.py", 
>> line 89, in __init__
>> Mar 20 14:00:16 violet python3[711925]:     self.loadServices(config_dict)
>> Mar 20 14:00:16 violet python3[711925]:   File 
>> "/home/pdunphy/weewx-venv/lib/python3.11/site-packages/weewx/engine.py", 
>> line 157, in loadServices
>> Mar 20 14:00:16 violet python3[711925]:     obj = 
>> weeutil.weeutil.get_object(svc)(self, config_dict)
>> Mar 20 14:00:16 violet python3[711925]:           
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> Mar 20 14:00:16 violet python3[711925]:   File 
>> "/home/pdunphy/weewx-venv/lib/python3.11/site-packages/weeutil/weeutil.py", 
>> line 1404, in get_object
>> Mar 20 14:00:16 violet python3[711925]:     module = 
>> importlib.import_module(module_name)
>> Mar 20 14:00:16 violet python3[711925]:             
>>  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> Mar 20 14:00:16 violet python3[711925]:   File 
>> "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
>> Mar 20 14:00:16 violet python3[711925]:     return 
>> _bootstrap._gcd_import(name[level:], package, level)
>> Mar 20 14:00:16 violet python3[711925]:           
>>  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> Mar 20 14:00:16 violet python3[711925]:   File "<frozen 
>> importlib._bootstrap>", line 1206, in _gcd_import
>> Mar 20 14:00:16 violet python3[711925]:   File "<frozen 
>> importlib._bootstrap>", line 1178, in _find_and_load
>> Mar 20 14:00:16 violet python3[711925]:   File "<frozen 
>> importlib._bootstrap>", line 1142, in _find_and_load_unlocked
>> Mar 20 14:00:16 violet python3[711925]: ModuleNotFoundError: No module 
>> named 'user.mqtt'
>> Mar 20 14:00:16 violet weewxd[711925]: INFO weewx.engine: Archive will 
>> use data binding wx_binding
>> Mar 20 14:00:16 violet systemd[1]: weewx.service: Failed with result 
>> 'exit-code'.
>> Mar 20 14:00:16 violet weewxd[711925]: INFO weewx.engine: Record 
>> generation will be attempted in 'hardware'
>> Mar 20 14:00:16 violet weewxd[711925]: INFO weewx.engine: Using archive 
>> interval of 300 seconds (specified by hardware)
>> Mar 20 14:00:16 violet weewxd[711925]: INFO weewx.restx: StationRegistry: 
>> Station will be registered.
>> Mar 20 14:00:16 violet weewxd[711925]: INFO weewx.restx: Wunderground: No 
>> config info. Skipped.
>> Mar 20 14:00:16 violet weewxd[711925]: INFO weewx.restx: PWSweather: No 
>> config info. Skipped.
>> Mar 20 14:00:16 violet weewxd[711925]: INFO weewx.restx: CWOP: Data for 
>> station VE1DX will be posted
>> Mar 20 14:00:16 violet weewxd[711925]: INFO weewx.restx: WOW: Data for 
>> station 953456001 will be posted
>> Mar 20 14:00:16 violet weewxd[711925]: INFO weewx.restx: AWEKAS: Data 
>> will be uploaded for user VE1DX
>> Mar 20 14:00:16 violet weewxd[711925]: CRITICAL __main__: Caught 
>> unrecoverable exception:
>> Mar 20 14:00:16 violet weewxd[711925]: CRITICAL __main__:     ****  No 
>> module named 'user.mqtt'
>> Mar 20 14:00:16 violet weewxd[711925]: CRITICAL __main__:     **** 
>>  Traceback (most recent call last):
>> Mar 20 14:00:16 violet weewxd[711925]: CRITICAL __main__:     ****   
>>  File "/home/pdunphy/weewx-venv/lib/python3.11/site-packages/weewxd.py", 
>> line 160, in main
>> Mar 20 14:00:16 violet weewxd[711925]: CRITICAL __main__:     ****     
>>  engine = weewx.engine.StdEngine(config_dict)
>> Mar 20 14:00:16 violet weewxd[711925]: CRITICAL __main__:     ****       
>>         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> Mar 20 14:00:16 violet weewxd[711925]: CRITICAL __main__:     ****   
>>  File 
>> "/home/pdunphy/weewx-venv/lib/python3.11/site-packages/weewx/engine.py", 
>> line 89, in __init__
>> Mar 20 14:00:16 violet weewxd[711925]: CRITICAL __main__:     ****     
>>  self.loadServices(config_dict)
>> Mar 20 14:00:16 violet weewxd[711925]: CRITICAL __main__:     ****   
>>  File 
>> "/home/pdunphy/weewx-venv/lib/python3.11/site-packages/weewx/engine.py", 
>> line 157, in loadServices
>> Mar 20 14:00:16 violet weewxd[711925]: CRITICAL __main__:     ****     
>>  obj = weeutil.weeutil.get_object(svc)(self, config_dict)
>> Mar 20 14:00:16 violet weewxd[711925]: CRITICAL __main__:     ****       
>>      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> Mar 20 14:00:16 violet weewxd[711925]: CRITICAL __main__:     ****   
>>  File 
>> "/home/pdunphy/weewx-venv/lib/python3.11/site-packages/weeutil/weeutil.py", 
>> line 1404, in get_object
>> Mar 20 14:00:16 violet weewxd[711925]: CRITICAL __main__:     ****     
>>  module = importlib.import_module(module_name)
>> Mar 20 14:00:16 violet weewxd[711925]: CRITICAL __main__:     ****       
>>         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> Mar 20 14:00:16 violet weewxd[711925]: CRITICAL __main__:     ****   
>>  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in 
>> import_module
>> Mar 20 14:00:16 violet weewxd[711925]: CRITICAL __main__:     ****     
>>  return _bootstrap._gcd_import(name[level:], package, level)
>> Mar 20 14:00:16 violet weewxd[711925]: CRITICAL __main__:     ****       
>>       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> Mar 20 14:00:16 violet weewxd[711925]: CRITICAL __main__:     ****   
>>  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
>> Mar 20 14:00:16 violet weewxd[711925]: CRITICAL __main__:     ****   
>>  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
>> Mar 20 14:00:16 violet weewxd[711925]: CRITICAL __main__:     ****   
>>  File "<frozen importlib._bootstrap>", line 1142, in _find_and_load_unlocked
>> Mar 20 14:00:16 violet weewxd[711925]: CRITICAL __main__:     **** 
>>  ModuleNotFoundError: No module named 'user.mqtt'
>> Mar 20 14:00:16 violet weewxd[711925]: CRITICAL __main__:     **** 
>>  Exiting.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-development/e7f4f12d-f426-4bb8-9d04-fcfbaef5a15an%40googlegroups.com.

Reply via email to