Repository: homieiot/homie-esp8266

Issue #515: Some mqtt messages are not sent if many consecutive ".setProperty().send()" calls are made
Created: 2018-04-10T14:47:33Z
Hi guys!
I'm making some tests with the latest developer branch and I would like to know if anyone is able to confirm one issue that I'm seeing. Here you have the minimum sketch that I'm using to replicate the issue:
#include <Homie.h>

HomieNode temperatureNode("temperature", "ESH:Temperature");
HomieNode humidityNode("humidity", "ESH:Humidity");
HomieNode relayNode("relay", "ESH:Switch");

void setupHandler() {
  int wait_time = 0;
  delay(wait_time);
  humidityNode.setProperty("unit").send("%");
  delay(wait_time);
  relayNode.setProperty("itemtype").send("Switch");
  delay(wait_time);
  temperatureNode.setProperty("unit").send("ºC");
  delay(wait_time);
  temperatureNode.setProperty("itemtype").send("Number");
  delay(wait_time);
  humidityNode.setProperty("itemtype").send("Number");
  delay(wait_time);
}

void setup() {
  Serial.begin(115200);
  Serial << endl << endl;
  
  Homie_setFirmware("awesome-device", "1.0.0");
  Homie.setSetupFunction(setupHandler);

  temperatureNode.advertise("value");
  temperatureNode.advertise("itemtype");
  temperatureNode.advertise("unit");

  humidityNode.advertise("value");
  humidityNode.advertise("itemtype");
  humidityNode.advertise("unit");

  relayNode.advertise("value");
  relayNode.advertise("itemtype");

  Homie.setup();

}

void loop() {
  Homie.loop();

Nothing strange or complicated, right? Three HomieNodes, 2-3 properties in each node and, as some values are static, I send the properties values in the setupHandler() function.
The problem is that, if I don't insert a wait_time greater than 10ms between the calls, the last (and sometimes even the previous one) message is not send to the broker. In this case it's the HumidityNode's 'itemtype' value, but it's not related to the topic or payload value, because rearranging the calls doesn't change anything: the last value is lost.
I'm using a local mosquitto installation as a broker and I can replicate my issue in both a Raspberry Pi and in my development computer (i5, 8Gb RAM...).
Has anyone seen something like this before? Inserting a 10ms delay time solves the problem, but that's very weird and not a proper solution. Can someone try it at home and confirm the results? @timpur, I would love to hear your opinion, of course ;)
Many thanks as always for your help and support and best regards,
Aitor

Duplicate issue #601: MQTT connection is lost if SSL is enabled and too much data is transferred
Created: 2019-05-02T20:31:52Z
I try to run some ESP8266-12E now with three Homie nodes:

DS18B20Node from Homie node collection
DHT22Node from Homie node collection
AdcNode from Homie node collection

The MQTT connection is SSL encrypted using #577.
After adding the AdcNode the MQTT connection is immediately lost after AdcNode tries to sent its properties. If I remove the AdcNode completely from the code, everything works without any problems.
💡 Firmware esp8266-12e (0.6.4)
🔌 Booting into normal mode 🔌
SSL is: 1
{} Stored configuration
• Hardware device ID: cc50e309ea0b
• Device ID: esp8266-12e
• Name: ESP8266 12E
• Device Stats Interval: 60 sec
• Wi-Fi:
◦ SSID: MySSID
◦ Password not shown
◦ IP: 192.168.x.x
◦ Mask: 255.255.255.0
◦ Gateway: 192.168.x.1
• MQTT:
◦ Host: 192.168.x.y
◦ Port: 1883
◦ SSL enabled: true
◦ Base topic: homie/
◦ Auth? yes
◦ Username: esp8266-12e
◦ Password not shown
• OTA:
◦ Enabled? yes
• Custom settings:
◦ adcCorrect: 0.97 (set)
◦ battMax: 3.30 (default)
◦ battMin: 2.60 (default)
• DS18B20 sensor pin[4]:
◦ Reading interval: 60 s
◦ Found 1 sensors.
• DHT22 sensor pin[13]:
◦ Reading interval: 60 s
• ADC measurement:
◦ Send interval: 300 s
↕ Attempting to connect to Wi-Fi...
✔ Wi-Fi connected, IP: 192.168.x.x
Triggering WIFI_CONNECTED event...
↕ Attempting to connect to MQTT...
Sending initial information...
✔ MQTT ready
Triggering MQTT_READY event...
Calling setup function...
〽 Sending statistics...
• Wi-Fi signal quality: 100%
• Uptime: 5s
• DS18B20 sensor pin[4]:
◦ Temperature: 19.31 °C
• DHT22 sensor pin[13]:
◦ Temperature: 20.10 °C
◦ Humidity: 60.60 %
• ADC measurement:
◦ Voltage: 3.29V
◦ Battery level: 98.33%
✖ MQTT disconnected
Triggering MQTT_DISCONNECTED event...
MQTT disconnected, reason: 0
↕ Attempting to connect to MQTT...
Sending initial information...
✔ MQTT ready
Triggering MQTT_READY event...
〽 Sending statistics...
• Wi-Fi signal quality: 100%
• Uptime: 7s
Prepare to sleep.
Flagged for sleep by sketch
Device in preparation to sleep...
Offline message acknowledged. Disconnecting MQTT...
✖ MQTT disconnected
Triggering MQTT_DISCONNECTED event...
MQTT disconnected, reason: 0
Triggering READY_TO_SLEEP event...
💤 Device is deep sleeping...
✖ Wi-Fi disconnected
Triggering WIFI_DISCONNECTED event...

Closing comment (2019-05-07T12:07:33Z): Maybe related to #515? I commented there