     // Once connected, publish an announcement...
       mqtt_client.publish(MQTTack, "Connected");
       debug("connected.");
-    // Subscribing to topic(s)
-    subscribing(MQTTcommand);
+      // Subscribing to topic(s)
+      subscribing(MQTTcommand);
     } else {
       debug("failed, rc=" + String(mqtt_client.state()) +
-            " try again in a bit.");
+            " Try again in a bit.");
       // Wait for a bit before retrying
-      delay(MQTT_RECONNECT_TIME);
+      delay(tries << 7);  // Linear increasing back-off (x128)
     }
+    tries++;
   }
   return mqtt_client.connected();
 }
-#endif
+#endif  // MQTT_ENABLE
 
 void loop(void) {
   server.handleClient();

  // MQTT client connection management
  if (!mqtt_client.connected()) {
    uint32_t now = millis();
    if (now - lastReconnectAttempt > MQTT_RECONNECT_TIME) {
      lastReconnectAttempt = now;
      debug("client mqtt not connected, trying to connect");

// Create a unique MQTT client id.
const char* mqtt_clientid = String(MQTTprefix +
                                   String(ESP.getChipId(), HEX)).c_str();
#endif  // MQTT_ENABLE

// Debug messages get sent to the serial port.
void debug(String str) {
#ifdef DEBUG
  uint32_t now = millis();
  Serial.printf("%07u.%03u: %s\n", now / 1000, now % 1000, str.c_str());
#endif  // DEBUG
}

// Root web page with example usage etc.
