I know it's a bit of a sidetrack, but I can speak from experience that the Sparkplug requirement in practice is actually not "all messages must be QoS0" but rather "MQTT devices and brokers must not transmit a message more than once". You can use QoS1 or even
QoS2 if you know that all the hops along your MQTT path will NOT RETRANSMIT if something misbehaves. That can be hard to guarantee depending on what devices or brokers you are using, but it can give you more confidence in your connection if you can do it.
In practice, I have never seen a device with a stable connection over a wired network connection ever miss a message while using QoS0 since TCP does it's job quite well and makes sure everything gets through.
On our cellular devices we use QoS1 between the edge device and the broker more as a "is our connection still working" test than anything else. The broker is configured to downgrade those messages to QoS0 when passing on to the host applications, so we know
it's not going to retransmit. But like I said, we have control of the programming on the edge devices and have designed them to not retransmit if the QoS1 ACK is not received. Instead of retransmitting, we tweak some setting to try and recover the cellular
connection and just keep throwing extra MQTT PINGs over the connection until it either recovers or breaks. If it recovers, we know since we get the QoS0 ACK. If it breaks, we put the lost transmit in our store-and-forward backlog and wait until a new connection
is open, then we send it as a "is_historical" message.
From: sparkplug-wg <sparkplug-wg-bounces@xxxxxxxxxxx> on behalf of Kevin Kilroy via sparkplug-wg <sparkplug-wg@xxxxxxxxxxx>
Sent: Thursday, December 5, 2024 7:21 AM
To: David Schultz <dschultz@xxxxxxxxx>
Cc: Kevin Kilroy <kevkilroy@xxxxxxxxx>; The Sparkplug Working group <sparkplug-wg@xxxxxxxxxxx>
Subject: Re: [sparkplug-wg] Unified Namespace
Email from OUTSIDE of TASI Measurement
Thanks David,
We were considering all the levels and going all the way up to Cloud.
I’m interested in what you mentioned around the application functions are available that help ensure message delivery and notifications when they aren’t…could you give some examples please?
Thanks,
Depends on how you define a UNS. If you mean only Level 2 and below, like telemetry data, SpB is preferred. While it uses QoS 0, there are other application functions that help ensure message delivery and notifications when
messages are not reeived.
David Schultz
G5 Consulting & Engineering Services
512
Westlawn Avenue | Mukwonago | Wisconsin | 53149
M +1 262.441.6109 | E dschultz@xxxxxxxxx
People | Process | Technology | Solutions | Results
Hi,
Is SparkplugB a good framework for building a unified namespace?
The concern I have is around DDATA messages being sent with QoS 0. We have distributed sites that need to publish to a central broker over the public internet and I’m concerned messages would be lost en route.
I’m aware of the primary application but surely that would need to be hosted close to the EoN on a reliable local network?
Any advice or thoughts would be appreciated.
Thank you,
Kevin.
|