Timeout on Serverless

Hello, I am trying to use a simple MQTT server to pass data from a remote IOT setup to my home. I am using a Soracom SIM as the internet connection.
I send the data to Soracom via MQTT and it transfers the data to my HiveMQ MQTT account where I access and use at home. This is a raspberry pi with Node Red sending the data.
This all works provided that I send the data every 5 mins. If I change this to 10 mins, the Hive servers generates a send error, which I presume is a Time Out problem.
I have a workaround where I send a “msg.payload=true” every 5 minutes, and that seems to keep the connection alive.
Is there a better method? I would prefer to reduce the data flow as I have a 25Mb per month limit with Soracom.
Thanks

Hello @Ratsea

Welcome to HiveMQ Community Forum. Glad to see you are interested in MQTT and HiveMQ Cloud.
You’re correct in identifying that the issue is likely related to the MQTT connection timing out when no data is sent for an extended period. Sending a msg.payload=true every 5 minutes is a valid workaround, but there’s a more efficient approach that can reduce your data usage.

We suggest configuring your MQTT client’s keep-alive interval to match your desired data transmission frequency. For example, setting the keep-alive to 600 seconds (10 minutes) will ensure the connection is maintained without needing to send application-level messages.

Most MQTT clients, including Node-RED, automatically send lightweight PINGREQ messages within the keep-alive interval, which are only a few bytes in size, ideal for your 25MB/month Soracom limit.

Please let us know if you’d like assistance with configuring this or have any further questions.

Regards,
Sheetal from HiveMQ team