{"action":"created","issue":{"url":"https://api.github.com/repos/espressif/arduino-esp32/issues/2175","repository_url":"https://api.github.com/repos/espressif/arduino-esp32","labels_url":"https://api.github.com/repos/espressif/arduino-esp32/issues/2175/labels{/name}","comments_url":"https://api.github.com/repos/espressif/arduino-esp32/issues/2175/comments","events_url":"https://api.github.com/repos/espressif/arduino-esp32/issues/2175/events","html_url":"https://github.com/espressif/arduino-esp32/issues/2175","id":389361324,"node_id":"MDU6SXNzdWUzODkzNjEzMjQ=","number":2175,"title":"HTTPS failure with low free heap memory?","user":{"login":"fabiuz7","id":7937648,"node_id":"MDQ6VXNlcjc5Mzc2NDg=","avatar_url":"https://avatars3.githubusercontent.com/u/7937648?v=4","gravatar_id":"","url":"https://api.github.com/users/fabiuz7","html_url":"https://github.com/fabiuz7","followers_url":"https://api.github.com/users/fabiuz7/followers","following_url":"https://api.github.com/users/fabiuz7/following{/other_user}","gists_url":"https://api.github.com/users/fabiuz7/gists{/gist_id}","starred_url":"https://api.github.com/users/fabiuz7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabiuz7/subscriptions","organizations_url":"https://api.github.com/users/fabiuz7/orgs","repos_url":"https://api.github.com/users/fabiuz7/repos","events_url":"https://api.github.com/users/fabiuz7/events{/privacy}","received_events_url":"https://api.github.com/users/fabiuz7/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-12-10T15:45:39Z","updated_at":"2018-12-16T17:16:32Z","closed_at":null,"author_association":"NONE","body":"### Hardware:\r\nBoard:\t\t\t\t\t\t\tLolin D32\r\nCore Installation/update date:\tcommit: 884e417a4943ae64897fc06db47915f24c00b59a 06/dec/2018\r\nIDE name:\t\t\t\t\t\t\tArduino IDE\r\nFlash Frequency:\t\t\t\t\t40Mhz\r\nPSRAM enabled:                                          no\r\nUpload Speed:\t\t\t\t\t\t921600\r\nComputer OS:                                            Windows 10\r\n\r\n### Description:\r\n I was testing the HTTPS functionality and it works perfectly. Last week I've added the BLE library, but it cause the failure of HTTPS calls. Actually Bluetooth is just instantiated BLEDevice::init(\"\"); and never used, but it seems enough to make fail https calls. I think that the problem is the huge amount of ram stole by BLE library, but I'm not so confident about that.\r\n\r\nThis is what I get on serial port and it represent the common behaviour, everything works fine (even if there is that socket error) , you can see the huge (normal) amount of free heap:\r\n```\r\n[HTTPS] sending POST to myUrlAddress ...\r\nFree Heap: 169876\r\n[D][HTTPClient.cpp:265] beginInternal(): host: myHostAddress port: 443 url: myUrl\r\n[E][WiFiClient.cpp:236] setSocketOption(): 1006 : 9\r\n[I][ssl_client.cpp:151] start_ssl_client(): WARNING: Use certificates for a more secure communication!\r\n[D][HTTPClient.cpp:977] connect():  connected to myHostAddress:443\r\n[D][HTTPClient.cpp:1102] handleHeaderResponse(): code: 200\r\n[D][HTTPClient.cpp:1105] handleHeaderResponse(): size: 45\r\n[HTTPS] POST... code: 200\r\n[D][HTTPClient.cpp:1239] writeToStreamDataBlock(): connection closed or file end (written: 45).\r\n[D][HTTPClient.cpp:358] disconnect(): tcp stop\r\n\r\n===========\r\n{\"content\":null,\"message\":null,\"result\":\"OK\"}\r\n===========\r\n[HTTPS] end\r\n[D][HTTPClient.cpp:369] disconnect(): tcp is closed\r\n```\r\n\r\nThis is what I get when BLE is initialized (NOTE low free heap quantity):\r\n```\r\n[HTTPS] sending POST to myUrlAddress ...\r\nFree Heap: 44952\r\n[D][HTTPClient.cpp:265] beginInternal(): host: myHostAddress port: 443 url: myUrl\r\n[E][WiFiClient.cpp:236] setSocketOption(): 1006 : 9\r\n[I][ssl_client.cpp:151] start_ssl_client(): WARNING: Use certificates for a more secure communication!\r\n[E][ssl_client.cpp:33] handle_error(): SSL - Memory allocation failed\r\n[E][ssl_client.cpp:35] handle_error(): MbedTLS message code: -32512\r\n[E][WiFiClientSecure.cpp:118] connect(): start_ssl_client: -32512\r\n[D][HTTPClient.cpp:973] connect(): failed connect to myHostAddress:443\r\n[W][HTTPClient.cpp:1262] returnError(): error(-1): connection refused\r\n[HTTPS] POST... failed, error: connection refused\r\n[HTTPS] end\r\n[D][HTTPClient.cpp:369] disconnect(): tcp is closed\r\n\r\n```\r\nMy questions are:\r\n- are there tricks to save RAM memory taken by ble library?\r\n- how many bytes takes an HTTPS call? Does it depends on message size?"},"comment":{"url":"https://api.github.com/repos/espressif/arduino-esp32/issues/comments/447659941","html_url":"https://github.com/espressif/arduino-esp32/issues/2175#issuecomment-447659941","issue_url":"https://api.github.com/repos/espressif/arduino-esp32/issues/2175","id":447659941,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NzY1OTk0MQ==","user":{"login":"chegewara","id":1406020,"node_id":"MDQ6VXNlcjE0MDYwMjA=","avatar_url":"https://avatars1.githubusercontent.com/u/1406020?v=4","gravatar_id":"","url":"https://api.github.com/users/chegewara","html_url":"https://github.com/chegewara","followers_url":"https://api.github.com/users/chegewara/followers","following_url":"https://api.github.com/users/chegewara/following{/other_user}","gists_url":"https://api.github.com/users/chegewara/gists{/gist_id}","starred_url":"https://api.github.com/users/chegewara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chegewara/subscriptions","organizations_url":"https://api.github.com/users/chegewara/orgs","repos_url":"https://api.github.com/users/chegewara/repos","events_url":"https://api.github.com/users/chegewara/events{/privacy}","received_events_url":"https://api.github.com/users/chegewara/received_events","type":"User","site_admin":false},"created_at":"2018-12-16T17:16:32Z","updated_at":"2018-12-16T17:16:32Z","author_association":"NONE","body":"@czuvich Could you try revert order, first https calls and then ble?"}}
{"actor":{"display_login":"chegewara"}}