I have been chasing a problem with seemingly-random and infrequent disconnects due to "Socket error on client" between my ESP8266 client (PubSubClient 2.6.0) and my Mosquitto broker on Raspberry Pi (mosquitto 1.4.10).
I have been reviewing the various log files and debug statements to try and figure out what is going on. While following the log file (
tail -f /var/log/mosquitto/mosquitto.log), I noticed that
PINGRESP record pairs are not populated at the same time, even though their timestamps are identical.
PINGRESP does not show up until the next
PINGREQ is received. Is this normal behaviour?
An example is provided in the screenshot below. The orange row showed up first. The blue rows were added together in the log file 15 seconds later, even though they do not have the same timestamp. In fact, the
PINGRESP timestamp is identical (1516832931) to the
PINGREQ above (in orange).
I would expect
PINGRESP to follow almost immediately behind
PINGREQ (i.e .the timestamps make sense). I just want to make sure that is actually happening given the several seconds lag I observe in
tail. I think this is important because I assume the disconnects are from a keepalive violation, with my keepalive timeout at 15s.