{"action":"created","issue":{"url":"https://api.github.com/repos/carsonmcdonald/esp32-aws-iot/issues/2","repository_url":"https://api.github.com/repos/carsonmcdonald/esp32-aws-iot","labels_url":"https://api.github.com/repos/carsonmcdonald/esp32-aws-iot/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/carsonmcdonald/esp32-aws-iot/issues/2/comments","events_url":"https://api.github.com/repos/carsonmcdonald/esp32-aws-iot/issues/2/events","html_url":"https://github.com/carsonmcdonald/esp32-aws-iot/issues/2","id":194266157,"number":2,"title":"Bluefi + AWS IoT","user":{"login":"seopyoon","id":8359372,"avatar_url":"https://avatars.githubusercontent.com/u/8359372?v=3","gravatar_id":"","url":"https://api.github.com/users/seopyoon","html_url":"https://github.com/seopyoon","followers_url":"https://api.github.com/users/seopyoon/followers","following_url":"https://api.github.com/users/seopyoon/following{/other_user}","gists_url":"https://api.github.com/users/seopyoon/gists{/gist_id}","starred_url":"https://api.github.com/users/seopyoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seopyoon/subscriptions","organizations_url":"https://api.github.com/users/seopyoon/orgs","repos_url":"https://api.github.com/users/seopyoon/repos","events_url":"https://api.github.com/users/seopyoon/events{/privacy}","received_events_url":"https://api.github.com/users/seopyoon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-12-08T07:32:04Z","updated_at":"2016-12-14T14:19:34Z","closed_at":null,"body":"The scenario is that the user would provide WiFi connection information via BLE connection in the beginning.  So I started off from the Bluefi example provided in the esp-idf/examples folder.  \r\n\r\nAWS IoT project from this works perfectly well, and the Bluefi example also works without any problem.  But when merged together, I get error connecting to AWS IoT.  \r\n\r\nThe error looks as follows: \r\n```Connecting...\r\n\r\nDEBUG:   iot_tls_connect L#129 \r\n  . Seeding the random number generator...\r\nDEBUG:   iot_tls_connect L#137   . Loading the CA root certificate ...\r\nDEBUG:   iot_tls_connect L#143  ok (0 skipped)\r\n\r\nDEBUG:   iot_tls_connect L#145   . Loading the client cert. and key...\r\nDEBUG:   iot_tls_connect L#158  ok\r\n\r\nDEBUG:   iot_tls_connect L#160   . Connecting to (my_address).iot.ap-northeast-2.amazonaws.com/8883...\r\nDEBUG:   iot_tls_connect L#179  ok\r\n\r\nDEBUG:   iot_tls_connect L#181   . Setting up the SSL/TLS structure...\r\nERROR: iot_tls_connect L#206  failed\r\n  ! mbedtls_ssl_setup returned -0x7f00\r\n\r\n\r\nERROR: aws_iot_mqtt_task L#221 Error connecting to (my_address).iot.ap-northeast-2.amazonaws.com:8883, err = -4\r\n```\r\nWhen looking at the source code, mbedtls_ssl_setup returning 0x7f00 means 'memory allocation failed'. ([link](https://tls.mbed.org/api/ssl_8h.html#a701ee611f7a16a261b306466c8602177))\r\n\r\nThe Bluefi example, also utilises the use of compression while making.  To match the original esp32-aws-iot project, I disabled it, for I thought that may cause problem.  \r\n\r\nPlease help me resolve issue.  I am thinking, perhaps, it is related to memory overwriting? Since using both Bluetooth and WiFi requires too large of a stack size?\r\nThanks a lot in advance."},"comment":{"url":"https://api.github.com/repos/carsonmcdonald/esp32-aws-iot/issues/comments/267044966","html_url":"https://github.com/carsonmcdonald/esp32-aws-iot/issues/2#issuecomment-267044966","issue_url":"https://api.github.com/repos/carsonmcdonald/esp32-aws-iot/issues/2","id":267044966,"user":{"login":"seopyoon","id":8359372,"avatar_url":"https://avatars.githubusercontent.com/u/8359372?v=3","gravatar_id":"","url":"https://api.github.com/users/seopyoon","html_url":"https://github.com/seopyoon","followers_url":"https://api.github.com/users/seopyoon/followers","following_url":"https://api.github.com/users/seopyoon/following{/other_user}","gists_url":"https://api.github.com/users/seopyoon/gists{/gist_id}","starred_url":"https://api.github.com/users/seopyoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seopyoon/subscriptions","organizations_url":"https://api.github.com/users/seopyoon/orgs","repos_url":"https://api.github.com/users/seopyoon/repos","events_url":"https://api.github.com/users/seopyoon/events{/privacy}","received_events_url":"https://api.github.com/users/seopyoon/received_events","type":"User","site_admin":false},"created_at":"2016-12-14T14:19:33Z","updated_at":"2016-12-14T14:19:33Z","body":"@carsonmcdonald ah ha, I wish you luck with figuring it out what exactly is causing problem, and what fixes it.  Though you stated that using sdkconfig from blufi fixed the problem, I think otherwise.  I tried starting off from esp-aws-iot and adding blufi stuff, and I have tried the otherway round too, starting from blufi, and then adding esp-aws-iot.  So, I speculate it may have been fixed from some other reasons.  Again, thank you lots for spending your time in fixing this; I shall give it a try again sometime tomorrow when I have time.  The part that got me lost is when it does transfer_context stuff.  No idea what that part does.  (I am referring to blufi_task.c)\r\n\r\nThis may be off-topic, but do you know how large the system gets when we enable both bluetooth stack AND wifi stack?  Does it leave us with only a little bit for application?  Or the size is minimal and I should not be worried about it."}}
{"actor":{"display_login":"seopyoon"}}