Skip to content

mqtt-client not reconnecting when broker is restartet #317

@Phunkafizer

Description

@Phunkafizer

Initial connection to broker:

[ 12315][I][AsyncMqttClient.cpp:686] connect(): CONNECTING
[ 12329][I][AsyncMqttClient.cpp:188] _onConnect(): TCP conn, MQTT CONNECT
[ 12330][I][AsyncMqttClient.cpp:369] _addFront(): new front #1
[ 12331][I][AsyncMqttClient.cpp:414] _handleQueue(): snd #1: 36/36
[ 12332][I][AsyncMqttClient.cpp:424] _handleQueue(): p #1 rel
[ 12333][I][AsyncMqttClient.cpp:244] _onAck(): ack 36
[ 12333][I][AsyncMqttClient.cpp:249] _onData(): data rcv (4)
[ 12334][I][AsyncMqttClient.cpp:262] _onData(): rcv CONNACK
[ 12334][I][AsyncMqttClient.cpp:503] _onConnAck(): CONNACK

All ok. When I restart my broker and retry connecting with mqtt-client:

[47957767][I][AsyncMqttClient.cpp:686] connect(): CONNECTING
[47957774][I][AsyncMqttClient.cpp:188] _onConnect(): TCP conn, MQTT CONNECT
[47957774][I][AsyncMqttClient.cpp:369] _addFront(): new front #1
[47957775][I][AsyncMqttClient.cpp:414] _handleQueue(): snd #1: 55/55
[47957776][I][AsyncMqttClient.cpp:424] _handleQueue(): p #1 rel
[47957778][I][AsyncMqttClient.cpp:244] _onAck(): ack 55
[47957779][I][AsyncMqttClient.cpp:224] _onDisconnect(): TCP disconn

In the server log I can see:
1742998191: New connection from 10.0.1.75:63492 on port 1883.
1742998191: Bad socket read/write on client : Malformed UTF-8

I have to reboot my ESP32 to reconnect mqtt-client successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions