Chat freely about anything...

User avatar
By ftheirs
#50169 Hi everyone!

I tried to run BasicOTA in Arduino and Platformio but it doesn't work :/ I'll explain my problem.

The code compiles without errors and I can upgrade it via UART. The second time, when I'm trying to upload the code via WiFi, I receive this error: [ERROR]: No response from device in my IDE and the UART throws Error[1]: Begin Failed.

I can't figure it out what I'm doing wrong. In every tutorial I have found, the steps are the same and I can upgrade successfully the firmware via UART.

What I really need is only one bootloader and one application. At the beginning , the bootloader should check if there is an update, and if there isn't, just continue to the application. The part of writing the flash wouldn't be a problem but I don't know how should I split the code. I mean, how do I jump from bootloader to the application in the flash and that. The code of my application should be a new project or how should I manage that?

Any help in one or both questions would be really really appreciated.
Many thanks!
User avatar
By ftheirs
#50191
martinayotte wrote:Which kind of ESP modules do you have ?
What is the Flash size ? (because OTA doesn't work with 512K size)
Do you have ArduinoOTA.handle() call in the loop() ?


I'm using ESP8266-07 and if I'm not wrong it has 4MB of flash memory. Yes, I copy the example as is and the first time via UART it works ok but the second time there is that problem when it tries to begin the OTA.

Maybe the problem is the flash's size. The function "ESP.getFlashChipSize()" returns a "4194304". Isn't that 4 megabytes?
User avatar
By martinayotte
#50196 I don't if all current ESP-07 have 4MB, but in the old days, such last year, they were still have only 512KB.
ESP.getFlashChipSize() return what you have choosen in ArduinoIDE, what ever the real actual size is reality.
You should looks what ESP.getFlashChipId() returns and/or ESP.getFlashChipSizeByChipId() to get the truth.
IDs such 0x1340EF or 0x1340E0 are only 512KB.

BTW, if you got 1MB size, you can use OTA, but it is important that size choosen in the IDE match, otherwise OTA will be tried at the wrong address, therefore will fail too.