espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.51k stars 7.26k forks source link

[TW#19695] Smart config example fails to connect to wlan #1774

Closed eflukx closed 6 years ago

eflukx commented 6 years ago

The smart_config example (using esp-idf commit 8478823) runs and install fine. The correct SSID and PASSWORD is received, but after that connecting to wlan seems to fail with output below. I tried it on two ESP32 modules, both have same result. (The simple_wifi example works fine on both modules.)

I (305) cpu_start: Pro cpu up.
I (308) cpu_start: Starting app cpu, entry point is 0x40080f74
0x40080f74: call_start_cpu1 at /home/eflukx/code/esp32/esp-idf/components/esp32/./cpu_start.c:225

I (0) cpu_start: App cpu up.
I (319) heap_init: Initializing. RAM available for dynamic allocation:
I (326) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (332) heap_init: At 3FFB9090 len 00026F70 (155 KiB): DRAM
I (338) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (344) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (351) heap_init: At 4008E858 len 000117A8 (69 KiB): IRAM
I (357) cpu_start: Pro cpu start user code
I (151) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (194) wifi: wifi firmware version: c202b34
I (194) wifi: config NVS flash: enabled
I (194) wifi: config nano formating: disabled
I (194) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (204) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (224) wifi: Init dynamic tx buffer num: 32
I (224) wifi: Init data frame dynamic rx buffer num: 32
I (224) wifi: Init management frame dynamic rx buffer num: 32
I (224) wifi: Init static tx buffer num: 16
I (234) wifi: wifi driver task: 3ffc7018, prio:23, stack:4096
I (234) wifi: Init static rx buffer num: 10
I (244) wifi: Init dynamic rx buffer num: 32
I (244) wifi: wifi power manager task: 0x3ffcbc58 prio: 21 stack: 2560
I (314) phy: phy_version: 383.0, 79a622c, Jan 30 2018, 15:38:06, 0, 0
I (314) wifi: mode : sta (24:0a:c4:8d:e6:58)
I (364) smartconfig: SC version: V2.7.1
I (5184) wifi: ic_enable_sniffer
I (5184) sc: SC_STATUS_FINDING_CHANNEL
I (6294) smartconfig: TYPE: ESPTOUCH
I (6294) smartconfig: T|AP MAC: d8:50:e6:88:88:88
I (6294) sc: SC_STATUS_GETTING_SSID_PSWD
I (7944) smartconfig: T|pswd: m************t
I (7944) smartconfig: T|ssid: i********Q
I (7944) smartconfig: T|bssid: d8:50:e6:88:88:88
I (7944) wifi: ic_disable_sniffer
I (7944) sc: SC_STATUS_LINK
I (7954) sc: SSID:i********Q
I (7954) sc: PASSWORD:m************t
W (7974) wifi: lmac stop, discard packet
I (8094) wifi: n:4 0, o:1 0, ap:255 255, sta:4 0, prof:1
I (8744) wifi: state: init -> auth (b0)
W (8754) wifi: lmac stop, discard packet
I (9754) wifi: state: auth -> init (2)
I (9754) wifi: n:4 0, o:4 0, ap:255 255, sta:4 0, prof:1
W (9754) wifi: lmac stop, discard packet
I (9874) wifi: n:4 0, o:4 0, ap:255 255, sta:4 0, prof:1
I (9874) wifi: state: init -> auth (b0)
W (9874) wifi: lmac stop, discard packet
I (10874) wifi: state: auth -> init (2)
I (10874) wifi: n:4 0, o:4 0, ap:255 255, sta:4 0, prof:1
W (10874) wifi: lmac stop, discard packet
I (10994) wifi: n:4 0, o:4 0, ap:255 255, sta:4 0, prof:1
I (10994) wifi: state: init -> auth (b0)
W (10994) wifi: lmac stop, discard packet

**snip** (--etc etc etc--)
TimXia commented 6 years ago

@eflukx This is a bug. We have found the root cause and will fix it this week.

eflukx commented 6 years ago

@TimXia Thanks for the feedback! Please post the commit nr that includes the fix, interested to see what was wrong πŸ˜ƒ

perll commented 6 years ago

@eflukx Sr, is that bug fixed? Regards.

TimXia commented 6 years ago

@eflukx @perll The bugfix is merging. Due to the gitlab server is maintaining this weekend, it will be merged next monday.

perll commented 6 years ago

Hi, @eflukx !!!

thank you a ton, sir! I'm will check.

I've beem work on a app that is a mix from GATT_CLIENTE, HTT_REQUEST and wifi SMART_CONFIG.

My goal is scan for beacons and send them by web to a web server. It is working now bot woth a lot of memory fail. Eg:

ERROR A stack overflow in task Guru Meditation Error: Core 0 panic'ed (StoreProhibited ERROR A stack overflow in task flash/src/nvs_page.cpp has been detected.

Best regards!!!

perll commented 6 years ago

Guru Meditation Error: Core 1 panic'ed (StoreProhibited) . Exception was unhandled. Core 1 register dump: PC : 0x4008f22e PS : 0x00050033 A0 : 0x4008f137 A1 : 0x3ffd4860
0x4008f22e: vPortYieldFromInt at /home/xxxxxxxxx/esp/esp-idf/components/freertos/./portasm.S:595

0x4008f137: _frxt_int_exit at /home/xxxxxxxxx/esp/esp-idf/components/freertos/./portasm.S:206

A2 : 0x0d4ab040 A3 : 0x00000000 A4 : 0x00000212 A5 : 0x3ffc0be0
A6 : 0x00000001 A7 : 0x80000001 A8 : 0x40082509 A9 : 0x00000001
0x40082509: _xt_lowint1 at /home/xxxxxxxx/esp/esp-idf/components/freertos/./xtensa_vectors.S:1098

A10 : 0x00060021 A11 : 0x00000000 A12 : 0x8008d47a A13 : 0x3ffc0bd0
A14 : 0x3ffc0c18 A15 : 0x00000001 SAR : 0x00000013 EXCCAUSE: 0x0000001d
EXCVADDR: 0x0d4ab040 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000

Backtrace: 0x4008f22e:0x3ffd4860 0x4008f134:0x3ffd4870 0x4008f22e: vPortYieldFromInt at /home/xxxxxxxxxx/esp/esp-idf/components/freertos/./portasm.S:595

0x4008f134: _frxt_int_exit at /home/xxxxxxxxx/esp/esp-idf/components/freertos/./portasm.S:205

TimXia commented 6 years ago

@eflukx The bug has been fixed in the latest IDF master branch. Please check it.

TimXia commented 6 years ago

@perll We do not recommend that HTTP_REQUEST and SMART_CONFIG work together. Better to use HTTP_REQUEST and esp_wifi_scan() to scan for beacon and send them by web.

eflukx commented 6 years ago

@perll Thanks, I will check it out. Closing the issue.

perll commented 6 years ago

OK!

I will test and return you.

Regards,

Raimundo

On Mon, Apr 2, 2018 at 11:44 PM, TimXia notifications@github.com wrote:

@eflukx https://github.com/eflukx The bug has been fixed in the latest IDF master branch. Please check it.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/espressif/esp-idf/issues/1774#issuecomment-378110732, or mute the thread https://github.com/notifications/unsubscribe-auth/ALo6NeesZGqA6hFJ44T5nk7RxHhgFzewks5tkuIVgaJpZM4S7C7o .

perll commented 6 years ago

Preliminary. until yesterday, after a few minutes running, the log already showed memory errors. Today, after upgrading with the master, 30 minutes later and no memory errors. Continuing with the tests! @TimXia , TKU a ton!!!!

perll commented 6 years ago

After get the new master (3.0), the heap memory issues was solved in my code but, now, with HTTP_REQUEST example, I'm getting: I (2140007) event: station ip lost. After few minutes running. I've ran in four esp roow32, 5.1V 850mA; 5.1V 700mA; USB; 5V 1000mA. All whit the same resuult error: I (2140007) event: station ip lost. If I get a downgrade, I will solve that issue but get back memory leak. Please, could somebody help me?

perll commented 6 years ago

I (2074527) event: sta ip: 192.168.0.30, mask: 255.255.255.0, gw: 192.168.0.1 I (2074527) WIFI...: Connected to AP I (2074527) WIFI...: DNS lookup succeeded. IP=50.30.38.132 I (2074527) WIFI...: ... allocated socket I (2080437) wifi: bcn_timout,ap_probe_send_start I (2082937) wifi: ap_probe_send over, resett wifi status to disassoc I (2082937) wifi: state: run -> init (1) I (2082937) wifi: pm stop, total sleep time: 0/14780518

I (2082937) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1 I (2140007) event: station ip lost

TimXia commented 6 years ago

@perll Did you use sniffer(promiscuous) mode? If so, Please change to home channel which is the channel of the AP that station is connected to for somewhile between sniffer two different channels.

eflukx commented 6 years ago

@perll Please open another issue for another issue. The current discussion seems to be off topic IMO.

perll commented 6 years ago

I (2074527) event: sta ip: 192.168.0.30, mask: 255.255.255.0, gw: 192.168.0.1 I (2074527) WIFI...: Connected to AP I (2074527) WIFI...: DNS lookup succeeded. IP=50.30.38.132 I (2074527) WIFI...: ... allocated socket I (2080437) wifi: bcn_timout,ap_probe_send_start I (2082937) wifi: ap_probe_send over, resett wifi status to disassoc I (2082937) wifi: state: run -> init (1) I (2082937) wifi: pm stop, total sleep time: 0/14780518

I (2082937) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1 I (2140007) event: station ip lost

perll commented 6 years ago

''event: station ip lost'' Could somebody help me with this issue? I'm not in PROMISCUOS MODE. it is FALSE. I'v been working on a code that I join HTTP_REQUEST and GATT_CLIENTE. My goal is scan for beacons and send them throught a WIFI conn to my web server. It is already working but just for 10' 15'. Regards.

perll commented 6 years ago

Sir,

"(...)HTTP_REQUEST and esp_wifi_scan() to scan for beacon(...)" I did not undertand what you meant. Scan for beacons near by me using HTTP_REQUEST ? Could you point me a example?

Regards

On Mon, Apr 2, 2018 at 11:48 PM, TimXia notifications@github.com wrote:

@perll https://github.com/perll We do not recommend that HTTP_REQUEST and SMART_CONFIG work together. Better to use HTTP_REQUEST and esp_wifi_scan() to scan for beacon and send them by web.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/espressif/esp-idf/issues/1774#issuecomment-378111483, or mute the thread https://github.com/notifications/unsubscribe-auth/ALo6NavGK6JuTMkJxCzQXCok3R0NQtcpks5tkuMNgaJpZM4S7C7o .

TimXia commented 6 years ago

@perll You said I've beem work on a app that is a mix from GATT_CLIENTE, HTT_REQUEST and wifi SMART_CONFIG.. So, I was thinking that you use wifi SMART_CONFIG to scan for beacon. What did you use to scan for beacon? BTW, the issue seems to be related with WiFi and BT/BLE coexistence which works better on the latest master branch of IDF. It is recommended to update IDF to the latest version. Please have a try.

perll commented 6 years ago

Sir, I've updated my workspace with the last master. All failures have been resolved. The question now is:

E (35781) WIFI ...: ... socket connect failed errno = 113 Address 184 Eu (2140007) event: ip station lost

I'm not working on Promiscuous mode.

I have used the sample codes: 1 - HTTP_REQUEST - for request 2 - GATT_CLIENT - for BLE scanning

I deleted the SMART_CONFIG code, as you told me.

Now, after 15 '20' after the start, I get this message and the ESP is stopped. Do you have any tips to make it work together: HTTP_REQUEST and GATT_CLIENT.

Regards

perll commented 6 years ago

Just to add In the last 2 days, I was running an HTTP_REQUEST and, in the GET method, I added 500 bytes of data. It's working fine. without GATT_CLIENT.

On Fri, Apr 6, 2018 at 5:01 AM, TimXia notifications@github.com wrote:

@perll https://github.com/perll You said I've beem work on a app that is a mix from GATT_CLIENTE, HTT_REQUEST and wifi SMART_CONFIG.. So, I was thinking that you use wifi SMART_CONFIG to scan for beacon. What did you use to scan for beacon? BTW, the issue seems to be related with WiFi and BT/BLE coexistence which works better on the latest master branch of IDF. It is recommended to update IDF to the latest version. Please have a try.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/espressif/esp-idf/issues/1774#issuecomment-379178818, or mute the thread https://github.com/notifications/unsubscribe-auth/ALo6NUOLHybWECtLcyw4oAnEA53VfeFzks5tlyC8gaJpZM4S7C7o .

TimXia commented 6 years ago

@perll The issue is caused by the bug of WiFi and BLE coexistence. I suggest to update with the latest IDF which improves the stability of WiFi and BLE coexistence.

perll commented 6 years ago

Ok. Updated with master https://github.com/espressif/esp-idf Updated 2 days ago by Spritetm https://github.com/Spritetm Running. I will keeping you updated about the test results.

By the way, do you know what mean:

I (419833) WIFI...: ... done reading from socket. Last read return=0 errno=128

I've been getting this after each request response

Regards

On Fri, Apr 6, 2018 at 11:07 PM, TimXia notifications@github.com wrote:

@perll https://github.com/perll The issue is caused by the bug of WiFi and BLE coexistence. I suggest to update with the latest IDF which improves the stability of WiFi and BLE coexistence.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/espressif/esp-idf/issues/1774#issuecomment-379424803, or mute the thread https://github.com/notifications/unsubscribe-auth/ALo6NQW0BiR5xIG06u0Ko-8qlVjUyfIgks5tmB97gaJpZM4S7C7o .

perll commented 6 years ago

Sir,

good news (almost there!)

Tests results from the last 9h:

Scenario: 4 esp wroom32 running, at same time, for 9 hours. Only 1 processor stopped.


It was connected to a 5.1V 850mA source.

Each processor, sending 12 (one beacon mac address) bytes by HTTP_REQUEST, plus HTTP header.

*** Reason :

HTTP/1.1 200 OK

ate: Sat, 07 Apr 2018 12:I (99163i4:34 ) MATTC_DEMORT: @initialise_wifi has been detected.sk

Backtrace: 0x40090050:0x3ffd4710 0x40090227:0x3ffd4730 0x40090240:0x3ffd4750 0x4008d93b:0x3ffd4770 0x4008f184:0x3ffd4790 0x4008f13a:0x2820456d 0x40090050: invoke_abort at /home/raimundo/esp/esp-idf/components/esp32/./panic.c:648

0x40090227: abort at /home/raimundo/esp/esp-idf/components/esp32/./panic.c:648

0x40090240: vApplicationStackOverflowHook at /home/raimundo/esp/esp-idf/components/esp32/./panic.c:648

0x4008d93b: vTaskSwitchContext at /home/raimundo/esp/esp-idf/components/freertos/./tasks.c:3529

0x4008f184: _frxt_dispatch at /home/raimundo/esp/esp-idf/components/freertos/./portasm.S:406

0x4008f13a: _frxt_int_exit at /home/raimundo/esp/esp-idf/components/freertos/./portasm.S:206

Rebooting... ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0018,len:4 load:0x3fff001c,len:5664 ho 0 tail 12 room 4 load:0x40078000,len:0 load:0x40078000,len:13912 entry 0x40078fd8 I (30) boot: ESP-IDF v3.1-dev-601-gda27816-dirty 2nd stage bootloader I (30) boot: compile time 00:29:53 I (32) boot: Enabling RNG early entropy source... I (37) boot: SPI Speed : 40MHz I (41) boot: SPI Mode : DIO I (45) boot: SPI Flash Size : 4MB I (49) boot: Partition Table: I (53) boot: ## Label Usage Type ST Offset Length I (60) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (68) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (75) boot: 2 factory factory app 00 00 00010000 00180000 I (83) boot: End of partition table I (87) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x35dec (220652) map I (172) esp_image: segment 1: paddr=0x00045e14 vaddr=0x3ffc0000 size=0x03548 ( 13640) load I (178) esp_image: segment 2: paddr=0x00049364 vaddr=0x40080000 size=0x00400 ( 1024) load 0x40080000: _iram_start at /home/raimundo/esp/esp-idf/components/freertos/./xtensa_vectors.S:1685

I (179) esp_image: segment 3: paddr=0x0004976c vaddr=0x40080400 size=0x068a4 ( 26788) load I (199) esp_image: segment 4: paddr=0x00050018 vaddr=0x400d0018 size=0xae7d4 (714708) map 0x400d0018: _stext at ??:?

I (447) esp_image: segment 5: paddr=0x000fe7f4 vaddr=0x40086ca4 size=0x0bba8 ( 48040) load 0x40086ca4: r_rwble_isr at ??:?

I (467) esp_image: segment 6: paddr=0x0010a3a4 vaddr=0x400c0000 size=0x00000 ( 0) load I (478) boot: Loaded app from partition at offset 0x10000 I (478) boot: Disabling RNG early entropy source... I (479) cpu_start: Pro cpu up. I (483) cpu_start: Starting app cpu, entry point is 0x40080f94 0x40080f94: call_start_cpu1 at /home/raimundo/esp/esp-idf/components/esp32/./cpu_start.c:225

I (474) cpu_start: App cpu up. I (493) heap_init: Initializing. RAM available for dynamic allocation: I (500) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM I (506) heap_init: At 3FFD0788 len 0000F878 (62 KiB): DRAM I (512) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM I (519) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM I (525) heap_init: At 4009284C len 0000D7B4 (53 KiB): IRAM I (531) cpu_start: Pro cpu start user code I (214) cpu_start: Starting scheduler on PRO CPU. I (0) cpu_start: Starting scheduler on APP CPU. I (263) BTDM_INIT: BT controller compile version [8c18895]

I (263) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE I (343) phy: phy_version: 383.0, 79a622c, Jan 30 2018, 15:38:06, 0, 0 I (613) GATTC_DEMO: REG_EVT I (613) GATTC_DEMO: scan start success I (613) wifi: wifi firmware version: c202b34 I (613) wifi: config NVS flash: enabled I (613) wifi: config nano formating: disabled I (613) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE I (623) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE I (653) wifi: Init dynamic tx buffer num: 32 I (653) wifi: Init data frame dynamic rx buffer num: 32 I (653) wifi: Init management frame dynamic rx buffer num: 32 I (663) wifi: wifi driver task: 3ffd2a8c, prio:23, stack:4096 I (663) wifi: Init static rx buffer num: 10 I (663) wifi: Init dynamic rx buffer num: 32 I (673) wifi: wifi power manager task: 0x3ffdddcc prio: 21 stack: 2560 I (683) WIFI...: Setting WiFi configuration SSID REG... I (693) wifi: mode : sta (30:ae:a4:05:78:c4) xPortGetFreeHeapSize :69824 I (803) GATTC_DEMO: ac 23 3f 23 91 7a I (803) GATTC_DEMO: searched Adv Data Len 29, Scan Response Len 0 I (803) GATTC_DEMO: searched Device Name Len 0 I (813) GATTC_DEMO:

NEXT REBOOT FOUND:

HTTP/1.1 200 OK Guru Meditation Error: Core 1 panic'ed (StoreProhibited) . Exception was unhandled. Core 1 register dump: PC : 0x4008f22e PS : 0x00050033 A0 : 0x4008f137 A1 : 0x3ffd4780 0x4008f22e: vPortYieldFromInt at /home/raimundo/esp/esp-idf/components/freertos/./portasm.S:595

0x4008f137: _frxt_int_exit at /home/raimundo/esp/esp-idf/components/freertos/./portasm.S:206

A2 : 0x0000000a A3 : 0x00000000 A4 : 0x000001f8 A5 : 0x3ffc0be0 A6 : 0x00000001 A7 : 0x80000001 A8 : 0x40082509 A9 : 0x00000001 0x40082509: _xt_lowint1 at /home/raimundo/esp/esp-idf/components/freertos/./xtensa_vectors.S:1098

A10 : 0x00060021 A11 : 0x00000000 A12 : 0x8008d47a A13 : 0x3ffc0bd0 A14 : 0x3ffc0c18 A15 : 0x00000001 SAR : 0x00000017 EXCCAUSE: 0x0000001d EXCVADDR: 0x0000000a LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000

Backtrace: 0x4008f22e:0x3ffd4780 0x4008f134:0x3ffd4790 0x4008f22e: vPortYieldFromInt at /home/raimundo/esp/esp-idf/components/freertos/./portasm.S:595

0x4008f134: _frxt_int_exit at /home/raimundo/esp/esp-idf/components/freertos/./portasm.S:205

Rebooting... ets Jun 8 2016 00:22:57

NEXT REBOOT FOUND:

I (822723) GATTC_DEMO: abort() was called at PC 0x40082d4b on core 0 0x40082d4b: lock_init_generic at /home/raimundo/esp/esp-idf/components/newlib/./locks.c:81

Backtrace: 0x40090050:0x3ffc0140 0x40090227:0x3ffc0160 0x40082d4b:0x3ffc0180 0x40082d6c:0x3ffc01a0 0x40082eb1:0x3ffc01d0 0x400d971f:0x3ffc01f0 0x400d54a9:0x3ffc04b0 0x400d5438:0x3ffc0500 0x4008dc97:0x3ffc0530 0x4008cfe1:0x3ffc0550 0x40088e8a:0x3ffc0570 0x40088639:0x3ffc05c0 0x4008b639:0x3ffc05e0 0x40082561:0x3ffc0610 0x4000c3eb:0x00000000 0x40090050: invoke_abort at /home/raimundo/esp/esp-idf/components/esp32/./panic.c:648

0x40090227: abort at /home/raimundo/esp/esp-idf/components/esp32/./panic.c:648

0x40082d4b: lock_init_generic at /home/raimundo/esp/esp-idf/components/newlib/./locks.c:81

0x40082d6c: lock_acquire_generic at /home/raimundo/esp/esp-idf/components/newlib/./locks.c:132

0x40082eb1: _lock_acquire_recursive at /home/raimundo/esp/esp-idf/components/newlib/./locks.c:169

0x400d971f: _vfiprintf_r at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/vfprintf.c:859 (discriminator 9)

0x400d54a9: fiprintf at /Users/ivan/e/newlib_xtensa-2.2.0-bin /newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/fiprintf.c:49

0x400d5438: __assert_func at /Users/ivan/e/ newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c:58

0x4008dc97: vPortCPUAcquireMutexIntsDisabledInternal at /home/raimundo/esp/esp-idf/components/freertos/./tasks.c:3529 (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/raimundo/esp/esp-idf/components/freertos/./portmux_impl.h:98 (inlined by) vTaskEnterCritical at /home/raimundo/esp/esp-idf/components/freertos/./tasks.c:4216

0x4008cfe1: xQueueGenericSendFromISR at /home/raimundo/esp/esp-idf/components/freertos/./queue.c:2037

0x40088e8a: pp_post at ??:?

0x40088639: lmacPostTxComplete at ??:?

0x4008b639: wDev_ProcessFiq at ??:?

0x40082561: _xt_lowint1 at /home/raimundo/esp/esp-idf/components/freertos/./xtensa_vectors.S:1105

Rebooting... ets Jun 8 2016 00:22:57

On Fri, Apr 6, 2018 at 11:07 PM, TimXia notifications@github.com wrote:

@perll https://github.com/perll The issue is caused by the bug of WiFi and BLE coexistence. I suggest to update with the latest IDF which improves the stability of WiFi and BLE coexistence.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/espressif/esp-idf/issues/1774#issuecomment-379424803, or mute the thread https://github.com/notifications/unsubscribe-auth/ALo6NQW0BiR5xIG06u0Ko-8qlVjUyfIgks5tmB97gaJpZM4S7C7o .

perll commented 6 years ago

New issue:

GATT_CLIENTE with HTTP_REQUEST. 12 bytes bytes of request. I think Heap, memory leak... are come back

I (241143) WIFI...: ... socket send success I (241143) WIFI...: ... set socket receiving timeout success HTTP/1.1 200 OK Date: Sat, 07 Apr 2018 21:59:14 GMT Server: Apache abort() was called at PC 0x40082d4b on core 0 0x40082d4b: lock_init_generic at /home/raimundo/esp/esp-idf/components/newlib/./locks.c:81

Backtrace: 0x40090050:0x3ffd56b0 0x40090227:0x3ffd56d0 0x40082d4b:0x3ffd56f0 0x40082d6c:0x3ffd5710 0x40082eb1:0x3ffd5740 0x400d971f:0x3ffd5760 0x400d54a9:0x3ffd5a20 0x400d5438:0x3ffd5a70 0x4008dc97:0x3ffd5aa0 0x4008f96a:0x3ffd5ac0 0x400827c4:0x3ffd5ae0 0x400827f5:0x3ffd5b00 0x40082ca1:0x3ffd5b20 0x4000beaf:0x3ffd5b40 0x4008ccfe:0x3ffd5b60 0x4008cf30:0x3ffd5b80 0x40082d46:0x3ffd5ba0 0x40082d6c:0x3ffd5bc0 0x40082eb1:0x3ffd5bf0 0x400d971f:0x3ffd5c10 0x400d54a9:0x3ffd5ed0 0x400d5438:0x3ffd5f20 0x4008dc97:0x3ffd5f50 0x4008f96a:0x3ffd5f70 0x400827c4:0x3ffd5f90 0x400827f5:0x3ffd5fb0 0x40082ca1:0x3ffd5fd0 0x4000beaf:0x3ffd5ff0 0x4008ccfe:0x3ffd6010 0x4008cf30:0x3ffd6030 0x40082d46:0x3ffd6050 0x40082d6c:0x3ffd6070 0x40082eb1:0x3ffd60a0 0x400d971f:0x3ffd60c0 0x400d54a9:0x3ffd6380 0x400d5438:0x3ffd63d0 0x4008dc97:0x3ffd6400 0x4008f96a:0x3ffd6420 0x400827c4:0x3ffd6440 0x400827f5:0x3ffd6460 0x40082ca1:0x3ffd6480 0x4000beaf:0x3ffd64a0 0x4008ccfe:0x3ffd64c0 0x4008cf30:0x3ffd64e0 0x40082d46:0x3ffd6500 0x40082d6c:0x3ffd6520 0x40082eb1:0x3ffd6550 0x400d971f:0x3ffd6570 0x400d54a9:0x3ffd6830 0x400d5438:0x3ffd6880 0x4008dc97:0x3ffd68b0 0x40090050: invoke_abort at /home/raimundo/esp/esp-idf/components/esp32/./panic.c:648

0x40090227: abort at /home/raimundo/esp/esp-idf/components/esp32/./panic.c:648

0x40082d4b: lock_init_generic at /home/raimundo/esp/esp-idf/components/newlib/./locks.c:81

0x40082d6c: lock_acquire_generic at /home/raimundo/esp/esp-idf/components/newlib/./locks.c:132

0x40082eb1: _lock_acquire_recursive at /home/raimundo/esp/esp-idf/components/newlib/./locks.c:169

0x400d971f: _vfiprintf_r at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/vfprintf.c:859 (discriminator 9)

0x400d54a9: fiprintf at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/fiprintf.c:49

0x400d5438: __assert_func at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c:58

0x4008dc97: vPortCPUAcquireMutexIntsDisabledInternal at /home/raimundo/esp/esp-idf/components/freertos/./tasks.c:3529 (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/raimundo/esp/esp-idf/components/freertos/./portmux_impl.h:98 (inlined by) vTaskEnterCritical at /home/raimundo/esp/esp-idf/components/freertos/./tasks.c:4216

0x4008f96a: multi_heap_internal_lock at /home/raimundo/esp/esp-idf/components/heap/./multi_heap.c:352 (inlined by) multi_heap_malloc_impl at /home/raimundo/esp/esp-idf/components/heap/./multi_heap.c:388

0x400827c4: heap_caps_malloc at /home/raimundo/esp/esp-idf/components/heap/./heap_caps.c:123

0x400827f5: heap_caps_malloc_default at /home/raimundo/esp/esp-idf/components/heap/./heap_caps.c:123

0x40082ca1: _malloc_r at /home/raimundo/esp/esp-idf/components/newlib/./syscalls.c:37

0x4008ccfe: xQueueGenericCreate at /home/raimundo/esp/esp-idf/components/freertos/./queue.c:2037

0x4008cf30: xQueueCreateMutex at /home/raimundo/esp/esp-idf/components/freertos/./queue.c:2037

0x40082d46: lock_init_generic at /home/raimundo/esp/esp-idf/components/newlib/./locks.c:79

0x40082d6c: lock_acquire_generic at /home/raimundo/esp/esp-idf/components/newlib/./locks.c:132

0x40082eb1: _lock_acquire_recursive at /home/raimundo/esp/esp-idf/components/newlib/./locks.c:169

0x400d971f: _vfiprintf_r at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/vfprintf.c:859 (discriminator 9)

0x400d54a9: fiprintf at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/fiprintf.c:49

0x400d5438: __assert_func at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c:58

0x4008dc97: vPortCPUAcquireMutexIntsDisabledInternal at /home/raimundo/esp/esp-idf/components/freertos/./tasks.c:3529 (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/raimundo/esp/esp-idf/components/freertos/./portmux_impl.h:98 (inlined by) vTaskEnterCritical at /home/raimundo/esp/esp-idf/components/freertos/./tasks.c:4216

0x4008f96a: multi_heap_internal_lock at /home/raimundo/esp/esp-idf/components/heap/./multi_heap.c:352 (inlined by) multi_heap_malloc_impl at /home/raimundo/esp/esp-idf/components/heap/./multi_heap.c:388

0x400827c4: heap_caps_malloc at /home/raimundo/esp/esp-idf/components/heap/./heap_caps.c:123

0x400827f5: heap_caps_malloc_default at /home/raimundo/esp/esp-idf/components/heap/./heap_caps.c:123

0x40082ca1: _malloc_r at /home/raimundo/esp/esp-idf/components/newlib/./syscalls.c:37

0x4008ccfe: xQueueGenericCreate at /home/raimundo/esp/esp-idf/components/freertos/./queue.c:2037

0x4008cf30: xQueueCreateMutex at /home/raimundo/esp/esp-idf/components/freertos/./queue.c:2037

0x40082d46: lock_init_generic at /home/raimundo/esp/esp-idf/components/newlib/./locks.c:79

0x40082d6c: lock_acquire_generic at /home/raimundo/esp/esp-idf/components/newlib/./locks.c:132

0x40082eb1: _lock_acquire_recursive at /home/raimundo/esp/esp-idf/components/newlib/./locks.c:169

0x400d971f: _vfiprintf_r at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/vfprintf.c:859 (discriminator 9)

0x400d54a9: fiprintf at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/fiprintf.c:49

0x400d5438: __assert_func at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c:58

0x4008dc97: vPortCPUAcquireMutexIntsDisabledInternal at /home/raimundo/esp/esp-idf/components/freertos/./tasks.c:3529 (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/raimundo/esp/esp-idf/components/freertos/./portmux_impl.h:98 (inlined by) vTaskEnterCritical at /home/raimundo/esp/esp-idf/components/freertos/./tasks.c:4216

0x4008f96a: multi_heap_internal_lock at /home/raimundo/esp/esp-idf/components/heap/./multi_heap.c:352 (inlined by) multi_heap_malloc_impl at /home/raimundo/esp/esp-idf/components/heap/./multi_heap.c:388

0x400827c4: heap_caps_malloc at /home/raimundo/esp/esp-idf/components/heap/./heap_caps.c:123

0x400827f5: heap_caps_malloc_default at /home/raimundo/esp/esp-idf/components/heap/./heap_caps.c:123

0x40082ca1: _malloc_r at /home/raimundo/esp/esp-idf/components/newlib/./syscalls.c:37

0x4008ccfe: xQueueGenericCreate at /home/raimundo/esp/esp-idf/components/freertos/./queue.c:2037

0x4008cf30: xQueueCreateMutex at /home/raimundo/esp/esp-idf/components/freertos/./queue.c:2037

0x40082d46: lock_init_generic at /home/raimundo/esp/esp-idf/components/newlib/./locks.c:79

0x40082d6c: lock_acquire_generic at /home/raimundo/esp/esp-idf/components/newlib/./locks.c:132

0x40082eb1: _lock_acquire_recursive at /home/raimundo/esp/esp-idf/components/newlib/./locks.c:169

0x400d971f: _vfiprintf_r at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/vfprintf.c:859 (discriminator 9)

0x400d54a9: fiprintf at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/fiprintf.c:49

0x400d5438: __assert_func at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c:58

0x4008dc97: vPortCPUAcquireMutexIntsDisabledInternal at /home/raimundo/esp/esp-idf/components/freertos/./tasks.c:3529 (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/raimundo/esp/esp-idf/components/freertos/./portmux_impl.h:98 (inlined by) vTaskEnterCritical at /home/raimundo/esp/esp-idf/components/freertos/./tasks.c:4216

Rebooting... ets Jun 8 2016 00:22:57

On Sat, Apr 7, 2018 at 9:54 AM, Raimundo Miranda Neto < rs.miranda.neto@gmail.com> wrote:

Sir,

good news (almost there!)

Tests results from the last 9h:

Scenario: 4 esp wroom32 running, at same time, for 9 hours. Only 1 processor stopped.


It was connected to a 5.1V 850mA source.

Each processor, sending 12 (one beacon mac address) bytes by HTTP_REQUEST, plus HTTP header.

*** Reason :

HTTP/1.1 200 OK

ate: Sat, 07 Apr 2018 12:I (99163i4:34 ) MATTC_DEMORT: @initialise_wifi has been detected.sk

Backtrace: 0x40090050:0x3ffd4710 0x40090227:0x3ffd4730 0x40090240:0x3ffd4750 0x4008d93b:0x3ffd4770 0x4008f184:0x3ffd4790 0x4008f13a:0x2820456d 0x40090050: invoke_abort at /home/raimundo/esp/esp-idf/ components/esp32/./panic.c:648

0x40090227: abort at /home/raimundo/esp/esp-idf/ components/esp32/./panic.c:648

0x40090240: vApplicationStackOverflowHook at /home/raimundo/esp/esp-idf/ components/esp32/./panic.c:648

0x4008d93b: vTaskSwitchContext at /home/raimundo/esp/esp-idf/ components/freertos/./tasks.c:3529

0x4008f184: _frxt_dispatch at /home/raimundo/esp/esp-idf/ components/freertos/./portasm.S:406

0x4008f13a: _frxt_int_exit at /home/raimundo/esp/esp-idf/ components/freertos/./portasm.S:206

Rebooting... ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0018,len:4 load:0x3fff001c,len:5664 ho 0 tail 12 room 4 load:0x40078000,len:0 load:0x40078000,len:13912 entry 0x40078fd8 I (30) boot: ESP-IDF v3.1-dev-601-gda27816-dirty 2nd stage bootloader I (30) boot: compile time 00:29:53 I (32) boot: Enabling RNG early entropy source... I (37) boot: SPI Speed : 40MHz I (41) boot: SPI Mode : DIO I (45) boot: SPI Flash Size : 4MB I (49) boot: Partition Table: I (53) boot: ## Label Usage Type ST Offset Length I (60) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (68) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (75) boot: 2 factory factory app 00 00 00010000 00180000 I (83) boot: End of partition table I (87) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x35dec (220652) map I (172) esp_image: segment 1: paddr=0x00045e14 vaddr=0x3ffc0000 size=0x03548 ( 13640) load I (178) esp_image: segment 2: paddr=0x00049364 vaddr=0x40080000 size=0x00400 ( 1024) load 0x40080000: _iram_start at /home/raimundo/esp/esp-idf/ components/freertos/./xtensa_vectors.S:1685

I (179) esp_image: segment 3: paddr=0x0004976c vaddr=0x40080400 size=0x068a4 ( 26788) load I (199) esp_image: segment 4: paddr=0x00050018 vaddr=0x400d0018 size=0xae7d4 (714708) map 0x400d0018: _stext at ??:?

I (447) esp_image: segment 5: paddr=0x000fe7f4 vaddr=0x40086ca4 size=0x0bba8 ( 48040) load 0x40086ca4: r_rwble_isr at ??:?

I (467) esp_image: segment 6: paddr=0x0010a3a4 vaddr=0x400c0000 size=0x00000 ( 0) load I (478) boot: Loaded app from partition at offset 0x10000 I (478) boot: Disabling RNG early entropy source... I (479) cpu_start: Pro cpu up. I (483) cpu_start: Starting app cpu, entry point is 0x40080f94 0x40080f94: call_start_cpu1 at /home/raimundo/esp/esp-idf/ components/esp32/./cpu_start.c:225

I (474) cpu_start: App cpu up. I (493) heap_init: Initializing. RAM available for dynamic allocation: I (500) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM I (506) heap_init: At 3FFD0788 len 0000F878 (62 KiB): DRAM I (512) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM I (519) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM I (525) heap_init: At 4009284C len 0000D7B4 (53 KiB): IRAM I (531) cpu_start: Pro cpu start user code I (214) cpu_start: Starting scheduler on PRO CPU. I (0) cpu_start: Starting scheduler on APP CPU. I (263) BTDM_INIT: BT controller compile version [8c18895]

I (263) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE I (343) phy: phy_version: 383.0, 79a622c, Jan 30 2018, 15:38:06, 0, 0 I (613) GATTC_DEMO: REG_EVT I (613) GATTC_DEMO: scan start success I (613) wifi: wifi firmware version: c202b34 I (613) wifi: config NVS flash: enabled I (613) wifi: config nano formating: disabled I (613) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE I (623) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE I (653) wifi: Init dynamic tx buffer num: 32 I (653) wifi: Init data frame dynamic rx buffer num: 32 I (653) wifi: Init management frame dynamic rx buffer num: 32 I (663) wifi: wifi driver task: 3ffd2a8c, prio:23, stack:4096 I (663) wifi: Init static rx buffer num: 10 I (663) wifi: Init dynamic rx buffer num: 32 I (673) wifi: wifi power manager task: 0x3ffdddcc prio: 21 stack: 2560 I (683) WIFI...: Setting WiFi configuration SSID REG... I (693) wifi: mode : sta (30:ae:a4:05:78:c4) xPortGetFreeHeapSize :69824 I (803) GATTC_DEMO: ac 23 3f 23 91 7a I (803) GATTC_DEMO: searched Adv Data Len 29, Scan Response Len 0 I (803) GATTC_DEMO: searched Device Name Len 0 I (813) GATTC_DEMO:

NEXT REBOOT FOUND:

HTTP/1.1 200 OK Guru Meditation Error: Core 1 panic'ed (StoreProhibited) . Exception was unhandled. Core 1 register dump: PC : 0x4008f22e PS : 0x00050033 A0 : 0x4008f137 A1 : 0x3ffd4780 0x4008f22e: vPortYieldFromInt at /home/raimundo/esp/esp-idf/ components/freertos/./portasm.S:595

0x4008f137: _frxt_int_exit at /home/raimundo/esp/esp-idf/ components/freertos/./portasm.S:206

A2 : 0x0000000a A3 : 0x00000000 A4 : 0x000001f8 A5 : 0x3ffc0be0 A6 : 0x00000001 A7 : 0x80000001 A8 : 0x40082509 A9 : 0x00000001 0x40082509: _xt_lowint1 at /home/raimundo/esp/esp-idf/ components/freertos/./xtensa_vectors.S:1098

A10 : 0x00060021 A11 : 0x00000000 A12 : 0x8008d47a A13 : 0x3ffc0bd0 A14 : 0x3ffc0c18 A15 : 0x00000001 SAR : 0x00000017 EXCCAUSE: 0x0000001d EXCVADDR: 0x0000000a LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000

Backtrace: 0x4008f22e:0x3ffd4780 0x4008f134:0x3ffd4790 0x4008f22e: vPortYieldFromInt at /home/raimundo/esp/esp-idf/ components/freertos/./portasm.S:595

0x4008f134: _frxt_int_exit at /home/raimundo/esp/esp-idf/ components/freertos/./portasm.S:205

Rebooting... ets Jun 8 2016 00:22:57

NEXT REBOOT FOUND:

I (822723) GATTC_DEMO: abort() was called at PC 0x40082d4b on core 0 0x40082d4b: lock_init_generic at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:81

Backtrace: 0x40090050:0x3ffc0140 0x40090227:0x3ffc0160 0x40082d4b:0x3ffc0180 0x40082d6c:0x3ffc01a0 0x40082eb1:0x3ffc01d0 0x400d971f:0x3ffc01f0 0x400d54a9:0x3ffc04b0 0x400d5438:0x3ffc0500 0x4008dc97:0x3ffc0530 0x4008cfe1:0x3ffc0550 0x40088e8a:0x3ffc0570 0x40088639:0x3ffc05c0 0x4008b639:0x3ffc05e0 0x40082561:0x3ffc0610 0x4000c3eb:0x00000000 0x40090050: invoke_abort at /home/raimundo/esp/esp-idf/ components/esp32/./panic.c:648

0x40090227: abort at /home/raimundo/esp/esp-idf/ components/esp32/./panic.c:648

0x40082d4b: lock_init_generic at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:81

0x40082d6c: lock_acquire_generic at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:132

0x40082eb1: _lock_acquire_recursive at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:169

0x400d971f: _vfiprintf_r at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdio/../../../.././newlib/libc/stdio/vfprintf.c:859 (discriminator 9)

0x400d54a9: fiprintf at /Users/ivan/e/newlib_xtensa-2.2.0-bin /newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdio/../../../.././newlib/libc/stdio/fiprintf.c:49

0x400d5438: __assert_func at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdlib/../../../.././newlib/libc/stdlib/assert.c:58

0x4008dc97: vPortCPUAcquireMutexIntsDisabledInternal at /home/raimundo/esp/esp-idf/components/freertos/./tasks.c:3529 (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/raimundo/esp/esp-idf/components/freertos/./portmux_impl.h:98 (inlined by) vTaskEnterCritical at /home/raimundo/esp/esp-idf/ components/freertos/./tasks.c:4216

0x4008cfe1: xQueueGenericSendFromISR at /home/raimundo/esp/esp-idf/ components/freertos/./queue.c:2037

0x40088e8a: pp_post at ??:?

0x40088639: lmacPostTxComplete at ??:?

0x4008b639: wDev_ProcessFiq at ??:?

0x40082561: _xt_lowint1 at /home/raimundo/esp/esp-idf/ components/freertos/./xtensa_vectors.S:1105

Rebooting... ets Jun 8 2016 00:22:57

On Fri, Apr 6, 2018 at 11:07 PM, TimXia notifications@github.com wrote:

@perll https://github.com/perll The issue is caused by the bug of WiFi and BLE coexistence. I suggest to update with the latest IDF which improves the stability of WiFi and BLE coexistence.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/espressif/esp-idf/issues/1774#issuecomment-379424803, or mute the thread https://github.com/notifications/unsubscribe-auth/ALo6NQW0BiR5xIG06u0Ko-8qlVjUyfIgks5tmB97gaJpZM4S7C7o .

On Fri, Apr 6, 2018 at 11:07 PM, TimXia notifications@github.com wrote:

@perll https://github.com/perll The issue is caused by the bug of WiFi and BLE coexistence. I suggest to update with the latest IDF which improves the stability of WiFi and BLE coexistence.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/espressif/esp-idf/issues/1774#issuecomment-379424803, or mute the thread https://github.com/notifications/unsubscribe-auth/ALo6NQW0BiR5xIG06u0Ko-8qlVjUyfIgks5tmB97gaJpZM4S7C7o .

TimXia commented 6 years ago

@perll errno = 128 means TCP connectio is closed. You can reconnect it again. Could you provide the elf file to us to debug the crash issue? BTW, did you use PSRAM?

perll commented 6 years ago

New issue:

GATT_CLIENTE with HTTP_REQUEST. 12 bytes bytes of request. I think Heap, memory leak... are come back

I (241143) WIFI...: ... socket send success I (241143) WIFI...: ... set socket receiving timeout success HTTP/1.1 200 OK Date: Sat, 07 Apr 2018 21:59:14 GMT Server: Apache abort() was called at PC 0x40082d4b on core 0 0x40082d4b: lock_init_generic at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:81

Backtrace: 0x40090050:0x3ffd56b0 0x40090227:0x3ffd56d0 0x40082d4b:0x3ffd56f0 0x40082d6c:0x3ffd5710 0x40082eb1:0x3ffd5740 0x400d971f:0x3ffd5760 0x400d54a9:0x3ffd5a20 0x400d5438:0x3ffd5a70 0x4008dc97:0x3ffd5aa0 0x4008f96a:0x3ffd5ac0 0x400827c4:0x3ffd5ae0 0x400827f5:0x3ffd5b00 0x40082ca1:0x3ffd5b20 0x4000beaf:0x3ffd5b40 0x4008ccfe:0x3ffd5b60 0x4008cf30:0x3ffd5b80 0x40082d46:0x3ffd5ba0 0x40082d6c:0x3ffd5bc0 0x40082eb1:0x3ffd5bf0 0x400d971f:0x3ffd5c10 0x400d54a9:0x3ffd5ed0 0x400d5438:0x3ffd5f20 0x4008dc97:0x3ffd5f50 0x4008f96a:0x3ffd5f70 0x400827c4:0x3ffd5f90 0x400827f5:0x3ffd5fb0 0x40082ca1:0x3ffd5fd0 0x4000beaf:0x3ffd5ff0 0x4008ccfe:0x3ffd6010 0x4008cf30:0x3ffd6030 0x40082d46:0x3ffd6050 0x40082d6c:0x3ffd6070 0x40082eb1:0x3ffd60a0 0x400d971f:0x3ffd60c0 0x400d54a9:0x3ffd6380 0x400d5438:0x3ffd63d0 0x4008dc97:0x3ffd6400 0x4008f96a:0x3ffd6420 0x400827c4:0x3ffd6440 0x400827f5:0x3ffd6460 0x40082ca1:0x3ffd6480 0x4000beaf:0x3ffd64a0 0x4008ccfe:0x3ffd64c0 0x4008cf30:0x3ffd64e0 0x40082d46:0x3ffd6500 0x40082d6c:0x3ffd6520 0x40082eb1:0x3ffd6550 0x400d971f:0x3ffd6570 0x400d54a9:0x3ffd6830 0x400d5438:0x3ffd6880 0x4008dc97:0x3ffd68b0 0x40090050: invoke_abort at /home/raimundo/esp/esp-idf/ components/esp32/./panic.c:648

0x40090227: abort at /home/raimundo/esp/esp-idf/ components/esp32/./panic.c:648

0x40082d4b: lock_init_generic at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:81

0x40082d6c: lock_acquire_generic at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:132

0x40082eb1: _lock_acquire_recursive at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:169

0x400d971f: _vfiprintf_r at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdio/../../../.././newlib/libc/stdio/vfprintf.c:859 (discriminator 9)

0x400d54a9: fiprintf at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdio/../../../.././newlib/libc/stdio/fiprintf.c:49

0x400d5438: __assert_func at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdlib/../../../.././newlib/libc/stdlib/assert.c:58

0x4008dc97: vPortCPUAcquireMutexIntsDisabledInternal at /home/raimundo/esp/esp-idf/components/freertos/./tasks.c:3529 (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/raimundo/esp/esp-idf/components/freertos/./portmux_impl.h:98 (inlined by) vTaskEnterCritical at /home/raimundo/esp/esp-idf/ components/freertos/./tasks.c:4216

0x4008f96a: multi_heap_internal_lock at /home/raimundo/esp/esp-idf/ components/heap/./multi_heap.c:352 (inlined by) multi_heap_malloc_impl at /home/raimundo/esp/esp-idf/ components/heap/./multi_heap.c:388

0x400827c4: heap_caps_malloc at /home/raimundo/esp/esp-idf/ components/heap/./heap_caps.c:123

0x400827f5: heap_caps_malloc_default at /home/raimundo/esp/esp-idf/ components/heap/./heap_caps.c:123

0x40082ca1: _malloc_r at /home/raimundo/esp/esp-idf/ components/newlib/./syscalls.c:37

0x4008ccfe: xQueueGenericCreate at /home/raimundo/esp/esp-idf/ components/freertos/./queue.c:2037

0x4008cf30: xQueueCreateMutex at /home/raimundo/esp/esp-idf/ components/freertos/./queue.c:2037

0x40082d46: lock_init_generic at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:79

0x40082d6c: lock_acquire_generic at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:132

0x40082eb1: _lock_acquire_recursive at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:169

0x400d971f: _vfiprintf_r at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdio/../../../.././newlib/libc/stdio/vfprintf.c:859 (discriminator 9)

0x400d54a9: fiprintf at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdio/../../../.././newlib/libc/stdio/fiprintf.c:49

0x400d5438: __assert_func at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdlib/../../../.././newlib/libc/stdlib/assert.c:58

0x4008dc97: vPortCPUAcquireMutexIntsDisabledInternal at /home/raimundo/esp/esp-idf/components/freertos/./tasks.c:3529 (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/raimundo/esp/esp-idf/components/freertos/./portmux_impl.h:98 (inlined by) vTaskEnterCritical at /home/raimundo/esp/esp-idf/ components/freertos/./tasks.c:4216

0x4008f96a: multi_heap_internal_lock at /home/raimundo/esp/esp-idf/ components/heap/./multi_heap.c:352 (inlined by) multi_heap_malloc_impl at /home/raimundo/esp/esp-idf/ components/heap/./multi_heap.c:388

0x400827c4: heap_caps_malloc at /home/raimundo/esp/esp-idf/ components/heap/./heap_caps.c:123

0x400827f5: heap_caps_malloc_default at /home/raimundo/esp/esp-idf/ components/heap/./heap_caps.c:123

0x40082ca1: _malloc_r at /home/raimundo/esp/esp-idf/ components/newlib/./syscalls.c:37

0x4008ccfe: xQueueGenericCreate at /home/raimundo/esp/esp-idf/ components/freertos/./queue.c:2037

0x4008cf30: xQueueCreateMutex at /home/raimundo/esp/esp-idf/ components/freertos/./queue.c:2037

0x40082d46: lock_init_generic at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:79

0x40082d6c: lock_acquire_generic at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:132

0x40082eb1: _lock_acquire_recursive at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:169

0x400d971f: _vfiprintf_r at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdio/../../../.././newlib/libc/stdio/vfprintf.c:859 (discriminator 9)

0x400d54a9: fiprintf at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdio/../../../.././newlib/libc/stdio/fiprintf.c:49

0x400d5438: __assert_func at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdlib/../../../.././newlib/libc/stdlib/assert.c:58

0x4008dc97: vPortCPUAcquireMutexIntsDisabledInternal at /home/raimundo/esp/esp-idf/components/freertos/./tasks.c:3529 (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/raimundo/esp/esp-idf/components/freertos/./portmux_impl.h:98 (inlined by) vTaskEnterCritical at /home/raimundo/esp/esp-idf/ components/freertos/./tasks.c:4216

0x4008f96a: multi_heap_internal_lock at /home/raimundo/esp/esp-idf/ components/heap/./multi_heap.c:352 (inlined by) multi_heap_malloc_impl at /home/raimundo/esp/esp-idf/ components/heap/./multi_heap.c:388

0x400827c4: heap_caps_malloc at /home/raimundo/esp/esp-idf/ components/heap/./heap_caps.c:123

0x400827f5: heap_caps_malloc_default at /home/raimundo/esp/esp-idf/ components/heap/./heap_caps.c:123

0x40082ca1: _malloc_r at /home/raimundo/esp/esp-idf/ components/newlib/./syscalls.c:37

0x4008ccfe: xQueueGenericCreate at /home/raimundo/esp/esp-idf/ components/freertos/./queue.c:2037

0x4008cf30: xQueueCreateMutex at /home/raimundo/esp/esp-idf/ components/freertos/./queue.c:2037

0x40082d46: lock_init_generic at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:79

0x40082d6c: lock_acquire_generic at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:132

0x40082eb1: _lock_acquire_recursive at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:169

0x400d971f: _vfiprintf_r at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdio/../../../.././newlib/libc/stdio/vfprintf.c:859 (discriminator 9)

0x400d54a9: fiprintf at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdio/../../../.././newlib/libc/stdio/fiprintf.c:49

0x400d5438: __assert_func at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdlib/../../../.././newlib/libc/stdlib/assert.c:58

0x4008dc97: vPortCPUAcquireMutexIntsDisabledInternal at /home/raimundo/esp/esp-idf/components/freertos/./tasks.c:3529 (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/raimundo/esp/esp-idf/components/freertos/./portmux_impl.h:98 (inlined by) vTaskEnterCritical at /home/raimundo/esp/esp-idf/ components/freertos/./tasks.c:4216

Rebooting... ets Jun 8 2016 00:22:57

On Sat, Apr 7, 2018 at 9:54 AM, Raimundo Miranda Neto < rs.miranda.neto@gmail.com> wrote:

Sir,

good news (almost there!)

Tests results from the last 9h:

Scenario: 4 esp wroom32 running, at same time, for 9 hours. Only 1 processor stopped.


It was connected to a 5.1V 850mA source.

Each processor, sending 12 (one beacon mac address) bytes by HTTP_REQUEST, plus HTTP header.

*** Reason :

HTTP/1.1 200 OK

ate: Sat, 07 Apr 2018 12:I (99163i4:34 ) MATTC_DEMORT: @initialise_wifi has been detected.sk

Backtrace: 0x40090050:0x3ffd4710 0x40090227:0x3ffd4730 0x40090240:0x3ffd4750 0x4008d93b:0x3ffd4770 0x4008f184:0x3ffd4790 0x4008f13a:0x2820456d 0x40090050: invoke_abort at /home/raimundo/esp/esp-idf/com ponents/esp32/./panic.c:648

0x40090227: abort at /home/raimundo/esp/esp-idf/com ponents/esp32/./panic.c:648

0x40090240: vApplicationStackOverflowHook at /home/raimundo/esp/esp-idf/components/esp32/./panic.c:648

0x4008d93b: vTaskSwitchContext at /home/raimundo/esp/esp-idf/com ponents/freertos/./tasks.c:3529

0x4008f184: _frxt_dispatch at /home/raimundo/esp/esp-idf/com ponents/freertos/./portasm.S:406

0x4008f13a: _frxt_int_exit at /home/raimundo/esp/esp-idf/com ponents/freertos/./portasm.S:206

Rebooting... ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0018,len:4 load:0x3fff001c,len:5664 ho 0 tail 12 room 4 load:0x40078000,len:0 load:0x40078000,len:13912 entry 0x40078fd8 I (30) boot: ESP-IDF v3.1-dev-601-gda27816-dirty 2nd stage bootloader I (30) boot: compile time 00:29:53 I (32) boot: Enabling RNG early entropy source... I (37) boot: SPI Speed : 40MHz I (41) boot: SPI Mode : DIO I (45) boot: SPI Flash Size : 4MB I (49) boot: Partition Table: I (53) boot: ## Label Usage Type ST Offset Length I (60) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (68) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (75) boot: 2 factory factory app 00 00 00010000 00180000 I (83) boot: End of partition table I (87) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x35dec (220652) map I (172) esp_image: segment 1: paddr=0x00045e14 vaddr=0x3ffc0000 size=0x03548 ( 13640) load I (178) esp_image: segment 2: paddr=0x00049364 vaddr=0x40080000 size=0x00400 ( 1024) load 0x40080000: _iram_start at /home/raimundo/esp/esp-idf/com ponents/freertos/./xtensa_vectors.S:1685

I (179) esp_image: segment 3: paddr=0x0004976c vaddr=0x40080400 size=0x068a4 ( 26788) load I (199) esp_image: segment 4: paddr=0x00050018 vaddr=0x400d0018 size=0xae7d4 (714708) map 0x400d0018: _stext at ??:?

I (447) esp_image: segment 5: paddr=0x000fe7f4 vaddr=0x40086ca4 size=0x0bba8 ( 48040) load 0x40086ca4: r_rwble_isr at ??:?

I (467) esp_image: segment 6: paddr=0x0010a3a4 vaddr=0x400c0000 size=0x00000 ( 0) load I (478) boot: Loaded app from partition at offset 0x10000 I (478) boot: Disabling RNG early entropy source... I (479) cpu_start: Pro cpu up. I (483) cpu_start: Starting app cpu, entry point is 0x40080f94 0x40080f94: call_start_cpu1 at /home/raimundo/esp/esp-idf/com ponents/esp32/./cpu_start.c:225

I (474) cpu_start: App cpu up. I (493) heap_init: Initializing. RAM available for dynamic allocation: I (500) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM I (506) heap_init: At 3FFD0788 len 0000F878 (62 KiB): DRAM I (512) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM I (519) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM I (525) heap_init: At 4009284C len 0000D7B4 (53 KiB): IRAM I (531) cpu_start: Pro cpu start user code I (214) cpu_start: Starting scheduler on PRO CPU. I (0) cpu_start: Starting scheduler on APP CPU. I (263) BTDM_INIT: BT controller compile version [8c18895]

I (263) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE I (343) phy: phy_version: 383.0, 79a622c, Jan 30 2018, 15:38:06, 0, 0 I (613) GATTC_DEMO: REG_EVT I (613) GATTC_DEMO: scan start success I (613) wifi: wifi firmware version: c202b34 I (613) wifi: config NVS flash: enabled I (613) wifi: config nano formating: disabled I (613) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE I (623) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE I (653) wifi: Init dynamic tx buffer num: 32 I (653) wifi: Init data frame dynamic rx buffer num: 32 I (653) wifi: Init management frame dynamic rx buffer num: 32 I (663) wifi: wifi driver task: 3ffd2a8c, prio:23, stack:4096 I (663) wifi: Init static rx buffer num: 10 I (663) wifi: Init dynamic rx buffer num: 32 I (673) wifi: wifi power manager task: 0x3ffdddcc prio: 21 stack: 2560 I (683) WIFI...: Setting WiFi configuration SSID REG... I (693) wifi: mode : sta (30:ae:a4:05:78:c4) xPortGetFreeHeapSize :69824 I (803) GATTC_DEMO: ac 23 3f 23 91 7a I (803) GATTC_DEMO: searched Adv Data Len 29, Scan Response Len 0 I (803) GATTC_DEMO: searched Device Name Len 0 I (813) GATTC_DEMO:

NEXT REBOOT FOUND:

HTTP/1.1 200 OK Guru Meditation Error: Core 1 panic'ed (StoreProhibited) . Exception was unhandled. Core 1 register dump: PC : 0x4008f22e PS : 0x00050033 A0 : 0x4008f137 A1 : 0x3ffd4780 0x4008f22e: vPortYieldFromInt at /home/raimundo/esp/esp-idf/com ponents/freertos/./portasm.S:595

0x4008f137: _frxt_int_exit at /home/raimundo/esp/esp-idf/com ponents/freertos/./portasm.S:206

A2 : 0x0000000a A3 : 0x00000000 A4 : 0x000001f8 A5 : 0x3ffc0be0 A6 : 0x00000001 A7 : 0x80000001 A8 : 0x40082509 A9 : 0x00000001 0x40082509: _xt_lowint1 at /home/raimundo/esp/esp-idf/com ponents/freertos/./xtensa_vectors.S:1098

A10 : 0x00060021 A11 : 0x00000000 A12 : 0x8008d47a A13 : 0x3ffc0bd0 A14 : 0x3ffc0c18 A15 : 0x00000001 SAR : 0x00000017 EXCCAUSE: 0x0000001d EXCVADDR: 0x0000000a LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000

Backtrace: 0x4008f22e:0x3ffd4780 0x4008f134:0x3ffd4790 0x4008f22e: vPortYieldFromInt at /home/raimundo/esp/esp-idf/com ponents/freertos/./portasm.S:595

0x4008f134: _frxt_int_exit at /home/raimundo/esp/esp-idf/com ponents/freertos/./portasm.S:205

Rebooting... ets Jun 8 2016 00:22:57

NEXT REBOOT FOUND:

I (822723) GATTC_DEMO: abort() was called at PC 0x40082d4b on core 0 0x40082d4b: lock_init_generic at /home/raimundo/esp/esp-idf/com ponents/newlib/./locks.c:81

Backtrace: 0x40090050:0x3ffc0140 0x40090227:0x3ffc0160 0x40082d4b:0x3ffc0180 0x40082d6c:0x3ffc01a0 0x40082eb1:0x3ffc01d0 0x400d971f:0x3ffc01f0 0x400d54a9:0x3ffc04b0 0x400d5438:0x3ffc0500 0x4008dc97:0x3ffc0530 0x4008cfe1:0x3ffc0550 0x40088e8a:0x3ffc0570 0x40088639:0x3ffc05c0 0x4008b639:0x3ffc05e0 0x40082561:0x3ffc0610 0x4000c3eb:0x00000000 0x40090050: invoke_abort at /home/raimundo/esp/esp-idf/com ponents/esp32/./panic.c:648

0x40090227: abort at /home/raimundo/esp/esp-idf/com ponents/esp32/./panic.c:648

0x40082d4b: lock_init_generic at /home/raimundo/esp/esp-idf/com ponents/newlib/./locks.c:81

0x40082d6c: lock_acquire_generic at /home/raimundo/esp/esp-idf/com ponents/newlib/./locks.c:132

0x40082eb1: _lock_acquire_recursive at /home/raimundo/esp/esp-idf/com ponents/newlib/./locks.c:169

0x400d971f: _vfiprintf_r at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/std io/../../../.././newlib/libc/stdio/vfprintf.c:859 (discriminator 9)

0x400d54a9: fiprintf at /Users/ivan/e/newlib_xtensa-2.2.0-bin /newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/std io/../../../.././newlib/libc/stdio/fiprintf.c:49

0x400d5438: __assert_func at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/std lib/../../../.././newlib/libc/stdlib/assert.c:58

0x4008dc97: vPortCPUAcquireMutexIntsDisabledInternal at /home/raimundo/esp/esp-idf/components/freertos/./tasks.c:3529 (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/raimundo/esp/esp-idf/components/freertos/./portmux_impl.h:98 (inlined by) vTaskEnterCritical at /home/raimundo/esp/esp-idf/com ponents/freertos/./tasks.c:4216

0x4008cfe1: xQueueGenericSendFromISR at /home/raimundo/esp/esp-idf/com ponents/freertos/./queue.c:2037

0x40088e8a: pp_post at ??:?

0x40088639: lmacPostTxComplete at ??:?

0x4008b639: wDev_ProcessFiq at ??:?

0x40082561: _xt_lowint1 at /home/raimundo/esp/esp-idf/com ponents/freertos/./xtensa_vectors.S:1105

Rebooting... ets Jun 8 2016 00:22:57

On Fri, Apr 6, 2018 at 11:07 PM, TimXia notifications@github.com wrote:

@perll https://github.com/perll The issue is caused by the bug of WiFi and BLE coexistence. I suggest to update with the latest IDF which improves the stability of WiFi and BLE coexistence.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/espressif/esp-idf/issues/1774#issuecomment-379424803, or mute the thread https://github.com/notifications/unsubscribe-auth/ALo6NQW0BiR5xIG06u0Ko-8qlVjUyfIgks5tmB97gaJpZM4S7C7o .

perll commented 6 years ago

Sure!

I got some problems attaching the code. So, ELF below. Yes. I'm using PSRAM. Please, Special atemption tofor ESP_GAP_BLE_SCAN_RESULT_EVT. There I'm getting the BLE SCAN RESULT and setting array that will be the REQUEST.

Regards!

/* This example code is in the Public Domain (or CC0 licensed, at your option.)

Unless required by applicable law or agreed to in writing, this software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */

/**** *

include "esp_bt.h"

include "esp_gap_ble_api.h"

include "esp_gattc_api.h"

include "esp_gatt_defs.h"

include "esp_bt_main.h"

include "esp_gatt_common_api.h"

include "freertos/FreeRTOS.h"

include "freertos/task.h"

include "freertos/event_groups.h"

include "esp_system.h"

include "esp_wifi.h"

include "esp_event_loop.h"

include "esp_log.h"

include "lwip/err.h"

include "lwip/sockets.h"

include "lwip/sys.h"

include "lwip/netdb.h"

include "lwip/dns.h"

define GATTC_TAG "GATTC_DEMO"

define REMOTE_SERVICE_UUID 0x00FF

define REMOTE_NOTIFY_CHAR_UUID 0xFF01

define PROFILE_NUM 1

define PROFILE_A_APP_ID 0

define INVALID_HANDLE 0

define DURATION 10

/ Constants that aren't configurable in menuconfig /

define WEB_SERVER "ipolvo.com.br"

define WEB_PORT 80

define WEB_URL "http://www.ipolvo.com.br/ipolvoTeste/agua/index2.php?"

static char macAddressFullTMP[6]; static char macAddress[5000]; size_t macAddressSize = sizeof(macAddress);

static char btMACaddr[30];

/* The examples use simple WiFi configuration that you can set via 'make menuconfig'.

If you'd rather not, just change the below entries to strings with the config you want - ie #define EXAMPLE_WIFI_SSID "mywifissid" */

define EXAMPLE_WIFI_SSID "REG"

define EXAMPLE_WIFI_PASS "xxxxxxxxxxxxxxxxx"

/ FreeRTOS event group to signal when we are connected & ready to make a request / static EventGroupHandle_t wifi_event_group;

/ The event group allows multiple bits for each event, but we only care about one event - are we connected to the AP with an IP? / const int CONNECTED_BIT = BIT0;

static const char remote_device_name[] = "ESP_GATTS_DEMO"; static bool connect_ble = false; static bool get_server = false; static esp_gattc_char_elem_t char_elem_result = NULL; static esp_gattc_descr_elem_t descr_elem_result = NULL;

/ eclare static functions / static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t param); static void esp_gattc_cb(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t param); static void gattc_profile_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param);

static esp_bt_uuid_t remote_filter_service_uuid = { .len = ESP_UUID_LEN_16, .uuid = {.uuid16 = REMOTE_SERVICE_UUID,}, };

static esp_bt_uuid_t remote_filter_char_uuid = { .len = ESP_UUID_LEN_16, .uuid = {.uuid16 = REMOTE_NOTIFY_CHAR_UUID,}, };

static esp_bt_uuid_t notify_descr_uuid = { .len = ESP_UUID_LEN_16, .uuid = {.uuid16 = ESP_GATT_UUID_CHAR_CLIENT_CONFIG,}, };

static esp_ble_scan_params_t ble_scan_params = { .scan_type = BLE_SCAN_TYPE_ACTIVE, .own_addr_type = BLE_ADDR_TYPE_PUBLIC, .scan_filter_policy = BLE_SCAN_FILTER_ALLOW_ALL, .scan_interval = 0x100, .scan_window = 0x30 };

struct gattc_profile_inst { esp_gattc_cb_t gattc_cb; uint16_t gattc_if; uint16_t app_id; uint16_t conn_id; uint16_t service_start_handle; uint16_t service_end_handle; uint16_t char_handle; esp_bd_addr_t remote_bda; }; / One gatt-based profile one app_id and one gattc_if, this array will store the gattc_if returned by ESP_GATTS_REG_EVT / static struct gattc_profile_inst gl_profile_tab[PROFILE_NUM] = { [PROFILE_A_APP_ID] = { .gattc_cb = gattc_profile_event_handler, .gattc_if = ESP_GATT_IF_NONE, / Not get the gatt_if, so initial is ESP_GATT_IF_NONE / }, };

static void gattc_profile_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t param) { esp_ble_gattc_cb_param_t p_data = (esp_ble_gattc_cb_param_t *)param;

switch (event) {
case ESP_GATTC_REG_EVT:
    ESP_LOGI(GATTC_TAG, "REG_EVT");
    esp_err_t scan_ret = esp_ble_gap_set_scan_params(&ble_scan_params);
    if (scan_ret){
        ESP_LOGE(GATTC_TAG, "set scan params error, error code = %x",

scan_ret); } break; case ESP_GATTC_CONNECT_EVT:{ ESP_LOGI(GATTC_TAG, "ESP_GATTC_CONNECT_EVT conn_id %d, if %d", p_data->connect.conn_id, gattc_if); gl_profile_tab[PROFILE_A_APP_ID].conn_id = p_data->connect.conn_id; memcpy(gl_profile_tab[PROFILE_A_APP_ID].remote_bda, p_data->connect.remote_bda, sizeof(esp_bd_addr_t)); ESP_LOGI(GATTC_TAG, "REMOTE BDA:"); esp_log_buffer_hex(GATTC_TAG, gl_profile_tab[PROFILE_A_APP_ID].remote_bda, sizeof(esp_bd_addr_t)); esp_err_t mtu_ret = esp_ble_gattc_send_mtu_req (gattc_if, p_data->connect.conn_id); if (mtu_ret){ ESP_LOGE(GATTC_TAG, "config MTU error, error code = %x", mtu_ret); } break; } case ESP_GATTC_OPEN_EVT: if (param->open.status != ESP_GATT_OK){ ESP_LOGE(GATTC_TAG, "open failed, status %d", p_data->open.status); break; } ESP_LOGI(GATTC_TAG, "open success"); break; case ESP_GATTC_CFG_MTU_EVT: if (param->cfg_mtu.status != ESP_GATT_OK){ ESP_LOGE(GATTC_TAG,"config mtu failed, error status = %x", param->cfg_mtu.status); } ESP_LOGI(GATTC_TAG, "ESP_GATTC_CFG_MTU_EVT, Status %d, MTU %d, conn_id %d", param->cfg_mtu.status, param->cfg_mtu.mtu, param->cfg_mtu.conn_id); esp_ble_gattc_search_service(gattc_if, param->cfg_mtu.conn_id, &remote_filter_service_uuid); break; case ESP_GATTC_SEARCH_RES_EVT: { ESP_LOGI(GATTC_TAG, "ESP_GATTC_SEARCH_RES_EVT"); esp_gatt_srvc_id_t srvc_id =(esp_gatt_srvc_id_t )&p_data->search_res.srvc_id; if (srvc_id->id.uuid.len == ESP_UUID_LEN_16 && srvc_id->id.uuid.uuid.uuid16 == REMOTE_SERVICE_UUID) { ESP_LOGI(GATTC_TAG, "service found"); get_server = true; gl_profile_tab[PROFILE_A_APP_ID].service_start_handle = p_data->search_res.start_handle; gl_profile_tab[PROFILE_A_APP_ID].service_end_handle = p_data->search_res.end_handle; ESP_LOGI(GATTC_TAG, "UUID16: %x", srvc_id->id.uuid.uuid.uuid16); } break; } case ESP_GATTC_SEARCH_CMPL_EVT: if (p_data->search_cmpl.status != ESP_GATT_OK){ ESP_LOGE(GATTC_TAG, "search service failed, error status = %x", p_data->search_cmpl.status); break; } ESP_LOGI(GATTC_TAG, "ESP_GATTC_SEARCH_CMPL_EVT"); if (get_server){ uint16_t count = 0; esp_gatt_status_t status = esp_ble_gattc_get_attr_count( gattc_if,

p_data->search_cmpl.conn_id,

ESP_GATT_DB_CHARACTERISTIC,

gl_profile_tab[PROFILE_A_APP_ID].service_start_handle,

gl_profile_tab[PROFILE_A_APP_ID].service_end_handle,

INVALID_HANDLE,

&count); if (status != ESP_GATT_OK){ ESP_LOGE(GATTC_TAG, "esp_ble_gattc_get_attr_count error"); }

        if (count > 0){
            char_elem_result = (esp_gattc_char_elem_t

)malloc(sizeof(esp_gattc_char_elem_t) count); if (!char_elem_result){ ESP_LOGE(GATTC_TAG, "gattc no mem"); }else{ status = esp_ble_gattc_get_char_by_uuid( gattc_if,

p_data->search_cmpl.conn_id,

gl_profile_tab[PROFILE_A_APP_ID].service_start_handle,

gl_profile_tab[PROFILE_A_APP_ID].service_end_handle,

remote_filter_char_uuid,

char_elem_result, &count); if (status != ESP_GATT_OK){ ESP_LOGE(GATTC_TAG, "esp_ble_gattc_get_char_by_uuid error"); }

                /*  Every service have only one char in our

'ESP_GATTS_DEMO' demo, so we used first 'char_elem_result' / if (count > 0 && (char_elem_result[0].properties & ESP_GATT_CHAR_PROP_BIT_NOTIFY)){ gl_profile_tab[PROFILE_A_APP_ID].char_handle = char_elem_result[0].char_handle; esp_ble_gattc_register_for_notify (gattc_if, gl_profile_tab[PROFILE_A_APP_ID].remote_bda, char_elem_result[0].char_handle); } } / free char_elem_result */ free(char_elem_result); }else{ ESP_LOGE(GATTC_TAG, "no char found"); } } break; case ESP_GATTC_REG_FOR_NOTIFY_EVT: { ESP_LOGI(GATTC_TAG, "ESP_GATTC_REG_FOR_NOTIFY_EVT"); if (p_data->reg_for_notify.status != ESP_GATT_OK){ ESP_LOGE(GATTC_TAG, "REG FOR NOTIFY failed: error status = %d", p_data->reg_for_notify.status); }else{ uint16_t count = 0; uint16_t notify_en = 1; esp_gatt_status_t ret_status = esp_ble_gattc_get_attr_count( gattc_if,

gl_profile_tab[PROFILE_A_APP_ID].conn_id,

ESP_GATT_DB_DESCRIPTOR,

gl_profile_tab[PROFILE_A_APP_ID].service_start_handle,

gl_profile_tab[PROFILE_A_APP_ID].service_end_handle,

gl_profile_tab[PROFILE_A_APP_ID].char_handle,

&count); if (ret_status != ESP_GATT_OK){ ESP_LOGE(GATTC_TAG, "esp_ble_gattc_get_attr_count error"); } if (count > 0){ descr_elem_result = malloc(sizeof(esp_gattc_descr_elem_t) * count); if (!descr_elem_result){ ESP_LOGE(GATTC_TAG, "malloc error, gattc no mem"); }else{ ret_status = esp_ble_gattc_get_descr_by_char_handle( gattc_if,

gl_profile_tab[PROFILE_A_APP_ID].conn_id,

p_data->reg_for_notify.handle,

notify_descr_uuid,

descr_elem_result,

&count); if (ret_status != ESP_GATT_OK){ ESP_LOGE(GATTC_TAG, "esp_ble_gattc_get_descr_by_char_handle error"); }

                /* Every char has only one descriptor in our

'ESP_GATTS_DEMO' demo, so we used first 'descr_elem_result' */ if (count > 0 && descr_elem_result[0].uuid.len == ESP_UUID_LEN_16 && descr_elem_result[0].uuid.uuid.uuid16 == ESP_GATT_UUID_CHAR_CLIENT_CONFIG){ ret_status = esp_ble_gattc_write_char_descr( gattc_if,

gl_profile_tab[PROFILE_A_APP_ID].conn_id,

descr_elem_result[0].handle,

sizeof(notify_en),

(uint8_t *)&notify_en,

ESP_GATT_WRITE_TYPE_RSP,

ESP_GATT_AUTH_REQ_NONE); }

                if (ret_status != ESP_GATT_OK){
                    ESP_LOGE(GATTC_TAG, "esp_ble_gattc_write_char_descr

error"); }

                /* free descr_elem_result */
                free(descr_elem_result);
            }
        }
        else{
            ESP_LOGE(GATTC_TAG, "decsr not found");
        }

    }
    break;
}
case ESP_GATTC_NOTIFY_EVT:
    if (p_data->notify.is_notify){
        ESP_LOGI(GATTC_TAG, "ESP_GATTC_NOTIFY_EVT, receive notify

value:"); }else{ ESP_LOGI(GATTC_TAG, "ESP_GATTC_NOTIFY_EVT, receive indicate value:"); } esp_log_buffer_hex(GATTC_TAG, p_data->notify.value, p_data->notify.value_len); break; case ESP_GATTC_WRITE_DESCR_EVT: if (p_data->write.status != ESP_GATT_OK){ ESP_LOGE(GATTC_TAG, "write descr failed, error status = %x", p_data->write.status); break; } ESP_LOGI(GATTC_TAG, "write descr success "); uint8_t write_char_data[35]; for (int i = 0; i < sizeof(write_char_data); ++i) { write_char_data[i] = i % 256; } esp_ble_gattc_write_char( gattc_if, gl_profile_tab[PROFILE_A_APP_ID].conn_id,

gl_profile_tab[PROFILE_A_APP_ID].char_handle, sizeof(write_char_data), write_char_data, ESP_GATT_WRITE_TYPE_RSP, ESP_GATT_AUTH_REQ_NONE); break; case ESP_GATTC_SRVC_CHG_EVT: { esp_bd_addr_t bda; memcpy(bda, p_data->srvc_chg.remote_bda, sizeof(esp_bd_addr_t)); ESP_LOGI(GATTC_TAG, "ESP_GATTC_SRVC_CHG_EVT, bd_addr:"); esp_log_buffer_hex(GATTC_TAG, bda, sizeof(esp_bd_addr_t)); break; } case ESP_GATTC_WRITE_CHAR_EVT: if (p_data->write.status != ESP_GATT_OK){ ESP_LOGE(GATTC_TAG, "write char failed, error status = %x", p_data->write.status); break; } ESP_LOGI(GATTC_TAG, "write char success "); break; case ESP_GATTC_DISCONNECT_EVT: connect_ble = false; get_server = false; ESP_LOGI(GATTC_TAG, "ESP_GATTC_DISCONNECT_EVT, reason = %d", p_data->disconnect.reason); break; default: break; } }

static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t param) { uint8_t adv_name = NULL; uint8_t adv_name_len = 0; switch (event) { case ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT: { //the unit of the duration is second uint32_t duration = 30; esp_ble_gap_start_scanning(duration); break; } case ESP_GAP_BLE_SCAN_START_COMPLETE_EVT: //scan start complete event to indicate scan start successfully or failed if (param->scan_start_cmpl.status != ESP_BT_STATUS_SUCCESS) { ESP_LOGE(GATTC_TAG, "scan start failed, error status = %x", param->scan_start_cmpl.status); break; } ESP_LOGI(GATTC_TAG, "scan start success");

    break;
case ESP_GAP_BLE_SCAN_RESULT_EVT: {
    esp_ble_gap_cb_param_t *scan_result = (esp_ble_gap_cb_param_t

*)param; switch (scan_result->scan_rst.search_evt) { case ESP_GAP_SEARCH_INQ_RES_EVT: esp_log_buffer_hex(GATTC_TAG, scan_result->scan_rst.bda, 6);

        ESP_LOGI(GATTC_TAG, "searched Adv Data Len %d, Scan Response

Len %d", scan_result->scan_rst.adv_data_len, scan_result->scan_rst.scan_rsp_len); adv_name = esp_ble_resolve_adv_data(scan_result->scan_rst.ble_adv,ESP_BLE_AD_TYPE_NAME_CMPL, &adv_name_len); ESP_LOGI(GATTC_TAG, "searched Device Name Len %d", adv_name_len); esp_log_buffer_char(GATTC_TAG, adv_name, adv_name_len); ESP_LOGI(GATTC_TAG, "\n"); if (adv_name != NULL) { if (strlen(remote_device_name) == adv_name_len && strncmp((char *)adv_name, remote_device_name, adv_name_len) == 0) { ESP_LOGI(GATTC_TAG, "searched device %s\n", remote_device_name); if (connect_ble == false) { connect_ble = true; ESP_LOGI(GATTC_TAG, "connect to the remote device."); esp_ble_gap_stop_scanning();

esp_ble_gattc_open(gl_profile_tab[PROFILE_A_APP_ID].gattc_if, scan_result->scan_rst.bda, true); } } }

       sprintf(macAddressFullTMP, "%02X%02X%02X%02X%02X%02X",
         scan_result->scan_rst.bda[0],
         scan_result->scan_rst.bda[1],
         scan_result->scan_rst.bda[2],
         scan_result->scan_rst.bda[3],
         scan_result->scan_rst.bda[4],
         scan_result->scan_rst.bda[5]);

        strcat(macAddress, macAddressFullTMP);
        strcat(macAddress, ",");

        break;
    case ESP_GAP_SEARCH_INQ_CMPL_EVT:
        ESP_LOGI(GATTC_TAG, "<<<<<<<REESTARTING BLE SCANNER>>>>>>.");
        //strncpy(macAddress,  macAddressFullTMP, macAddressSize);
        macAddress[macAddressSize -1]='\0';
        memset( macAddressFullTMP, 0x00, strlen(macAddressFullTMP));

        esp_ble_gap_start_scanning(DURATION);

        break;
    default:
        break;
    }
    break;
}

case ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT:
    if (param->scan_stop_cmpl.status != ESP_BT_STATUS_SUCCESS){
        ESP_LOGE(GATTC_TAG, "scan stop failed, error status = %x",

param->scan_stop_cmpl.status); break; } ESP_LOGI(GATTC_TAG, "stop scan successfully"); break;

case ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT:
    if (param->adv_stop_cmpl.status != ESP_BT_STATUS_SUCCESS){
        ESP_LOGE(GATTC_TAG, "adv stop failed, error status = %x",

param->adv_stop_cmpl.status); break; } ESP_LOGI(GATTC_TAG, "stop adv successfully"); break; case ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT: ESP_LOGI(GATTC_TAG, "update connection params status = %d, min_int = %d, max_int = %d,conn_int = %d,latency = %d, timeout = %d", param->update_conn_params.status, param->update_conn_params.min_int, param->update_conn_params.max_int, param->update_conn_params.conn_int, param->update_conn_params.latency, param->update_conn_params.timeout); break; default: break; } }

static void esp_gattc_cb(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t param) { / If event is register event, store the gattc_if for each profile */ if (event == ESP_GATTC_REG_EVT) { if (param->reg.status == ESP_GATT_OK) { gl_profile_tab[param->reg.app_id].gattc_if = gattc_if; } else { ESP_LOGI(GATTC_TAG, "reg app failed, app_id %04x, status %d", param->reg.app_id, param->reg.status); return; } }

/* If the gattc_if equal to profile A, call profile A cb handler,
 * so here call each profile's callback */
do {
    int idx;
    for (idx = 0; idx < PROFILE_NUM; idx++) {
        if (gattc_if == ESP_GATT_IF_NONE || /* ESP_GATT_IF_NONE, not

specify a certain gatt_if, need to call every profile cb function */ gattc_if == gl_profile_tab[idx].gattc_if) { if (gl_profile_tab[idx].gattc_cb) { gl_profile_tab[idx].gattc_cb(event, gattc_if, param); } } } } while (0); }

static const char *TAG_WIFI = "WIFI...";

static const char *REQUEST = "GET " WEB_URL " HTTP/1.0\r\n" "Host: "WEB_SERVER"\r\n" "User-Agent: esp-idf/1.0 esp32\r\n" "\r\n";

/static const char REQUEST = "POST" WEB_URL " HTTP/1.0\r\n" "User-Agent: esp-idf/1.0 esp32\r\n" "Connection: close\r\n" //general header "Host: WEB_SERVER\r\n" //request header "Content-Type: application/json\r\n" //entity header "Content-Length: 13\r\n" //entity header "\r\n" "{\"pwr\":\"off\"}";*/

static esp_err_t event_handler(void ctx, system_event_t event) { switch(event->event_id) { case SYSTEM_EVENT_STA_START: esp_wifi_connect(); break; case SYSTEM_EVENT_STA_GOT_IP: xEventGroupSetBits(wifi_event_group, CONNECTED_BIT); break; case SYSTEM_EVENT_STA_DISCONNECTED: / This is a workaround as ESP32 WiFi libs don't currently auto-reassociate. / esp_wifi_connect(); xEventGroupClearBits(wifi_event_group, CONNECTED_BIT); break; default: break; } return ESP_OK; }

static void initialise_wifi(void) { tcpip_adapter_init(); wifi_event_group = xEventGroupCreate(); ESP_ERROR_CHECK( esp_event_loop_init(event_handler, NULL) ); wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); ESP_ERROR_CHECK( esp_wifi_init(&cfg) ); ESP_ERROR_CHECK( esp_wifi_set_storage(WIFI_STORAGE_RAM) ); wifi_config_t wifi_config = { .sta = { .ssid = EXAMPLE_WIFI_SSID, .password = EXAMPLE_WIFI_PASS, }, }; ESP_LOGI(TAG_WIFI, "Setting WiFi configuration SSID %s...", wifi_config.sta.ssid); ESP_ERROR_CHECK( esp_wifi_set_mode(WIFI_MODE_STA) ); ESP_ERROR_CHECK( esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) ); ESP_ERROR_CHECK( esp_wifi_start() ); }

static char* get_request_header(){

//printf("Got IP: %s\n", inet_ntoa( ip ) );
uint8_t l_Mac[12];
esp_wifi_get_mac(ESP_IF_WIFI_STA, l_Mac);
sprintf(btMACaddr,"%hhu%hhu%hhu%hhu%hhu%hhu", l_Mac[0], l_Mac[1],

l_Mac[2], l_Mac[3], l_Mac[4], l_Mac[5]);

char *ai = "IA=";
char *ib = "&IB=";
char *REQUEST = "GET " WEB_URL;

char *end_req = " HTTP/1.0\r\n"
"Host: "WEB_SERVER"\r\n"
"User-Agent: esp-idf/1.0 esp32\r\n"
"Content-Type: application/json\r\n"
"\r\n";

char *req_tmp = (char *) malloc(1   + strlen(REQUEST)
                                    + strlen(ai)
                                    +

strlen(btMACaddr)

static void http_get_task(void pvParameters) { const struct addrinfo hints = { .ai_family = AF_INET, .ai_socktype = SOCK_STREAM, }; struct addrinfo res; struct in_addr *addr; int s, r; char recv_buf[64];

while(1) {
    /* Wait for the callback to set the CONNECTED_BIT in the
       event group.
    */
    xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT,
                        false, true, portMAX_DELAY);
    ESP_LOGI(TAG_WIFI, "Connected to AP");

    int err = getaddrinfo(WEB_SERVER, "80", &hints, &res);

    if(err != 0 || res == NULL) {
        ESP_LOGE(TAG_WIFI, "DNS lookup failed err=%d res=%p", err, res);
        vTaskDelay(1000 / portTICK_PERIOD_MS);
        continue;
    }

    /* Code to print the resolved IP.

       Note: inet_ntoa is non-reentrant, look at ipaddr_ntoa_r for

"real" code / addr = &((struct sockaddr_in )res->ai_addr)->sin_addr; ESP_LOGI(TAG_WIFI, "DNS lookup succeeded. IP=%s", inet_ntoa(*addr));

    s = socket(res->ai_family, res->ai_socktype, 0);
    if(s < 0) {
        ESP_LOGE(TAG_WIFI, "... Failed to allocate socket.");
        freeaddrinfo(res);
        vTaskDelay(1000 / portTICK_PERIOD_MS);
        continue;
    }
    ESP_LOGI(TAG_WIFI, "... allocated socket");

    if(connect(s, res->ai_addr, res->ai_addrlen) != 0) {
        ESP_LOGE(TAG_WIFI, "... socket connect failed errno=%d", errno);
        close(s);
        freeaddrinfo(res);
        vTaskDelay(4000 / portTICK_PERIOD_MS);
        continue;
    }

    ESP_LOGI(TAG_WIFI, "... connected");
    freeaddrinfo(res);

    char *req = get_request_header();
    if (write(s, req, strlen(req)) < 0) {
        ESP_LOGE(TAG_WIFI, "... socket send failed");
        close(s);
        vTaskDelay(4000 / portTICK_PERIOD_MS);
        continue;
    }

    //memset(req, 0x00, strlen(req));

    ESP_LOGI(TAG_WIFI, "... socket send success");

    struct timeval receiving_timeout;
    receiving_timeout.tv_sec = 5;
    receiving_timeout.tv_usec = 0;
    if (setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &receiving_timeout,
            sizeof(receiving_timeout)) < 0) {
        ESP_LOGE(TAG_WIFI, "... failed to set socket receiving

timeout"); close(s); vTaskDelay(4000 / portTICK_PERIOD_MS); continue; } ESP_LOGI(TAG_WIFI, "... set socket receiving timeout success");

    /* Read HTTP response */
    do {
        bzero(recv_buf, sizeof(recv_buf));
        r = read(s, recv_buf, sizeof(recv_buf)-1);
        for(int i = 0; i < r; i++) {
            putchar(recv_buf[i]);
        }
    } while(r > 0);

    ESP_LOGI(TAG_WIFI, "... done reading from socket. Last read

return=%d errno=%d\r\n", r, errno); close(s);

    for(int countdown = 10; countdown >= 0; countdown--) {
        ESP_LOGI(TAG_WIFI, "%d... ", countdown);
        vTaskDelay(1000 / portTICK_PERIOD_MS);
    }
    ESP_LOGI(TAG_WIFI, "Starting again!");
}

}

void app_main() { // Initialize NVS. esp_err_t ret = nvs_flash_init(); if (ret == ESP_ERR_NVS_NO_FREE_PAGES) { ESP_ERROR_CHECK(nvs_flash_erase()); ret = nvs_flash_init(); } ESP_ERROR_CHECK( ret );

ESP_ERROR_CHECK(esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT));

esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
ret = esp_bt_controller_init(&bt_cfg);
if (ret) {
    ESP_LOGE(GATTC_TAG, "%s initialize controller failed: %s\n",

func, esp_err_to_name(ret)); return; }

ret = esp_bt_controller_enable(ESP_BT_MODE_BLE);
if (ret) {
    ESP_LOGE(GATTC_TAG, "%s enable controller failed: %s\n", __func__,

esp_err_to_name(ret)); return; }

ret = esp_bluedroid_init();
if (ret) {
    ESP_LOGE(GATTC_TAG, "%s init bluetooth failed: %s\n", __func__,

esp_err_to_name(ret)); return; }

ret = esp_bluedroid_enable();
if (ret) {
    ESP_LOGE(GATTC_TAG, "%s enable bluetooth failed: %s\n", __func__,

esp_err_to_name(ret)); return; }

//register the  callback function to the gap module
ret = esp_ble_gap_register_callback(esp_gap_cb);
if (ret){
    ESP_LOGE(GATTC_TAG, "%s gap register failed, error code = %x\n",

func, ret); return; }

//register the callback function to the gattc module
ret = esp_ble_gattc_register_callback(esp_gattc_cb);
if(ret){
    ESP_LOGE(GATTC_TAG, "%s gattc register failed, error code = %x\n",

func, ret); return; }

ret = esp_ble_gattc_app_register(PROFILE_A_APP_ID);
if (ret){
    ESP_LOGE(GATTC_TAG, "%s gattc app register failed, error code =

%x\n", func, ret); } esp_err_t local_mtu_ret = esp_ble_gatt_set_local_mtu(517); if (local_mtu_ret){ ESP_LOGE(GATTC_TAG, "set local MTU failed, error code = %x", local_mtu_ret); }

initialise_wifi();
xTaskCreate(&http_get_task, "http_get_task", (1024 * 64), NULL, 7,

NULL); //http_get_task(NULL);

printf("xPortGetFreeHeapSize :%d\n", xPortGetFreeHeapSize() );

}

On Sat, Apr 7, 2018 at 7:07 PM, Raimundo Miranda Neto < rs.miranda.neto@gmail.com> wrote:

New issue:

GATT_CLIENTE with HTTP_REQUEST. 12 bytes bytes of request. I think Heap, memory leak... are come back

I (241143) WIFI...: ... socket send success I (241143) WIFI...: ... set socket receiving timeout success HTTP/1.1 200 OK Date: Sat, 07 Apr 2018 21:59:14 GMT Server: Apache abort() was called at PC 0x40082d4b on core 0 0x40082d4b: lock_init_generic at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:81

Backtrace: 0x40090050:0x3ffd56b0 0x40090227:0x3ffd56d0 0x40082d4b:0x3ffd56f0 0x40082d6c:0x3ffd5710 0x40082eb1:0x3ffd5740 0x400d971f:0x3ffd5760 0x400d54a9:0x3ffd5a20 0x400d5438:0x3ffd5a70 0x4008dc97:0x3ffd5aa0 0x4008f96a:0x3ffd5ac0 0x400827c4:0x3ffd5ae0 0x400827f5:0x3ffd5b00 0x40082ca1:0x3ffd5b20 0x4000beaf:0x3ffd5b40 0x4008ccfe:0x3ffd5b60 0x4008cf30:0x3ffd5b80 0x40082d46:0x3ffd5ba0 0x40082d6c:0x3ffd5bc0 0x40082eb1:0x3ffd5bf0 0x400d971f:0x3ffd5c10 0x400d54a9:0x3ffd5ed0 0x400d5438:0x3ffd5f20 0x4008dc97:0x3ffd5f50 0x4008f96a:0x3ffd5f70 0x400827c4:0x3ffd5f90 0x400827f5:0x3ffd5fb0 0x40082ca1:0x3ffd5fd0 0x4000beaf:0x3ffd5ff0 0x4008ccfe:0x3ffd6010 0x4008cf30:0x3ffd6030 0x40082d46:0x3ffd6050 0x40082d6c:0x3ffd6070 0x40082eb1:0x3ffd60a0 0x400d971f:0x3ffd60c0 0x400d54a9:0x3ffd6380 0x400d5438:0x3ffd63d0 0x4008dc97:0x3ffd6400 0x4008f96a:0x3ffd6420 0x400827c4:0x3ffd6440 0x400827f5:0x3ffd6460 0x40082ca1:0x3ffd6480 0x4000beaf:0x3ffd64a0 0x4008ccfe:0x3ffd64c0 0x4008cf30:0x3ffd64e0 0x40082d46:0x3ffd6500 0x40082d6c:0x3ffd6520 0x40082eb1:0x3ffd6550 0x400d971f:0x3ffd6570 0x400d54a9:0x3ffd6830 0x400d5438:0x3ffd6880 0x4008dc97:0x3ffd68b0 0x40090050: invoke_abort at /home/raimundo/esp/esp-idf/ components/esp32/./panic.c:648

0x40090227: abort at /home/raimundo/esp/esp-idf/ components/esp32/./panic.c:648

0x40082d4b: lock_init_generic at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:81

0x40082d6c: lock_acquire_generic at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:132

0x40082eb1: _lock_acquire_recursive at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:169

0x400d971f: _vfiprintf_r at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdio/../../../.././newlib/libc/stdio/vfprintf.c:859 (discriminator 9)

0x400d54a9: fiprintf at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdio/../../../.././newlib/libc/stdio/fiprintf.c:49

0x400d5438: __assert_func at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdlib/../../../.././newlib/libc/stdlib/assert.c:58

0x4008dc97: vPortCPUAcquireMutexIntsDisabledInternal at /home/raimundo/esp/esp-idf/components/freertos/./tasks.c:3529 (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/raimundo/esp/esp-idf/components/freertos/./portmux_impl.h:98 (inlined by) vTaskEnterCritical at /home/raimundo/esp/esp-idf/ components/freertos/./tasks.c:4216

0x4008f96a: multi_heap_internal_lock at /home/raimundo/esp/esp-idf/ components/heap/./multi_heap.c:352 (inlined by) multi_heap_malloc_impl at /home/raimundo/esp/esp-idf/ components/heap/./multi_heap.c:388

0x400827c4: heap_caps_malloc at /home/raimundo/esp/esp-idf/ components/heap/./heap_caps.c:123

0x400827f5: heap_caps_malloc_default at /home/raimundo/esp/esp-idf/ components/heap/./heap_caps.c:123

0x40082ca1: _malloc_r at /home/raimundo/esp/esp-idf/ components/newlib/./syscalls.c:37

0x4008ccfe: xQueueGenericCreate at /home/raimundo/esp/esp-idf/ components/freertos/./queue.c:2037

0x4008cf30: xQueueCreateMutex at /home/raimundo/esp/esp-idf/ components/freertos/./queue.c:2037

0x40082d46: lock_init_generic at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:79

0x40082d6c: lock_acquire_generic at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:132

0x40082eb1: _lock_acquire_recursive at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:169

0x400d971f: _vfiprintf_r at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdio/../../../.././newlib/libc/stdio/vfprintf.c:859 (discriminator 9)

0x400d54a9: fiprintf at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdio/../../../.././newlib/libc/stdio/fiprintf.c:49

0x400d5438: __assert_func at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdlib/../../../.././newlib/libc/stdlib/assert.c:58

0x4008dc97: vPortCPUAcquireMutexIntsDisabledInternal at /home/raimundo/esp/esp-idf/components/freertos/./tasks.c:3529 (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/raimundo/esp/esp-idf/components/freertos/./portmux_impl.h:98 (inlined by) vTaskEnterCritical at /home/raimundo/esp/esp-idf/ components/freertos/./tasks.c:4216

0x4008f96a: multi_heap_internal_lock at /home/raimundo/esp/esp-idf/ components/heap/./multi_heap.c:352 (inlined by) multi_heap_malloc_impl at /home/raimundo/esp/esp-idf/ components/heap/./multi_heap.c:388

0x400827c4: heap_caps_malloc at /home/raimundo/esp/esp-idf/ components/heap/./heap_caps.c:123

0x400827f5: heap_caps_malloc_default at /home/raimundo/esp/esp-idf/ components/heap/./heap_caps.c:123

0x40082ca1: _malloc_r at /home/raimundo/esp/esp-idf/ components/newlib/./syscalls.c:37

0x4008ccfe: xQueueGenericCreate at /home/raimundo/esp/esp-idf/ components/freertos/./queue.c:2037

0x4008cf30: xQueueCreateMutex at /home/raimundo/esp/esp-idf/ components/freertos/./queue.c:2037

0x40082d46: lock_init_generic at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:79

0x40082d6c: lock_acquire_generic at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:132

0x40082eb1: _lock_acquire_recursive at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:169

0x400d971f: _vfiprintf_r at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdio/../../../.././newlib/libc/stdio/vfprintf.c:859 (discriminator 9)

0x400d54a9: fiprintf at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdio/../../../.././newlib/libc/stdio/fiprintf.c:49

0x400d5438: __assert_func at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdlib/../../../.././newlib/libc/stdlib/assert.c:58

0x4008dc97: vPortCPUAcquireMutexIntsDisabledInternal at /home/raimundo/esp/esp-idf/components/freertos/./tasks.c:3529 (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/raimundo/esp/esp-idf/components/freertos/./portmux_impl.h:98 (inlined by) vTaskEnterCritical at /home/raimundo/esp/esp-idf/ components/freertos/./tasks.c:4216

0x4008f96a: multi_heap_internal_lock at /home/raimundo/esp/esp-idf/ components/heap/./multi_heap.c:352 (inlined by) multi_heap_malloc_impl at /home/raimundo/esp/esp-idf/ components/heap/./multi_heap.c:388

0x400827c4: heap_caps_malloc at /home/raimundo/esp/esp-idf/ components/heap/./heap_caps.c:123

0x400827f5: heap_caps_malloc_default at /home/raimundo/esp/esp-idf/ components/heap/./heap_caps.c:123

0x40082ca1: _malloc_r at /home/raimundo/esp/esp-idf/ components/newlib/./syscalls.c:37

0x4008ccfe: xQueueGenericCreate at /home/raimundo/esp/esp-idf/ components/freertos/./queue.c:2037

0x4008cf30: xQueueCreateMutex at /home/raimundo/esp/esp-idf/ components/freertos/./queue.c:2037

0x40082d46: lock_init_generic at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:79

0x40082d6c: lock_acquire_generic at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:132

0x40082eb1: _lock_acquire_recursive at /home/raimundo/esp/esp-idf/ components/newlib/./locks.c:169

0x400d971f: _vfiprintf_r at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdio/../../../.././newlib/libc/stdio/vfprintf.c:859 (discriminator 9)

0x400d54a9: fiprintf at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdio/../../../.././newlib/libc/stdio/fiprintf.c:49

0x400d5438: __assert_func at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/ stdlib/../../../.././newlib/libc/stdlib/assert.c:58

0x4008dc97: vPortCPUAcquireMutexIntsDisabledInternal at /home/raimundo/esp/esp-idf/components/freertos/./tasks.c:3529 (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/raimundo/esp/esp-idf/components/freertos/./portmux_impl.h:98 (inlined by) vTaskEnterCritical at /home/raimundo/esp/esp-idf/ components/freertos/./tasks.c:4216

Rebooting... ets Jun 8 2016 00:22:57

On Sat, Apr 7, 2018 at 9:54 AM, Raimundo Miranda Neto < rs.miranda.neto@gmail.com> wrote:

Sir,

good news (almost there!)

Tests results from the last 9h:

Scenario: 4 esp wroom32 running, at same time, for 9 hours. Only 1 processor stopped.


It was connected to a 5.1V 850mA source.

Each processor, sending 12 (one beacon mac address) bytes by HTTP_REQUEST, plus HTTP header.

*** Reason :

HTTP/1.1 200 OK

ate: Sat, 07 Apr 2018 12:I (99163i4:34 ) MATTC_DEMORT: @initialise_wifi has been detected.sk

Backtrace: 0x40090050:0x3ffd4710 0x40090227:0x3ffd4730 0x40090240:0x3ffd4750 0x4008d93b:0x3ffd4770 0x4008f184:0x3ffd4790 0x4008f13a:0x2820456d 0x40090050: invoke_abort at /home/raimundo/esp/esp-idf/com ponents/esp32/./panic.c:648

0x40090227: abort at /home/raimundo/esp/esp-idf/com ponents/esp32/./panic.c:648

0x40090240: vApplicationStackOverflowHook at /home/raimundo/esp/esp-idf/components/esp32/./panic.c:648

0x4008d93b: vTaskSwitchContext at /home/raimundo/esp/esp-idf/com ponents/freertos/./tasks.c:3529

0x4008f184: _frxt_dispatch at /home/raimundo/esp/esp-idf/com ponents/freertos/./portasm.S:406

0x4008f13a: _frxt_int_exit at /home/raimundo/esp/esp-idf/com ponents/freertos/./portasm.S:206

Rebooting... ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0018,len:4 load:0x3fff001c,len:5664 ho 0 tail 12 room 4 load:0x40078000,len:0 load:0x40078000,len:13912 entry 0x40078fd8 I (30) boot: ESP-IDF v3.1-dev-601-gda27816-dirty 2nd stage bootloader I (30) boot: compile time 00:29:53 I (32) boot: Enabling RNG early entropy source... I (37) boot: SPI Speed : 40MHz I (41) boot: SPI Mode : DIO I (45) boot: SPI Flash Size : 4MB I (49) boot: Partition Table: I (53) boot: ## Label Usage Type ST Offset Length I (60) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (68) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (75) boot: 2 factory factory app 00 00 00010000 00180000 I (83) boot: End of partition table I (87) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x35dec (220652) map I (172) esp_image: segment 1: paddr=0x00045e14 vaddr=0x3ffc0000 size=0x03548 ( 13640) load I (178) esp_image: segment 2: paddr=0x00049364 vaddr=0x40080000 size=0x00400 ( 1024) load 0x40080000: _iram_start at /home/raimundo/esp/esp-idf/com ponents/freertos/./xtensa_vectors.S:1685

I (179) esp_image: segment 3: paddr=0x0004976c vaddr=0x40080400 size=0x068a4 ( 26788) load I (199) esp_image: segment 4: paddr=0x00050018 vaddr=0x400d0018 size=0xae7d4 (714708) map 0x400d0018: _stext at ??:?

I (447) esp_image: segment 5: paddr=0x000fe7f4 vaddr=0x40086ca4 size=0x0bba8 ( 48040) load 0x40086ca4: r_rwble_isr at ??:?

I (467) esp_image: segment 6: paddr=0x0010a3a4 vaddr=0x400c0000 size=0x00000 ( 0) load I (478) boot: Loaded app from partition at offset 0x10000 I (478) boot: Disabling RNG early entropy source... I (479) cpu_start: Pro cpu up. I (483) cpu_start: Starting app cpu, entry point is 0x40080f94 0x40080f94: call_start_cpu1 at /home/raimundo/esp/esp-idf/com ponents/esp32/./cpu_start.c:225

I (474) cpu_start: App cpu up. I (493) heap_init: Initializing. RAM available for dynamic allocation: I (500) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM I (506) heap_init: At 3FFD0788 len 0000F878 (62 KiB): DRAM I (512) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM I (519) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM I (525) heap_init: At 4009284C len 0000D7B4 (53 KiB): IRAM I (531) cpu_start: Pro cpu start user code I (214) cpu_start: Starting scheduler on PRO CPU. I (0) cpu_start: Starting scheduler on APP CPU. I (263) BTDM_INIT: BT controller compile version [8c18895]

I (263) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE I (343) phy: phy_version: 383.0, 79a622c, Jan 30 2018, 15:38:06, 0, 0 I (613) GATTC_DEMO: REG_EVT I (613) GATTC_DEMO: scan start success I (613) wifi: wifi firmware version: c202b34 I (613) wifi: config NVS flash: enabled I (613) wifi: config nano formating: disabled I (613) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE I (623) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE I (653) wifi: Init dynamic tx buffer num: 32 I (653) wifi: Init data frame dynamic rx buffer num: 32 I (653) wifi: Init management frame dynamic rx buffer num: 32 I (663) wifi: wifi driver task: 3ffd2a8c, prio:23, stack:4096 I (663) wifi: Init static rx buffer num: 10 I (663) wifi: Init dynamic rx buffer num: 32 I (673) wifi: wifi power manager task: 0x3ffdddcc prio: 21 stack: 2560 I (683) WIFI...: Setting WiFi configuration SSID REG... I (693) wifi: mode : sta (30:ae:a4:05:78:c4) xPortGetFreeHeapSize :69824 I (803) GATTC_DEMO: ac 23 3f 23 91 7a I (803) GATTC_DEMO: searched Adv Data Len 29, Scan Response Len 0 I (803) GATTC_DEMO: searched Device Name Len 0 I (813) GATTC_DEMO:

NEXT REBOOT FOUND:

HTTP/1.1 200 OK Guru Meditation Error: Core 1 panic'ed (StoreProhibited) . Exception was unhandled. Core 1 register dump: PC : 0x4008f22e PS : 0x00050033 A0 : 0x4008f137 A1 : 0x3ffd4780 0x4008f22e: vPortYieldFromInt at /home/raimundo/esp/esp-idf/com ponents/freertos/./portasm.S:595

0x4008f137: _frxt_int_exit at /home/raimundo/esp/esp-idf/com ponents/freertos/./portasm.S:206

A2 : 0x0000000a A3 : 0x00000000 A4 : 0x000001f8 A5 : 0x3ffc0be0 A6 : 0x00000001 A7 : 0x80000001 A8 : 0x40082509 A9 : 0x00000001 0x40082509: _xt_lowint1 at /home/raimundo/esp/esp-idf/com ponents/freertos/./xtensa_vectors.S:1098

A10 : 0x00060021 A11 : 0x00000000 A12 : 0x8008d47a A13 : 0x3ffc0bd0 A14 : 0x3ffc0c18 A15 : 0x00000001 SAR : 0x00000017 EXCCAUSE: 0x0000001d EXCVADDR: 0x0000000a LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000

Backtrace: 0x4008f22e:0x3ffd4780 0x4008f134:0x3ffd4790 0x4008f22e: vPortYieldFromInt at /home/raimundo/esp/esp-idf/com ponents/freertos/./portasm.S:595

0x4008f134: _frxt_int_exit at /home/raimundo/esp/esp-idf/com ponents/freertos/./portasm.S:205

Rebooting... ets Jun 8 2016 00:22:57

NEXT REBOOT FOUND:

I (822723) GATTC_DEMO: abort() was called at PC 0x40082d4b on core 0 0x40082d4b: lock_init_generic at /home/raimundo/esp/esp-idf/com ponents/newlib/./locks.c:81

Backtrace: 0x40090050:0x3ffc0140 0x40090227:0x3ffc0160 0x40082d4b:0x3ffc0180 0x40082d6c:0x3ffc01a0 0x40082eb1:0x3ffc01d0 0x400d971f:0x3ffc01f0 0x400d54a9:0x3ffc04b0 0x400d5438:0x3ffc0500 0x4008dc97:0x3ffc0530 0x4008cfe1:0x3ffc0550 0x40088e8a:0x3ffc0570 0x40088639:0x3ffc05c0 0x4008b639:0x3ffc05e0 0x40082561:0x3ffc0610 0x4000c3eb:0x00000000 0x40090050: invoke_abort at /home/raimundo/esp/esp-idf/com ponents/esp32/./panic.c:648

0x40090227: abort at /home/raimundo/esp/esp-idf/com ponents/esp32/./panic.c:648

0x40082d4b: lock_init_generic at /home/raimundo/esp/esp-idf/com ponents/newlib/./locks.c:81

0x40082d6c: lock_acquire_generic at /home/raimundo/esp/esp-idf/com ponents/newlib/./locks.c:132

0x40082eb1: _lock_acquire_recursive at /home/raimundo/esp/esp-idf/com ponents/newlib/./locks.c:169

0x400d971f: _vfiprintf_r at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/std io/../../../.././newlib/libc/stdio/vfprintf.c:859 (discriminator 9)

0x400d54a9: fiprintf at /Users/ivan/e/newlib_xtensa-2.2.0-bin /newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/std io/../../../.././newlib/libc/stdio/fiprintf.c:49

0x400d5438: __assert_func at /Users/ivan/e/newlib_xtensa-2. 2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/std lib/../../../.././newlib/libc/stdlib/assert.c:58

0x4008dc97: vPortCPUAcquireMutexIntsDisabledInternal at /home/raimundo/esp/esp-idf/components/freertos/./tasks.c:3529 (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/raimundo/esp/esp-idf/components/freertos/./portmux_impl.h:98 (inlined by) vTaskEnterCritical at /home/raimundo/esp/esp-idf/com ponents/freertos/./tasks.c:4216

0x4008cfe1: xQueueGenericSendFromISR at /home/raimundo/esp/esp-idf/com ponents/freertos/./queue.c:2037

0x40088e8a: pp_post at ??:?

0x40088639: lmacPostTxComplete at ??:?

0x4008b639: wDev_ProcessFiq at ??:?

0x40082561: _xt_lowint1 at /home/raimundo/esp/esp-idf/com ponents/freertos/./xtensa_vectors.S:1105

Rebooting... ets Jun 8 2016 00:22:57

On Fri, Apr 6, 2018 at 11:07 PM, TimXia notifications@github.com wrote:

@perll https://github.com/perll The issue is caused by the bug of WiFi and BLE coexistence. I suggest to update with the latest IDF which improves the stability of WiFi and BLE coexistence.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/espressif/esp-idf/issues/1774#issuecomment-379424803, or mute the thread https://github.com/notifications/unsubscribe-auth/ALo6NQW0BiR5xIG06u0Ko-8qlVjUyfIgks5tmB97gaJpZM4S7C7o .

On Fri, Apr 6, 2018 at 11:07 PM, TimXia notifications@github.com wrote:

@perll https://github.com/perll The issue is caused by the bug of WiFi and BLE coexistence. I suggest to update with the latest IDF which improves the stability of WiFi and BLE coexistence.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/espressif/esp-idf/issues/1774#issuecomment-379424803, or mute the thread https://github.com/notifications/unsubscribe-auth/ALo6NQW0BiR5xIG06u0Ko-8qlVjUyfIgks5tmB97gaJpZM4S7C7o .

TimXia commented 6 years ago

@perll Can you show me your sdkconfig file?

@liuzfesp Is the last crash log similar to the bug that you are fixing? (allocate queue in psram)

perll commented 6 years ago

Sure! Attached.

Yes. I've getting same errors again. Today, I got "IP LOST" (I (2140007) event: station ip lost).

Just remembering, There are 4 esp wroom32 working at same time in the same net wifi.

In fact, after the last update, I was able to increase the working time of the ESP Wroom32. The amount of reboots has decreased significantly. But, there is still a reboot at least 10 times in an hour and today, 2 of 4 espwroom32 have stopped and the reason was LOST IP.

Regards!

On Mon, Apr 9, 2018 at 11:02 PM, TimXia notifications@github.com wrote:

@perll https://github.com/perll Can you show me your sdkconfig file?

@liuzfesp https://github.com/liuzfesp Is the last crash log similar to the bug that you are fixing? (allocate queue in psram)

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/espressif/esp-idf/issues/1774#issuecomment-379949749, or mute the thread https://github.com/notifications/unsubscribe-auth/ALo6NYHsHHM8zKJzUuLkAVliXG-nbrZRks5tnBKygaJpZM4S7C7o .

perll commented 6 years ago

I (1254743) WIFI...: ... done reading from socket. Last read return=0 errno=128

I (1254753) WIFI...: 10... I (1255763) WIFI...: 9... I (1256763) WIFI...: 8... I (1257763) WIFI...: 7... I (1258763) WIFI...: 6... I (1259763) WIFI...: 5... I (1260763) WIFI...: 4... I (1261763) WIFI...: 3... I (1262763) WIFI...: 2... I (1263763) WIFI...: 1... I (1264763) WIFI...: 0... I (1265763) WIFI...: Starting again! I (1265763) WIFI...: Connected to AP I (1265763) WIFI...: DNS lookup succeeded. IP=50.30.38.132 I (1265763) WIFI...: ... allocated socket I (1271763) wifi: bcn_timout,ap_probe_send_start I (1274263) wifi: ap_probe_send over, resett wifi status to disassoc I (1274263) wifi: state: run -> init (1) I (1274263) wifi: pm stop, total sleep time: 0/68137917

I (1274263) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1 I (1303373) event: station ip lost

On Mon, Apr 9, 2018 at 11:02 PM, TimXia notifications@github.com wrote:

@perll https://github.com/perll Can you show me your sdkconfig file?

@liuzfesp https://github.com/liuzfesp Is the last crash log similar to the bug that you are fixing? (allocate queue in psram)

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/espressif/esp-idf/issues/1774#issuecomment-379949749, or mute the thread https://github.com/notifications/unsubscribe-auth/ALo6NYHsHHM8zKJzUuLkAVliXG-nbrZRks5tnBKygaJpZM4S7C7o .

perll commented 6 years ago

Sir,

some news about the fix for my issues?

Regards!

On Tue, Apr 10, 2018 at 11:18 AM, Raimundo Miranda Neto < rs.miranda.neto@gmail.com> wrote:

I (1254743) WIFI...: ... done reading from socket. Last read return=0 errno=128

I (1254753) WIFI...: 10... I (1255763) WIFI...: 9... I (1256763) WIFI...: 8... I (1257763) WIFI...: 7... I (1258763) WIFI...: 6... I (1259763) WIFI...: 5... I (1260763) WIFI...: 4... I (1261763) WIFI...: 3... I (1262763) WIFI...: 2... I (1263763) WIFI...: 1... I (1264763) WIFI...: 0... I (1265763) WIFI...: Starting again! I (1265763) WIFI...: Connected to AP I (1265763) WIFI...: DNS lookup succeeded. IP=50.30.38.132 I (1265763) WIFI...: ... allocated socket I (1271763) wifi: bcn_timout,ap_probe_send_start I (1274263) wifi: ap_probe_send over, resett wifi status to disassoc I (1274263) wifi: state: run -> init (1) I (1274263) wifi: pm stop, total sleep time: 0/68137917

I (1274263) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1 I (1303373) event: station ip lost

On Mon, Apr 9, 2018 at 11:02 PM, TimXia notifications@github.com wrote:

@perll https://github.com/perll Can you show me your sdkconfig file?

@liuzfesp https://github.com/liuzfesp Is the last crash log similar to the bug that you are fixing? (allocate queue in psram)

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/espressif/esp-idf/issues/1774#issuecomment-379949749, or mute the thread https://github.com/notifications/unsubscribe-auth/ALo6NYHsHHM8zKJzUuLkAVliXG-nbrZRks5tnBKygaJpZM4S7C7o .

perll commented 6 years ago

I updated with last master git version but, unfortunally now, the wifi connection stopped after 10'. And there isn't log message. Is not possible known what is wrong.

On Wed, Apr 11, 2018 at 6:41 AM, Raimundo Miranda Neto < rs.miranda.neto@gmail.com> wrote:

Sir,

some news about the fix for my issues?

Regards!

On Tue, Apr 10, 2018 at 11:18 AM, Raimundo Miranda Neto < rs.miranda.neto@gmail.com> wrote:

I (1254743) WIFI...: ... done reading from socket. Last read return=0 errno=128

I (1254753) WIFI...: 10... I (1255763) WIFI...: 9... I (1256763) WIFI...: 8... I (1257763) WIFI...: 7... I (1258763) WIFI...: 6... I (1259763) WIFI...: 5... I (1260763) WIFI...: 4... I (1261763) WIFI...: 3... I (1262763) WIFI...: 2... I (1263763) WIFI...: 1... I (1264763) WIFI...: 0... I (1265763) WIFI...: Starting again! I (1265763) WIFI...: Connected to AP I (1265763) WIFI...: DNS lookup succeeded. IP=50.30.38.132 I (1265763) WIFI...: ... allocated socket I (1271763) wifi: bcn_timout,ap_probe_send_start I (1274263) wifi: ap_probe_send over, resett wifi status to disassoc I (1274263) wifi: state: run -> init (1) I (1274263) wifi: pm stop, total sleep time: 0/68137917

I (1274263) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1 I (1303373) event: station ip lost

On Mon, Apr 9, 2018 at 11:02 PM, TimXia notifications@github.com wrote:

@perll https://github.com/perll Can you show me your sdkconfig file?

@liuzfesp https://github.com/liuzfesp Is the last crash log similar to the bug that you are fixing? (allocate queue in psram)

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/espressif/esp-idf/issues/1774#issuecomment-379949749, or mute the thread https://github.com/notifications/unsubscribe-auth/ALo6NYHsHHM8zKJzUuLkAVliXG-nbrZRks5tnBKygaJpZM4S7C7o .

perll commented 6 years ago

Sir,

could you help me:

E (109) boot: ota data partition invalid, falling back to factory I (116) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x36bd0 (224208) map I (203) esp_image: segment 1: paddr=0x00046bf8 vaddr=0x3ffc0000 size=0x03ae8 ( 15080) load I (209) esp_image: segment 2: paddr=0x0004a6e8 vaddr=0x40080000 size=0x00400 ( 1024) load 0x40080000: _iram_start at /home/raimundo/esp/esp-idf/components/freertos/./xtensa_vectors.S:1685

I (210) esp_image: segment 3: paddr=0x0004aaf0 vaddr=0x40080400 size=0x05520 ( 21792) load I (228) esp_image: segment 4: paddr=0x00050018 vaddr=0x400d0018 size=0xb2fd0 (733136) map 0x400d0018: _stext at ??:?

I (485) esp_image: segment 5: paddr=0x00102ff0 vaddr=0x40085920 size=0x0e314 ( 58132) load 0x40085920: r_lld_evt_restart at ??:?

I (509) esp_image: segment 6: paddr=0x0011130c vaddr=0x400c0000 size=0x00000 ( 0) load E (510) esp_image: Image length 1053488 doesn't fit in partition length 1048576 E (515) boot: Factory app partition is not bootable E (521) esp_image: image at 0x110000 has invalid magic byte E (527) boot: OTA app partition slot 0 is not bootable E (533) esp_image: image at 0x210000 has invalid magic byte W (539) esp_image: image at 0x210000 has invalid SPI mode 255 W (545) esp_image: image at 0x210000 has invalid SPI size 15 E (552) boot: OTA app partition slot 1 is not bootable E (557) boot: No bootable app partitions in the partition table user code done

On Wed, Apr 11, 2018 at 7:37 AM, Raimundo Miranda Neto < rs.miranda.neto@gmail.com> wrote:

I updated with last master git version but, unfortunally now, the wifi connection stopped after 10'. And there isn't log message. Is not possible known what is wrong.

On Wed, Apr 11, 2018 at 6:41 AM, Raimundo Miranda Neto < rs.miranda.neto@gmail.com> wrote:

Sir,

some news about the fix for my issues?

Regards!

On Tue, Apr 10, 2018 at 11:18 AM, Raimundo Miranda Neto < rs.miranda.neto@gmail.com> wrote:

I (1254743) WIFI...: ... done reading from socket. Last read return=0 errno=128

I (1254753) WIFI...: 10... I (1255763) WIFI...: 9... I (1256763) WIFI...: 8... I (1257763) WIFI...: 7... I (1258763) WIFI...: 6... I (1259763) WIFI...: 5... I (1260763) WIFI...: 4... I (1261763) WIFI...: 3... I (1262763) WIFI...: 2... I (1263763) WIFI...: 1... I (1264763) WIFI...: 0... I (1265763) WIFI...: Starting again! I (1265763) WIFI...: Connected to AP I (1265763) WIFI...: DNS lookup succeeded. IP=50.30.38.132 I (1265763) WIFI...: ... allocated socket I (1271763) wifi: bcn_timout,ap_probe_send_start I (1274263) wifi: ap_probe_send over, resett wifi status to disassoc I (1274263) wifi: state: run -> init (1) I (1274263) wifi: pm stop, total sleep time: 0/68137917

I (1274263) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1 I (1303373) event: station ip lost

On Mon, Apr 9, 2018 at 11:02 PM, TimXia notifications@github.com wrote:

@perll https://github.com/perll Can you show me your sdkconfig file?

@liuzfesp https://github.com/liuzfesp Is the last crash log similar to the bug that you are fixing? (allocate queue in psram)

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/espressif/esp-idf/issues/1774#issuecomment-379949749, or mute the thread https://github.com/notifications/unsubscribe-auth/ALo6NYHsHHM8zKJzUuLkAVliXG-nbrZRks5tnBKygaJpZM4S7C7o .

perll commented 6 years ago

Some news about ip lost issue?

Regards

On Sat, Mar 31, 2018, 22:36 TimXia notifications@github.com wrote:

@eflukx https://github.com/eflukx @perll https://github.com/perll The bugfix is merging. Due to the gitlab server is maintaining this weekend, it will be merged next monday.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/espressif/esp-idf/issues/1774#issuecomment-377736142, or mute the thread https://github.com/notifications/unsubscribe-auth/ALo6NfCTWn6q5RpWJlKaXVw67e7tWbXyks5tkC82gaJpZM4S7C7o .

TimXia commented 6 years ago

@perll We have improved the coexistence of WiFi and BT. Please use the latest IDF to test. BTW, could you please provide your code by an attached file?

perll commented 6 years ago

Tku, sir! ASAP I will proceed the tests and return you

On Tue, May 22, 2018, 00:16 TimXia notifications@github.com wrote:

@perll https://github.com/perll We have improved the coexistence of WiFi and BT. Please use the latest IDF to test. BTW, could you please provide your code by an attached file?

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/espressif/esp-idf/issues/1774#issuecomment-390849955, or mute the thread https://github.com/notifications/unsubscribe-auth/ALo6NSDjyrX39exVaq1ppJkAkbm7eEZbks5t04MjgaJpZM4S7C7o .