VPN timeout caused MQTT to fail

Attached is a backup from a unit that was working as expected until there was a timeout due inactivity and then the VPN reconnected. When this happened the MQTT connection never recovered and the unit never sent any more information through MQTT.

Why did the VPN timeout due to inactivity when there is data being sent on a regular basis?

Why did the MQTT process never reconnect and start sending data when the keep alive ping was not being received?

Hi Ted,

We didn’t get the backup. Can you try sending again?



Hi Ted,

Please see this post: https://techforum.ewon.biz/thread-1364.html

It appears that you are having a similar issue with the re-connection and may be executing MQTT “CONNECT” before the WAN is connected.

As for the timeout issue, I would recommend the following changes:

VPNProto from 0 to 1
VPNPortOut from 1194 to 443
VPNAlive from 120 to 30

This will change the VPN protocol to TCP and increase the frequency of the keepalive pings to help prevent those timeouts from happenign.

A VPN connection should not have an impact on the WAN connection should it?

I have tested manually shutting down the VPN connection while MQTT is connected and there was no loss in the MQTT connection. It would seem this disruption only occurs when the VPN connection is closed due to a time out.

That’s correct. I think what’s probably happening is that there is a loss of internet connection which causes both the MQTT and VPN to disconnect, so if that’s the case those settings changes may not make a difference.