Version 1.42
Fixed bug with ESP-NOW devices not getting restart or update command. Minor main code refactoring.
This commit is contained in:
		| @@ -193,12 +193,12 @@ void setup() | |||||||
|  |  | ||||||
| void loop() | void loop() | ||||||
| { | { | ||||||
|     if (mqttAvailabilityCheckTimerSemaphore) |  | ||||||
|         checkMqttAvailability(); |  | ||||||
|     if (keepAliveMessageTimerSemaphore) |     if (keepAliveMessageTimerSemaphore) | ||||||
|         sendKeepAliveMessage(); |         sendKeepAliveMessage(); | ||||||
|     if (attributesMessageTimerSemaphore) |     if (attributesMessageTimerSemaphore) | ||||||
|         sendAttributesMessage(); |         sendAttributesMessage(); | ||||||
|  |     if (mqttAvailabilityCheckTimerSemaphore) | ||||||
|  |         checkMqttAvailability(); | ||||||
|     if (workMode == ESP_NOW_WIFI) |     if (workMode == ESP_NOW_WIFI) | ||||||
|         mqttWifiClient.loop(); |         mqttWifiClient.loop(); | ||||||
|     if (workMode == ESP_NOW_LAN) |     if (workMode == ESP_NOW_LAN) | ||||||
| @@ -679,6 +679,8 @@ void checkMqttAvailability() | |||||||
|                     mqttWifiClient.subscribe((topicPrefix + "/espnow_led/#").c_str()); |                     mqttWifiClient.subscribe((topicPrefix + "/espnow_led/#").c_str()); | ||||||
|  |  | ||||||
|                     sendConfigMessage(); |                     sendConfigMessage(); | ||||||
|  |                     sendAttributesMessage(); | ||||||
|  |                     sendKeepAliveMessage(); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|  |  | ||||||
| @@ -696,6 +698,8 @@ void checkMqttAvailability() | |||||||
|                     mqttEthClient.subscribe((topicPrefix + "/espnow_led/#").c_str()); |                     mqttEthClient.subscribe((topicPrefix + "/espnow_led/#").c_str()); | ||||||
|  |  | ||||||
|                     sendConfigMessage(); |                     sendConfigMessage(); | ||||||
|  |                     sendAttributesMessage(); | ||||||
|  |                     sendKeepAliveMessage(); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user