These are chat archives for esp8266/Arduino

23rd
Aug 2018
diraniyoussef
@diraniyoussef
Aug 23 2018 18:27
@a-c-sreedhar-reddy have to provide more info
diraniyoussef
@diraniyoussef
Aug 23 2018 18:35

A new thread by me
Hi first,
Using AsyncClient from #include "ESPAsyncTCP.h", the NodeMCU connects to a remote server on the Internet using
.connect( IP, port);
This call is fine.
2 minutes later, I make the same call to another port on the remote server.
But it crashes.
Using ESP Exception Decoder I understood all that...
I will post the result of the ESP Exception Decoder

Exception 28: LoadProhibited: A load referenced a page mapped with an attribute that does not permit loads
PC: 0x4020d6ec: tcp_new_port at core/tcp.c line 851
EXCVADDR: 0x0213001a

Decoding stack results
0x4020d67c: memp_malloc at core/memp.c line 404
0x4020e272: tcp_alloc at core/tcp.c line 1569
0x402053a8: AsyncClient::connect(IPAddress, unsigned short) at C:\Users\Dirani\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp line 134
0x402053f0: AsyncClient::connect(char const*, unsigned short) at C:\Users\Dirani\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp line 148
there are some more lines but not relevant

Any suggestions?
Me No Dev
@me-no-dev
Aug 23 2018 18:37
you are out of ram
diraniyoussef
@diraniyoussef
Aug 23 2018 18:37
I know but why?
Me No Dev
@me-no-dev
Aug 23 2018 18:38
based on what you posted, nobody can really say :)
diraniyoussef
@diraniyoussef
Aug 23 2018 18:39
It's really just after 2 minutes I simply connect to another port
Nothing is wrong with tcp.c you mean?
It is repeated on and on, the same lines appear in ESP Exception Decoder
diraniyoussef
@diraniyoussef
Aug 23 2018 18:44
Speaking about RAM, I have declared 8 integers (int) and 8 booleans as volatile. I will remove the "volatile" keyword from the integers and try again.
diraniyoussef
@diraniyoussef
Aug 23 2018 20:04
@me-no-dev your hint was useful till now
I updated something in the code and it's better (till now)
I moved some declarations out of the heap into the stack
Perhaps the only valuable error I noticed is a simple char buffer that wasn't deleted (by initiating delete[] ...) and this wasn't called very often... Nevertheless