diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index 23ee2a27d..d9453e3c4 100755 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -2037,7 +2037,12 @@ void Every250mSeconds() #endif // BE_MINIMAL snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_UPLOAD "%s"), mqtt_data); AddLog(LOG_LEVEL_DEBUG); +#if defined(ARDUINO_ESP8266_RELEASE_2_3_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_1) || defined(ARDUINO_ESP8266_RELEASE_2_4_2) ota_result = (HTTP_UPDATE_FAILED != ESPhttpUpdate.update(mqtt_data)); +#else + // If using core stage or 2.5.0+ the syntax has changed + ota_result = (HTTP_UPDATE_FAILED != ESPhttpUpdate.update(EspClient, mqtt_data)); +#endif if (!ota_result) { #ifndef BE_MINIMAL int ota_error = ESPhttpUpdate.getLastError();