-
Notifications
You must be signed in to change notification settings - Fork 13.3k
OTA only works the first time #4831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I am experiencing something similar.
|
@marcvtew not the same. After flashing over serial you have to physically reset the esp before doing OTA. This is a known issue for which there is no known fix or workaround. |
@devyte @hasiflo Try an esp8266 with 4 Mb flash and see if your problem still exists. |
I have tested ESPhttpUpdate with a more elaborate piece of code and now i am experiencing a locked up esp8266 (no update either) using: latest git version 2.4.1 + deepsleep() + ESPhttpUpdate Core version 2.3.0 + deepsleep() + ESPhttpUpdate works for me. |
Finally figured out what was going on. Nothing to do with ESPhttpUpdate (no reboot after update). Not rebooting seems to be related to max sleeptime for deepsleep(). I used to sleep the module for 3600000000 microseconds without any problem. With latest git version of master branch this seems to long and the esp8266 does not recover from deepsleep. I think it has to do with sdk 2.1.0 and the modifications made to git master branch. |
@marcvtew That is correct. There is a function in the ESPClass that tells you how long you can (theoretically) sleep. It is a direct implementation of Espressif's SDK documentation. |
@devyte I overlooked max sleeptime. Sleeptime has indeed been extended (max around 3.5 hours). Only drawback: sleeping for more than max sleeptime leaves esp8266 in an unresponsive state without any warning (sketch compiles without errors). |
@marcvtew that is correct, and is a direct reflection of how the sdk works. I suppose some error handling could be implemented on our end, e.g. error out if attempt to sleep for longer than maxsleeptime. Want to make a PR with that? |
Closing as can't reproduce per @marcvtew . Thanks! |
@devyte Maybe adapting deepSleep class like this?
|
You can't generate a compile time warning based on a runtime condition. I suggest changing the return type, and if the max is exceeded, return an error. It will be up to the user to check that a sleep didn't fail. |
Changed return type to bool:
|
Hello everyone, I am encountering an issue with OTA updates on my custom-designed PCB. When I load the code via OTA for the first time, it uploads successfully. However, when I try to upload the code a second time, the update is restricted, and no changes are reflected. Interestingly, this issue does not occur when using a DevKit; the changes are updated and reflected every time without any problems. Thank you! |
Basic Infos
Platform
Settings in IDE
Problem Description
I use ESP8266httpUpdate.h for updating the code on an ESP8266 with 1M (no spiffs).
Code Size:
Sketch uses 339,333 bytes (33%) of program storage space. Maximum is 1,023,984 bytes. Global variables use 36,168 bytes (44%) of dynamic memory, leaving 45,752 bytes for local variables. Maximum is 81,920 bytes.
So the problem is, I can update over the air only once and all is good.
But if I try a second update (the same code and size), I get the error 'not enough space'.
Is it possible, that the old programm will not be removed?
Can I manually clean the space between the actual programm and SPIFFS?
Is it enough, if the programm is less than 50% of the memory-size (in case of no spiffs) or how many space has to be free?
The text was updated successfully, but these errors were encountered: