mqtt & weewx

Für allgemeine Software
Antworten
speerwerfer
Online
Beiträge: 131
Registriert: 21 Dez 2020, 22:07
Wohnort: zwischen Osnabrück und Bremen
Hat sich bedankt: 6 mal
Danksagung erhalten: 2 mal

mqtt & weewx

#1

Beitrag von speerwerfer »

Nabend zusammen,

ich hab gerade mqtt so eingerichtet, das weewx die Daten auch an einen mqtt Server weitergibt - bzw. geben soll.

Ich hab dieses Projekt installiert und eingerichtet: https://github.com/matthewwall/weewx-mqtt

Beim mqtt kommt nix an und im weewx Log steht dies:

Code: Alles auswählen

Aug 15 21:23:09 weewx weewx[294309] ERROR user.mqtt: Failed to connect to MQTT server (mqtt://iot:xxx@localhost:1883/): [Errno 111] Connection refused
Aug 15 21:23:09 weewx weewx[294309] ERROR weewx.restx: MQTT: Failed to publish record 2023-08-15 21:23:09 UTC (1692134589): MQTT client not available
in der Prozessliste steht weewx so

Code: Alles auswählen

/usr/bin/python3 /home/weewx/bin/weewxd --daemon --pidfile=/var/run/weewx.pid /home/weewx/weewx.conf
und paho-mqtt scheint auch installiert zu sein

Code: Alles auswählen

pip3 list
Package                Version    
---------------------- -----------
bcrypt                 4.0.1      
cffi                   1.15.1     
Cheetah3               3.2.4      
command-not-found      0.3        
configobj              5.0.6      
cryptography           39.0.0     
dbus-python            1.2.16     
distro-info            0.23ubuntu1
ephem                  3.7.7.1    
language-selector      0.1        
netifaces              0.10.4     
olefile                0.46       
paho-mqtt              1.6.1      
paramiko               3.0.0      
Pillow                 7.0.0      
pip                    20.0.2     
pycparser              2.21       
PyGObject              3.36.0     
pymacaroons            0.13.0     
PyNaCl                 1.5.0      
pyserial               3.4        
pysftp                 0.2.9      
python-apt             2.0.1      
pyusb                  1.0.2      
PyYAML                 5.3.1      
setuptools             45.2.0     
six                    1.14.0     
ubuntu-advantage-tools 8001       
ufw                    0.36       
wheel                  0.34.2
irgendwelche Vorschläge?
Benutzeravatar
Gyvate
Offline
Beiträge: 2526
Registriert: 10 Aug 2021, 23:41
Wohnort: Saarbrücken
Hat sich bedankt: 12 mal
Danksagung erhalten: 381 mal
Kontaktdaten:

Re: mqtt & weewx

#2

Beitrag von Gyvate »

Failed to connect to MQTT server (mqtt://iot:xxx@localhost:1883/): [Errno 111] Connection refused
sieht doch mal verdächtig nach einem Berechtigungsproblem aus.

Wenn Du diese Fehlerzeile googelst, findest Du unter anderem:
MQTT ConnectionRefusedError: Errno 111 Connection refused
This error means that the client cannot connect to the port on the computer running server script. This can be caused by few things, like lack of routing to the destination or you have a firewall somewhere between your client and the server - it could be on server itself or on the client etc. Note that a server must perform the sequence socket(), bind(), listen(), accept() (possibly repeating the accept() to service more than one client), while a client only needs the sequence socket(), connect(). Also note that the server does not sendall()/recv() on the socket it is listening on but on the new socket 2 returned by accept(). Try the following:

Check if you really have that port listening on the server (this should tell you if your code does what you think it should): based on you OS, but on linux you could do something like netstat -ntulp
Check from the server, if you’re accepting the connections to the server: again based on your OS, but telnet LISTENING_IP LISTENING_PORT should do the job
Check if you can access the port of the server from the client , but not using the code: just us the telnet (or appropriate command for your OS) from the client

Es kann natürlich auch einfach "nur" ein Benutzer-/Passwort-Problem sein.
Ich würde mal in diese Richtung Ausschau halten.
Ecowitt WS2320E,HP2553,HP3501,GW2001,GW1100, GW1000,WH2650,WN1910,WN1980, Meteobridge RPi4B-2GB/(16)32GB SLC 3165, Weewx 4.5.1/4.10.2, CumulusMX 3.28.4 b3282, Barani MeteoShield Pro, MetSpecRad02, Personal Weather Tablet(PWT) - http://meshka.eu
speerwerfer
Online
Beiträge: 131
Registriert: 21 Dez 2020, 22:07
Wohnort: zwischen Osnabrück und Bremen
Hat sich bedankt: 6 mal
Danksagung erhalten: 2 mal

Re: mqtt & weewx

#3

Beitrag von speerwerfer »

Gyvate hat geschrieben: 16 Aug 2023, 00:13 Es kann natürlich auch einfach "nur" ein Benutzer-/Passwort-Problem sein.
Man sollte einfach so spät keine neue Software konfigurieren ... Tippfehler im Passwort :-(
Antworten