Ewon TechForum
Providing technical solutions to technical requests


MQTT - Create a messages buffer when connection to the broker is down
simon Offline
eWON Support
#1
Hi,

Some of you use MQTT connection to send Tag live values to different IOT platforms.

However, you may also want to buffer the messages in case the MQTT connection is down.

As of firmware 14, you now have the possibility to detect the MQTT disconnection from the BASIC and JAVA.

So, the idea here is to create a function that saves the messages when the connection is down and create another function that sends these messages when the connection is up again.

Here is the program
.zip   MQTT_EWONSUPPORT_BUFFER.zip (Size: 14,79 KB / Downloads: 34) (based on the https://ewonsupport.biz/mqtt broker).
(!! This program only works with firmware 14 and > !!)

PS : Be careful that if you use a big buffer file (See BufferFilePathMaxSize variable), the Flexy could take some minutes to push all the messages back to the broker when the connection is up again.  During this time, no "live" messages will be pushed or stored.

Simon
Reply



Possibly Related Threads…
Star MQTT Publish Problem Started by ntnunk
2 Replies - 64 Views
27-03-2020, 03:20 PM
Last Post: simon
  MQTT secure connection Started by Srdjan
3 Replies - 37 Views
26-03-2020, 03:20 PM
Last Post: Srdjan
03-03-2020, 11:35 PM
Last Post: simon
31-01-2020, 05:27 PM
Last Post: simon
23-12-2019, 06:03 PM
Last Post: simon
10-12-2019, 05:50 AM
Last Post: Kanduri Shouri
  MQTT client stability ? Started by lgn@ltr@n
6 Replies - 1.710 Views
17-09-2019, 03:00 PM
Last Post: simon
  Mqtt Error Started by Azzamjj
1 Replies - 410 Views
05-09-2019, 04:31 PM
Last Post: simon
19-06-2019, 10:51 PM
Last Post: simon
  MQTT issue Started by AudreyCim
3 Replies - 1.167 Views
21-03-2019, 11:19 AM
Last Post: simon



Users browsing this thread:
1 Guest(s)



Theme © Ewon 2019 - Forum software by © MyBB - Cookie policy