-
Notifications
You must be signed in to change notification settings - Fork 83
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
immediate uncalled reset at ussl.wrap_socket #6
Comments
To be honest, my only guess is #1. I have never tried it on an ESP8266. |
My esp8266 is also stopping downloading on
I needed to split the ota_updater.py in 2 files because of memory problems importing all at once. |
Looks like memory is indeed the problem for esp8266 devices. |
I tried with the older firmware version |
Caused by upstream issue: micropython/micropython#6737 |
The workaround version is also running into memory problems. But not the OSError -40
|
When moving the ota_updater file (which is big and not needed to update) to another dir. Probably this file to big to load into memory. When I change the github reference to only small files I'm getting the following coding error:
|
There are much more problems with it... To be honest, I'm having doubts
about the stability of micropython on ESP8266.
- SSL errors
- Random resets
- ...
Did the previous version work on Esp8266? I almost can't believe it...
…On Sun, Dec 27, 2020, 14:32 Hans ***@***.***> wrote:
The workaround version is also running into memory problems. But not the
OSError -40
Memory free 34256
network config: ('10.0.0.75', '255.255.255.0', '10.0.0.1', '10.0.0.1')
(2, 1, 0, '', ('140.82.121.6', 443))
Checking version...
Current version: 0.0
Latest version: 0.5.4
Updating to version 0.5.4...
Downloading version 0.5.4https://api.github.com/repos/rdehuyss/micropython-ota-updater/contents/app
(2, 1, 0, '', ('140.82.121.6', 443))
Traceback (most recent call last):
File "main.py", line 29, in <module>
File "main.py", line 18, in connectToWifiAndUpdate
File "app/ota_updater.py", line 81, in install_update_if_available
File "app/ota_updater.py", line 132, in _download_new_version
File "app/ota_updater.py", line 140, in _download_all_files
File "app/httpclient.py", line 43, in json
File "app/httpclient.py", line 32, in content
MemoryError: memory allocation failed, allocating 3328 bytes
MicroPython v1.13 on 2020-09-11; ESP module with ESP8266
Type "help()" for more information.
>>>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEKUITZVP3QTDICXFXOCN3SW4ZQVANCNFSM4NLHBOYQ>
.
|
It just have updated... I will test it with my own repo. |
I think we are close. The code is downloading, creating the next folder, copy the secrets... But my downloaded file (app/start.py) is overwritten with an error message instead of the downloaded code: |
FYI - I may have a breakthrough. Need to do some family-related stuff though. I'll continue later on! |
I pushed my WIP |
Sure, no problem, family-related stuff is very important. Now all files are overwritten with html code:
|
My full log including your debug printouts.
|
After 8 hours of debugging, sniffing SSL traffick (which was not easy), ... I found out that the reason we're getting a 403 (the cloudflare error), is also related due to SSL handshakes not working out. I added a note on the README.md specifying that the ESP8266 is currently not supported 😞 . I created an issue in the MicroPython core (see micropython/micropython#6737) - let's see if they are able to solve it and if so, I can pick this up again. |
I found some more info here: https://forum.micropython.org/viewtopic.php?t=10437&p=57759 The issue seems to be that certain certificate types are not supported in axtls. So to test it I applied the patch linked there (see it below) and compiled it into the ESP8266 firmware: https://github.com/micropython/micropython/pull/6433/files Here is same changes in patch file format: https://gist.github.com/cpdeethree/6c293ed7b78f8e5aeba27cfcfeb14877 And it worked. So it does seem to be problem with axtls library and switching to mbedtls fixes the issue. However, as noted in the link and the issue, the above patch is a hack. My ESP8266 hangs for about 7-8 seconds trying to call that library for every HTTP request, and I have to call gc.mem_free() in between calls. So it's not ideal and probably shouldn't be considered anything other than a way to demonstrate that axtls is the issue. |
Wauw, thanks for this indepth analysis. |
Any updates on this? Was the issue solved, or there will be no OTA updates for ESP8266 devices forever? |
@grafalex82 you could do the hack I mentioned - though it's not really something that I would trust in production - or if your SSL site happens to not be of the wrong format (it seems to be only specific cert types) that causes this issue it seems to be OK as well. The issue really isn't with micropython-ota-updater (or really even micropython, though they could switch to a different library) but rather that the ESP8266 hardware seems like it can't really compute the cipher for these cert types in a reasonable amount of time with the available libraries in their current form. Perhaps some other library other than the two mentioned would be able to do it but I'm not really aware of what's available in that area. You'll probably get a better answer if you search for/open issues upstream of this project in either micropython or axtls |
ok, thank you. |
i worked though it for quite some hours, and have no clue why it happens.
but i can for sure say that in line 207 where code is like "s = ussl.wrap_socket(s, server_hostname=host)". hostname is of course "api.github.com" at runtime.
on my 8266 devboard an immediate reset is happening.
no exception is catched in exept OSError.
i erased and flashed new 1.12 micopython firmware. sill happening.
my code is pretty small, just doing a POC.
what could i be ding wrong?
The text was updated successfully, but these errors were encountered: