mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 22:52:19 +03:00
Fix ошибок и под esp8266
This commit is contained in:
@@ -42,7 +42,8 @@ public:
|
||||
HTTPClient http;
|
||||
|
||||
#if defined ESP8266
|
||||
if (!http.begin(_host, 80, _url))
|
||||
WiFiClient client;
|
||||
if (!http.begin(client, _host, 80, _url))
|
||||
{
|
||||
// Serial.println("connection failed");
|
||||
SerialPrint("I", F("NextionUpdate"), "connection failed ");
|
||||
@@ -118,7 +119,13 @@ public:
|
||||
int contentLength = http.getSize();
|
||||
SerialPrint("I", F("NextionUpdate"), "File received. Update Nextion... ");
|
||||
bool result;
|
||||
ESPNexUpload nextion(115200, _NEXT_RX, _NEXT_TX);
|
||||
#ifdef ESP8266
|
||||
ESPNexUpload nextion(115200, -1, _NEXT_RX, _NEXT_TX);
|
||||
#elif defined(esp32c3m_4mb) || defined(esp32s2_4mb)
|
||||
ESPNexUpload nextion(115200, 1, _NEXT_RX, _NEXT_TX);
|
||||
#else
|
||||
ESPNexUpload nextion(115200, 2, _NEXT_RX, _NEXT_TX);
|
||||
#endif
|
||||
nextion.setUpdateProgressCallback([]()
|
||||
{ SerialPrint("I", F("NextionUpdate"), "... "); });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user