@@ -16,15 +16,15 @@ there's no power (mains outage or battery ran out). As you may imagine,
1616umqtt.robust won't help you with your flat battery. Most computing
1717systems are now networked, and communication is another weak link.
1818This is especially true for wireless communications. If two of your
19- systems can't connect reliably communicate via WiFi, umqtt.robust
19+ systems can't connect or reliably communicate over WiFi, umqtt.robust
2020can't magically resolve that (but it may help with intermittent
2121WiFi issues).
2222
2323What umqtt.robust tries to do is very simple - if while trying to
24- perform some operation, it detects that connection to MQTT breaks,
25- it tries to reconnect to it . That's good direction towards "robustness",
26- but the problem that there is no single definition of what "robust"
27- is. Let's consider following usecase :
24+ perform some operation, it detects that the connection to MQTT breaks,
25+ it tries to reconnect. That's a good direction towards "robustness",
26+ but the problem is that there no single definition of what "robust"
27+ is. Let's consider the following usecases :
2828
29291. A temperature reading gets transmitted once a minute. Then the
3030best option in case of a transmission error might be not doing
@@ -35,11 +35,11 @@ battery-powered, any connection retries will just drain battery and
3535make device "less robust" (it will run out of juice sooner and more
3636unexpectedly, which may be a criteria for "robustness").
3737
38- 2. If there's a button, which communicates its press event, then
39- perhaps it's really worth to retry to deliver this event (a user
38+ 2. If there's a button which communicates it's press event, then
39+ perhaps it's really worth it to retry delivering this event (a user
4040expects something to happen when they press the button, right?).
41- But if a button is battery-power, unconstrained retries won't do
42- much good still . Consider mains power outage for several hours,
41+ But if a button is on battery-power, unconstrained retries still won't do
42+ much good. Consider mains power outage for several hours,
4343MQTT server down all this time, and battery-powered button trying
4444to re-publish event every second. It will likely drain battery
4545during this time, which is very non-robust. Perhaps, if a press
@@ -48,10 +48,10 @@ on what press does, the above may be good for a button turning
4848on lights, but not for something else!)
4949
50503. Finally, let's consider security sensors, like a window broken
51- sensor. That's the hardest case. Apparently, those events are
51+ sensor. That's the hardest case. Those events are
5252important enough to be delivered no matter what. But if done with
5353short, dumb retries, it will only lead to quick battery drain. So,
54- a robust device would retry, but in smart manner, to let battery
54+ a robust device would retry, but in a smart manner to let the battery
5555run for as long as possible, to maximize the chance of the message
5656being delivered.
5757
@@ -61,19 +61,19 @@ a) There's no single definition of what "robust" is. It depends on
6161 a particular application.
6262b) Robustness is a complex measure, it doesn't depend on one single
6363 feature, but rather many different features working together.
64- Consider for example that to make button from the case 2 above
64+ Consider for example that to make the button from the case 2 above
6565 work better, it would help to add a visual feedback, so a user
66- knew what happens .
66+ knows what happened .
6767
6868As you may imagine, umqtt.robust doesn't, and can't, cover all possible
6969"robustness" scenarios, nor it alone can make your MQTT application
7070"robust". Rather, it's a barebones example of how to reconnect to an
7171MQTT server in case of a connection error. As such, it's just one
72- of many steps required to make your app robust, and majority of those
72+ of the many steps required to make your app robust, and majority of those
7373steps lie on *your application * side. With that in mind, any realistic
74- application would subclass umqtt.robust.MQTTClient class and override
74+ application would inherit umqtt.robust.MQTTClient class and override
7575delay() and reconnect() methods to suit particular usage scenario. It
76- may even happen that umqtt.robust won't even suit your needs, and you
76+ may even be possible that umqtt.robust doesn't suit your needs, and you
7777will need to implement your "robust" handling from scratch.
7878
7979
@@ -82,18 +82,18 @@ Persistent and non-persistent MQTT servers
8282
8383Consider an example: you subscribed to some MQTT topics, then connection
8484went down. If we talk "robust", then once you reconnect, you want any
85- messages which arrived when the connection was down, to be still delivered
85+ messages which arrived when the connection was down, to still be delivered
8686to you. That requires retainment and persistency enabled on MQTT server.
8787As umqtt.robust tries to achieve as much "robustness" as possible, it
8888makes a requirement that the MQTT server it communicates to has persistency
8989enabled. This include persistent sessions, meaning that any client
90- subscriptions are retained across disconnect , and if you subscribed once,
90+ subscriptions are retained on disconnectivity , and if you subscribed once,
9191you no longer need to resubscribe again on next connection(s). This makes
9292it more robust, minimizing amount of traffic to transfer on each connection
9393(the more you transfer, the higher probability of error), and also saves
9494battery power.
9595
96- However, not all broker offer true, persistent MQTT support:
96+ However, not all brokers offer true, persistent MQTT support:
9797
9898* If you use self-hosted broker, you may need to configure it for
9999 persistency. E.g., a popular open-source broker Mosquitto requires
0 commit comments