Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] clarity on disconnect reasons

Hi Greg,

There have been better messages in place for a while, but alas they
weren't getting used in the most common disconnection cases. This has
been fixed in the `fixes` branch, which should become 1.6.5 tomorrow.

The plain "socket error" message should now just be down to the
connection dropping.

Cheers,

Roger

On Wed, 11 Sep 2019 at 17:33, Greg Troxel <gdt@xxxxxxxxxx> wrote:
>
> After what feels like over a year of maintaining the pkgsrc entry for
> moquitto, I've started to actually use it.
>
> My setup is very simple:
>
>   mosquitto running on a system, with TLS but otherwise pretty default
>
>   esp8266 with nodemcu (not near the broker, and through a NAT), my own
>   lua code, temp/humidity sensor, connecting once with 1 min keepalive
>   and lwt set to online=OFF, posting online=ON, then posting T/H every
>   minute.
>
>   home assistant running (also not near the broker), watching some
>   topics, and in particular sending alerts on oneline=OFF.
>
> After days of just collecting data, I got a "power off alert" (which of
> course really means "the sensor has gone offline, so either power is
> off, the net is broken, the hardware has flaked, or some code is
> buggy").  The logs showed:
>
>   Sep 11 06:31:01 foo  mosquitto[8167]: Socket error on client esp8266-bar, disconnecting.
>   Sep 11 06:31:10 [new connection]
>
> which is curious.  There was a second pair around 2130 on the 10th, 12
> seconds apart.  It takes about 18s between boot and posting the online
> message (I have a 10s delay in init.lua before loading the rest, to
> allow recovery from bad code without reflashing, and the rest is boot,
> joining wifi, mqtt connection including tls), so the reboot must have
> been 06:30:52 ish.
>
> So, I am guessing that something happened in the network, and there is
> an odd entry in the dns server log at about the same time.  All
> reconnected, and overall things are working as intended.
>
> But, it would be nice if "socket error" were more specific, giving which
> system call and the errno value, and perhaps even why the system call
> was made.  I am guessing it was a server-originated keepalive
> transmission that got back a RST because the device had not TCP
> connection open.
> _______________________________________________
> mosquitto-dev mailing list
> mosquitto-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/mosquitto-dev


Back to the top