Issue with OTA Firmware Update (deprecated / off topic) #117
-
First of all, I would like to thank you immensely for the wonderful Firebase Arduino Client Library for ESP8266 and ESP32 (version 4.4.14). It has been instrumental in helping me develop many projects. Currently, I'm encountering an issue related to OTA updates from Firebase Storage, and I need your assistance to resolve it urgently as this project is critical and needs to be completed as soon as possible The specific error I receive is: "Download firmware failed, not connected The code runs perfectly until I issue an "update" command from Firebase RTDB. When the command is received, the code enters the OTA update routine but then returns the error mentioned above, indicating "not connected." I'm unable to determine the cause of this error. Could you please help me solve this problem? I've attached my code file for your reference. #include <Arduino.h> // Define Firebase Data object FirebaseAuth auth; bool taskCompleted = false; // added for OTA update to make update to happen one time unsigned long sendDataPrevMillis = 0; void status_reset(); volatile bool dataChanged = false; // Variable to save USER UID #define MCP23017_I2C_ADDRESS1 0x20 // I2C address of the MCP23017 IC ------INPUT IC MCP23017 -----U17 unsigned long number = 0; // const uint8_t PARKING = 8; // GPB0 (1) of the MCP23017----PARKING COMMAND FROM PCB ///////// for (size_t i = 0; i < numChild; i++)
} // Serial.println(); // This is the size of stream payload received (current and max value) // Due to limited of stack memory, do not perform any task that used large memory here especially starting connect to server. void streamTimeoutCallback(bool timeout) if (!stream.httpConnected()) ///////// void setup() Serial.begin(115200);
} /* Assign the api key (required) */ /* Assign the RTDB URL (required) */ /* Assign the callback function for the long running token generation task */ Firebase.reconnectNetwork(true); //fbdo.setResponseSize(4096); // for trial made comment uncomment while testing if require fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 /, 1024 / Tx buffer size in bytes from 512 - 16384 /); // Serial.begin(115200); Serial.println(); Wire.begin(); // Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH); // Configure MCP23017 I/O pins // Reset MCP23017 ports // Getting the user UID might take a few seconds Firebase.RTDB.setString(&fbdo, FIRMWARE_UPDATE_COMMAND, "NO_UPDATE"); if (!Firebase.RTDB.beginMultiPathStream(&stream, parentPath)) Firebase.RTDB.setMultiPathStreamCallback(&stream, streamCallback, streamTimeoutCallback); } /============================ OTA UPDATE CALL BACK FUNCTION ======================/
} void Operation_setup() void configurePinsWithPinMode() mcp23017.pinMode(FO, INPUT); mcp23017_1.pinMode(EQT, INPUT); mcp23017_1.pinMode(FaultAlarm, INPUT);
} if ((mcp23017.digitalRead(S1) == 1) && (mcp23017.digitalRead(S2) == 0) && (mcp23017.digitalRead(S3) == 0) && (mcp23017.digitalRead(S4) == 0) && (mcp23017.digitalRead(S5) == 0) && (mcp23017.digitalRead(S6) == 0) && (floor_access[1] == 1)) // STOP-1 if ((mcp23017.digitalRead(S1) == 0) && (mcp23017.digitalRead(S2) == 1) && (mcp23017.digitalRead(S3) == 0) && (mcp23017.digitalRead(S4) == 0) && (mcp23017.digitalRead(S5) == 0) && (mcp23017.digitalRead(S6) == 0) && (floor_access[2] == 1)) // STOP-2 } if ((mcp23017.digitalRead(NPWT) == 1) && (np_sp_v == 1))
} void SEISMIC() if ((mcp23017_1.digitalRead(EQT) == 0) && (seismic_v == 0)) void DIRECTION() if ((mcp23017.digitalRead(UP) == 1) && (mcp23017.digitalRead(DOWN) == 0) && (up_v == 1)) void FIREMAN_OPERATION() if ((mcp23017.digitalRead(FO) == 1) && (fire_op_v == 1)) void DO_DC() if ((mcp23017.digitalRead(DO) == 0) && (do_dc_v == 0)) if ((mcp23017.digitalRead(DO) == 1) && (do_dc_v == 1)) void FIRE_ALARM_LAMP() if ((mcp23017.digitalRead(FA) == 1) && (fire_lamp_v == 1)) void reset_floor() void Opertaion_Status() if ((mcp23017.digitalRead(ST1) == 0) && (mcp23017.digitalRead(ST2) == 0) && (mcp23017.digitalRead(ST3) == 0) && (status_lift[0] == 1)) // NORMAL OR GROUP if ((mcp23017.digitalRead(ST1) == 1) && (mcp23017.digitalRead(ST2) == 0) && (mcp23017.digitalRead(ST3) == 0) && (status_lift[1] == 1)) // ATTAINDENT
} if ((mcp23017.digitalRead(ST1) == 1) && (mcp23017.digitalRead(ST2) == 1) && (mcp23017.digitalRead(ST3) == 0) && (status_lift[3] == 1)) // INDEPT.
} if ((mcp23017.digitalRead(ST1) == 0) && (mcp23017.digitalRead(ST2) == 0) && (mcp23017.digitalRead(ST3) == 1) && (status_lift[4] == 1)) // PARKING
} if ((mcp23017.digitalRead(ST1) == 1) && (mcp23017.digitalRead(ST2) == 0) && (mcp23017.digitalRead(ST3) == 1) && (status_lift[5] == 1)) // MAINTENANCE
} if ((mcp23017.digitalRead(ST1) == 0) && (mcp23017.digitalRead(ST2) == 1) && (mcp23017.digitalRead(ST3) == 1) && (status_lift[6] == 1)) // ALARM FAULT (#EO)
} if ((mcp23017.digitalRead(ST1) == 1) && (mcp23017.digitalRead(ST2) == 1) && (mcp23017.digitalRead(ST3) == 1) && (status_lift[7] == 1)) // ABNORMAL void status_reset() void Power_operation() if ((mcp23017.digitalRead(EPO) == 0) && (emer_power_v == 0)) void ELEV_OPE_STA(const char *ELEV, const char *ATT, const char *VIP, const char *INDT, const char *PARK, const char *MAINT, const char *FAULT_ALM, const char *ABNORM) void loop() // input_command_from_PC_GUI(); if (Firebase.isTokenExpired()) if (Firebase.ready() && !taskCompleted)
/================================= CHECKING ONCE FIRMWARE UPDATE -- END ==================/ |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 13 replies
-
You are posting in the wrong repo. The library you mentioned is deprecated and not active in development and no more bugs fix. For the error If you use WiFi Manager or reconnect the WiFi with your own code, you have to remove the function You have to check for free memory available which may be too low for the internal SSL client to work. I can't tell the minimum memory that the SSL client and system tasks to work before they fail but you should try to minimize the memory usage in case of memory is concerned. |
Beta Was this translation helpful? Give feedback.
-
You have to know that some ADC ports cannot be used while using WiFi otherwise the WiFi will not work. You should not use delay in your code too because it blocks the server connection. |
Beta Was this translation helpful? Give feedback.
For OTA, the rx buffer size (first parameter) should be 16384.
The tx buffer size can be any, 1024 is recommended.