Hi everyone. I have a problem with the MQTT Broker on my localhost server.
My website (meteopievedicampo.ddns.net) work good, but i wanto to enable 
MQTT.
I open on my firewall the 9001 port.

I have this error in mosquitto log:
-------------------------------------------------------------------------------------------
1615760009: New connection from 127.0.0.1 on port 1883.
1615760009: Client <unknown> disconnected due to protocol error.
1615760060: New client connected from ::ffff:192.168.1.2 as 
website557173374 (p2, c1, k60).
1615760060: New connection from 127.0.0.1 on port 1883.
1615760060: Client <unknown> disconnected due to protocol error
---------------------------------------------------------------------------------------------

and this is syslog:
---------------------------------------------------------------------------------------------
DEBUG user.mqtt: Failed upload attempt 3: [Errno 104] Connessione 
interrotta dal corrispondente
ERROR weewx.restx: MQTT: Failed to publish record 2021-03-14 23:18:23 CET 
(1615760303): Failed upload after 3 tries
---------------------------------------------------------------------------------------------

This is my weewx.conf:

---------------------------------------------------------------------------------------------
[[MQTT]]
        server_url = mqtt://carlo:XXXXXXXXX@localhost:1883/
        topic = weather/loop
        unit_system = METRIC
        binding = archive, loop
        aggregation = aggregate
         [[[tls]]]
            tls_version = tlsv12
            ca_certs = /etc/mosquitto/certs/chain.pem

 # MQTT Websockets defaults
            mqtt_websockets_enabled = 1
            mqtt_websockets_host = meteopievedicampo.ddns.net
            mqtt_websockets_port = 9001
            mqtt_websockets_ssl = 1
            mqtt_websockets_topic = weather/loop
            disconnect_live_website_visitor = 1800000

[MQTTSubscribeService]
    enable = true
    host = localhost
    port = 1883
    keepalive = 60
    username = carlo
    password = XXXXXXXXXX
    binding = loop
    [[message_callback]]
        type = json
    [[topics]]
        unit_system = METRIC
-------------------------------------------------------------------------------------------

And this is my mosquitto.conf:

------------------------------------------------------------------------------------------
persistence false
allow_anonymous true
password_file /etc/mosquitto/passwd
acl_file /etc/mosquitto/acl
# Insecure mqtt to localhost only, and secure mqtt
listener 1883 localhost
listener 8883
certfile /etc/mosquitto/certs/cert.pem
cafile /etc/mosquitto/certs/chain.pem
keyfile /etc/mosquitto/certs/privkey.pem
protocol mqtt
# websockets
listener 9001
certfile /etc/mosquitto/certs/cert.pem
cafile /etc/mosquitto/certs/chain.pem
keyfile /etc/mosquitto/certs/privkey.pem
protocol websockets
------------------------------------------------------------------------------------------------------

Thanks everyone help me!
Carlo

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" 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-user/bd2362e9-95fd-4d0b-9aa8-eb0abea25350n%40googlegroups.com.

Reply via email to