-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ESP8266WebServer, WiFiClientSecure and https #2075
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
Having ESP8266WebServer and HTTPS client and the same time likely means you are going to run out of memory. |
Looks like I have the same:
The stack point to a number of https stuff:
|
Yes, your stack trace also indicates that you are running out of RAM, or the heap is getting fragmented. |
It's 'clearly' related to https, doing the same on http just runs fine for hours.
|
This is related to the fact that TLS needs plenty of RAM, whereas plaintext transport (one used for HTTP)ndoesnt need any |
Might some kind of (fixed) reservation of that large amount or RAM be an option? |
Running in the same issue here, that there is insufficient RAM for both to be used at the same time. Any suggested solutions? |
how much ram does it need anyway? |
When I tested TLS on the ESP, I could manage to do basic requests with not much data in the response. I got some sort of TLS server to run as well, but again with not much more content than a couple of packets. Everything above that requires more ram than we have. If you have more stuff going on in your sketch, chances are that that costs you RAM already so running TLS is even harder |
I'm probably only need to send & receive < 0.5kb of data... :-/
|
Hello, I am running in the same problem. Anyone found a way to solve this? Paolo |
Got a (not ideal) solution running both. I dynamically create both using new and delete. In setup() I create a webServer = new ESP8266WebServer(80); In loop() when I need the httpClient, I delete webServer, call a function that has httpClient as a local variable, and recreate the webServer after the call. It works, but the disadvantage is that I client sometimes can not connect, because the web server is not present. |
A TLS server transaction requires just under 20KB of RAM. |
Basic Infos
Hardware
Hardware: ESP-12e
Core Version: not sure
Description
Problem description
I set up a json api: https://toothfi.com/device/device/abc/get_fake_device_info
I follow this sample code: https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino
and make my own version:
https://github.com/kenpeter/arduino_https_request
The real problem is:
In https_request.ino, if I comment out "ESP8266WebServer g_web_server(80);" in line 18. The code is working. If I leave "ESP8266WebServer g_web_server(80);", the error is
I am not sure what the errors mean.
Settings in IDE
Module: nodemcu 1.0
Flash Size: 4MB
CPU Frequency: 160Mhz
Flash Mode: ?
Flash Frequency: ?
Upload Using: SERIAL
Reset Method: ?
Full Sketch to have a look
https://github.com/kenpeter/arduino_https_request
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: