These are chat archives for esp8266/Arduino

3rd
Apr 2016
Ali
@UmutAlihan
Apr 03 2016 01:05
@martinayotte Solved... Thanks!
Martin Ayotte
@martinayotte
Apr 03 2016 02:43
@UmutAlihan , Welcome !
andig
@andig
Apr 03 2016 08:50
@igrr thanks for lwip, will test and let you know, hopefully today
andig
@andig
Apr 03 2016 10:21

@igrr, @me-no-dev I have done a first test of sdk 1.5.2 with lwip_gcc. I'm still seeing crashes when aborting tcp connections (that is reloading a page in browser before load has finished). This is what I see:

Switched to a new branch 'sdk-1.5.2'

Sketch uses 298,464 bytes (28%) of program storage space. Maximum is 1,044,464 bytes.
Global variables use 38,040 bytes (46%) of dynamic memory, leaving 43,880 bytes for local variables. Maximum is 81,920 bytes.

llwip -> llwip_gcc

Sketch uses 297,496 bytes (28%) of program storage space. Maximum is 1,044,464 bytes.
Global variables use 38,294 bytes (46%) of dynamic memory, leaving 43,626 bytes for local variables. Maximum is 81,920 bytes.


Decoding 32 results
0x4010011d: umm_assimilate_up at C:\andi\arduino\hardware\esp8266com\esp8266\cores\esp8266\umm_malloc/umm_malloc.c:1161
0x40034fe0: ?? ??:0
0x4010011d: umm_assimilate_up at C:\andi\arduino\hardware\esp8266com\esp8266\cores\esp8266\umm_malloc/umm_malloc.c:1161
0x40034fe0: ?? ??:0
0x4020bd68: operator() at C:\andi\arduino\hardware\esp8266com\esp8266\libraries\ESPAsyncWebServer\src/WebRequest.cpp:568
 (inlined by) _M_invoke at c:\andi\arduino\hardware\esp8266com\esp8266\tools\xtensa-lx106-elf\xtensa-lx106-elf\include\c++\4.8.2/functional:2071
0x401003e1: check_poison_block at C:\andi\arduino\hardware\esp8266com\esp8266\cores\esp8266\umm_malloc/umm_malloc.c:835
0x4010020c: _umm_free at C:\andi\arduino\hardware\esp8266com\esp8266\cores\esp8266\umm_malloc/umm_malloc.c:1285
0x4020f478: AsyncClient::_s_error(void*, signed char) at C:\andi\arduino\hardware\esp8266com\esp8266\libraries\ESPAsyncTCP\src/ESPAsyncTCP.cpp:506 (discriminator 4)
0x401008c8: free at C:\andi\arduino\hardware\esp8266com\esp8266\cores\esp8266\umm_malloc/umm_malloc.c:1731
0x4020f478: AsyncClient::_s_error(void*, signed char) at C:\andi\arduino\hardware\esp8266com\esp8266\libraries\ESPAsyncTCP\src/ESPAsyncTCP.cpp:506 (discriminator 4)
0x40107154: vPortFree at C:\andi\arduino\hardware\esp8266com\esp8266\cores\esp8266/heap.c:18
0x4020f478: AsyncClient::_s_error(void*, signed char) at C:\andi\arduino\hardware\esp8266com\esp8266\libraries\ESPAsyncTCP\src/ESPAsyncTCP.cpp:506 (discriminator 4)
0x4022753d: tcp_abandon at /Users/igrokhotkov/projects/esp8266/esp_iot_sdk_v1.5.2/app/lwip/core/tcp.c:388
0x40227556: tcp_abort at /Users/igrokhotkov/projects/esp8266/esp_iot_sdk_v1.5.2/app/lwip/core/tcp.c:404
0x4020efc9: AsyncClient::abort() at C:\andi\arduino\hardware\esp8266com\esp8266\libraries\ESPAsyncTCP\src/ESPAsyncTCP.cpp:506 (discriminator 4)
0x4020f2b9: AsyncClient::_close() at C:\andi\arduino\hardware\esp8266com\esp8266\libraries\ESPAsyncTCP\src/ESPAsyncTCP.cpp:506 (discriminator 4)
0x4020f314: AsyncClient::_recv(tcp_pcb*, pbuf*, signed char) at C:\andi\arduino\hardware\esp8266com\esp8266\libraries\ESPAsyncTCP\src/ESPAsyncTCP.cpp:506 (discriminator 4)
0x40230000: user_uart_wait_tx_fifo_empty at ??:?
0x40107154: vPortFree at C:\andi\arduino\hardware\esp8266com\esp8266\cores\esp8266/heap.c:18
0x4020f3af: AsyncClient::_s_recv(void*, tcp_pcb*, pbuf*, signed char) at C:\andi\arduino\hardware\esp8266com\esp8266\libraries\ESPAsyncTCP\src/ESPAsyncTCP.cpp:506 (discriminator 4)
0x40228add: tcp_input at /Users/igrokhotkov/projects/esp8266/esp_iot_sdk_v1.5.2/app/lwip/core/tcp_in.c:416 (discriminator 1)
0x40107144: pvPortMalloc at C:\andi\arduino\hardware\esp8266com\esp8266\cores\esp8266/heap.c:13
0x40225af5: ip_input at /Users/igrokhotkov/projects/esp8266/esp_iot_sdk_v1.5.2/app/lwip/core/ipv4/ip.c:559
0x4010020c: _umm_free at C:\andi\arduino\hardware\esp8266com\esp8266\cores\esp8266\umm_malloc/umm_malloc.c:1285
0x40213ef7: pp_enable_noise_timer at ??:?
0x40225111: ethernet_input at /Users/igrokhotkov/projects/esp8266/esp_iot_sdk_v1.5.2/app/lwip/netif/etharp.c:1379
0x40105bd6: wdt_feed at ??:?
0x40230db0: ets_timer_handler_isr at ??:?
0x40230dd6: ets_timer_handler_isr at ??:?
0x402309fb: ets_snprintf at ??:?
0x40000f49: ?? ??:0
0x40000f49: ?? ??:0
program space actually seems better with gcc
Stavros Korokithakis
@skorokithakis
Apr 03 2016 22:05
hey guys
i have a code question
i noticed that i always have some boilerplate code for wifi/mqtt/other things in every project
i think it's pretty complicated to refactor out into a library, but i want to have a file like myprogram.c where i can define my_setUp, my_loop() and a few more hooks
can someone give me some sample code of what i'd have to write into this file and how i could call it from the actual loop(), say?
i've tried just #importing but the compiler doesn't like that