-
Notifications
You must be signed in to change notification settings - Fork 24
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
OTA update (TZ-201) #24
Comments
Does anyone have any idea how I can fix this? or what is causing this? |
@FHFS Hi, sorry for the delay, I will go on your issue right now.
the timestamp for the first line is 34715ms and the second is 40025ms, it means that after almost 5s sence the last downloaded data from the server. Actually our http client have a default timeout |
No, I am just using a python http server. I will try to follow the guide with openssl, and get back to you.
I've included the logs of the first and second time downloading the OTA file:
Second time:
I don't think so, I've used curl and wget to download the file from multiple devices on the same wifi network and the file is downloaded without a problem. |
For 1. I have tried for almost 20 times, no errors occur and all passed. For 2. for your test scenario, could you please share your whole test step by step? (maybe start from how to build the example and how to set up a http server and copy which file on the server and everythings related to your test environment, the more details the more better) I want to use your step to reproduce this issue. |
I will do a write-up for my scenario. I will get back to you asap. |
Thanks a lot! |
I've followed this guide. It does not seem very comprehensive to me. Lets start with my build setup: Build command: esp-thread-br git commit: 7fd29e7 sdkconfig:
http server called from commandline: https server called from python script: import http.server, ssl, socketserver
context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
context.load_cert_chain("ca_cert.pem","ca_key.pem")
server_address = ("192.168.3.47", 8070)
handler = http.server.SimpleHTTPRequestHandler
with socketserver.TCPServer(server_address, handler) as httpd:
httpd.socket = context.wrap_socket(httpd.socket, server_side=True)
httpd.serve_forever() When generating the pem with: Calling the script with: I can use my browser to go to It does not matter if I use a HTTP or HTTPS server. The result is the same on my esp-thread-br I did the same thing again with a breakpoint on |
Copy that, I will try ASAP. |
Hi, I reproduce this issue, I can investigate this issue now. but it is too hard for me to reproduce it on my side.... |
Great news you were able to reproduce the issue. Why is it hard to reproduce for you? Also you were able to "ota download" without problems, which step in my writeup is different from your setup? |
I'll be focusing on this issue recently and will update as soon as I make progress. |
I have successfully reproduced this issue, it seems it is a problem caused by insufficient storage. # Name, Type, SubType, Offset, Size, Flags
# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
nvs, data, nvs, , 0x6000,
otadata, data, ota, , 0x2000,
phy_init, data, phy, , 0x1000,
ota_0, app, ota_0, , 1500K,
ota_1, app, ota_1, , 1500K,
web_storage,data, spiffs, , 100K,
rcp_fw, data, spiffs, , 820K, After I use this configuration, I can solve the problem of OTA download failure. I hope this helps you. |
I've updated the partition table. Got some overflow and decided to shrink by optimizing for size instead of debug with The download finishes, but I get stuck at the end. These are my logs:
When I restart idf monitor, the esp-thread-br starts up but the image hash is not ok?:
Questions:
|
|
There are some mistakes in my description above, corrected here: I've tried many times on my side, but can't reproduce this problem. However, you can make sure that you copied the correct OTA image to the correct server path. I thought this might be of some help. |
I just tried it again with the br_ota_image I just generated. Same result. I will try this again with a fresh clone of the repository and let you know the results. |
I also tried the same thing with a fresh clone.
|
I meant to say that I got stuck at the same part as before |
Yes, I got it am trying to reproduce the issue. |
I used your config and commit and reproduced the wrong hash. However, the problem of program stuck was not reproduced. After testing, I think it is caused by the macro |
Indeed, when I disable the FLASHSIZE_UPDATE config, the wrong hash does not show. I will try to debug the freezing, maybe I will get some hint about what is causing this. |
When debugging I just hit esp_restart() and then it is stuck. I've searched on esp-idf issues, maybe this issue #9887 is related. In this issue anatol-grabowski mentions creating a task to restart using JustQY mentions @gytxxsy Why do you think I get stuck in esp_restart and you do not? Can you change esp_restart() to a |
We usually don't create a new task to call
I think reproducing the issue locally will help me to find the root reason of this issue. |
I increased the stack of the task to 10240, and now it does continue a little bit further. See log:
|
|
Here the esp32 did restart but the monitor had some problems reattaching or something. I think if you make the task stack size configurable with menuconfig or increase it, we can close this issue. |
@gytxxsy The increased stack size you suggested fixes the issue, how do you suggest we proceed? |
I've tried the configuration you said above, but still can't reproduce the problem. I suggest you use our latest ESP-THREAD-BR Release v1.0-beta to test it (with adding the partitions.csv changes I told you about). Also, do you use the ESP Thread Border Router board v1.2 for test? If you are not using it but other hardware devices, please let me know and I will do analysis from this aspect. Thanks. |
@FHFS In addition, basic_thread_border_router is just an example, so its codes are not unchangeable. If you can solve the current problem by modifying the task stack size, you can modify it directly and continue your development. |
No SDK change required, closing. |
Hello,
I'm trying to do a OTA update on the esp-thread-br. I've enabled
CONFIG_OPENTHREAD_BR_CREATE_OTA_IMAGE
in menuconfig, and the filebr_ota_image
is generated in the build folder.I'm serving through a python http server with:
python -m http.server -b 192.168.3.47 8070
However when I call
ota download http://192.168.3.47:8070/br_ota_image
on the esp-thread-br, I get an error. Does else have this problem?I've tried multiple times, it only downloads the first time after an erase. Is it a flash issue?
The text was updated successfully, but these errors were encountered: