I thought I did, but to be sure, I tried again and it's there:

(weewx-venv) pdunphy@violet:~/weewx-data $ pip3 install paho-mqtt==1.6.1
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: paho-mqtt==1.6.1 in /home/pdunphy/weewx-venv/lib/python3.11/site-packages (1.6.1)
(weewx-venv) pdunphy@violet:~/weewx-data $

    You have to downgrade paho-mqtt because the latest version is incompatible with Matthew's extension (as per the wiki.)  That seems to be OK.  It's this section of weewx.conf that blows it up, I think:

[Engine]

    # The following section specifies which services should be run and in what order.
    [[Services]]
        prep_services = weewx.engine.StdTimeSynch
        data_services = ,
        process_services = weewx.engine.StdConvert, weewx.engine.StdCalibrate, weewx.engine.StdQC, weewx.wxservices.StdWXCalculate         xtype_services = weewx.wxxtypes.StdWXXTypes, weewx.wxxtypes.StdPressureCooker, weewx.wxxtypes.StdRainRater, weewx.wxxtypes.StdDelta
        archive_services = weewx.engine.StdArchive
        restful_services = weewx.restx.StdStationRegistry, weewx.restx.StdWunderground, weewx.restx.StdPWSweather, weewx.restx.StdCWOP, weewx.restx.StdWOW, weewx.restx.StdAWEKAS, user.mqtt.MQTT *<---- This*
        report_services = weewx.engine.StdPrint, weewx.engine.StdReport

Paul VE1DX



On 2024-03-20 2:38 p.m., 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 a topic in the Google Groups "weewx-development" group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-development/3sQJJd6FyBo/unsubscribe. To unsubscribe from this group and all its topics, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/2ed32fc7-4348-4560-892e-43dd85e4d199n%40googlegroups.com <https://groups.google.com/d/msgid/weewx-development/2ed32fc7-4348-4560-892e-43dd85e4d199n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
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/f09ef3e8-9876-4007-a204-121b2ef6206e%40gmail.com.

Reply via email to