Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] MQTT „The connection was lost.“ inside same subnet

Hi,
I found out myself. The problem is in the different MQTT-protocols. It looks like the broker only supports version 3.1, but my client (RasPi) defaults to version 3.1.1. When I use
     mosquitto_sub -h 192.168.131.5 -p 1883 -t "info/#" -V 31
on the RasPi it works :-))

Ing. Karl SCHUH


Von: "Karl SCHUH" <k.schuh@xxxxxxxxxxx>
An: "mosquitto-dev" <mosquitto-dev@xxxxxxxxxxx>
Gesendet: Freitag, 6. September 2019 13:06:24
Betreff: MQTT „The connection was lost.“ inside same subnet

Hi @ all,

I need mqtt-function on a raspberry pi for my home-automation system. It worked at home with a broker-installation I made a few months ago. Since I am away from home for 3 weeks I took the raspi with me.

I use my laptop (internat network-addr 192.168.131.5) as router to the internet and made a new install of mosquitto (0.15-2+deb7u3ubuntu0.1 on LinuxMint 17.3 - it says „ MQTT v3.1 broker“ when I try mosquitto -v). mosquitto_sub and mosquitto_pub (0.15-2+deb7u3ubuntu0.1) work, when used on the laptop. I also did a test with „ test.mosquitto.org“ and it worked. I have only enabled logging at debug-level in the config-file, nothing else changed.

When I try mosquitto_sub -h 192.168.131.5 -t „#“ on the RasPi (192.168.131.192) nothing happens when I publish something from the laptop. mosquitto_sub is version is 1.6.4. Tcpdump and wireshark (on the laptop) show a MQTT-connect packet, but no MQTT-ack for it. Nothing is shown in syslog on the laptop. It looks like the packet did never reach the server-process. Of course I tried to disable the firewall on the laptop. On the laptop netstat shows port 1883 listening.

Trying mosquitto_pub on the RasPi brings up „Error: The connection was lost.“ Nothing in syslog on the laptop too. I also tried another client-id, but noting different.

pi@GSM-testRasPi:~ $ mosquitto_pub -i "raspi" -h 192.168.131.5 -p 1883 -t "info/room107" -m "test from raspi"

Error: The connection was lost.

I also tried the test with „ test.mosquitto.org“ on the RasPi and it worked.

So, to me, the server seems to be OK and the client too, but they don't work together. Why?

Any help appreciated, Karl.



Back to the top