These are chat archives for esp8266/Arduino

30th
Jun 2015
Holger Lembke
@holgerlembke
Jun 30 2015 09:54
igrr, how to debug those wdt-resets?
 ets Jan  8 2013,rst cause:4, boot mode:(1,7)
wdt reset
Ivan Grokhotkov
@igrr
Jun 30 2015 10:09
try to isolate the piece of code that triggers them
Holger Lembke
@holgerlembke
Jun 30 2015 10:13
lol, yes.
I have a web client requesting things while I'm in a for-loop.
client requesting about 3 times/second. loop runs about 10 seconds.
if I stop the client, loop runs through... otherwise it randomly crashes
Me No Dev
@me-no-dev
Jun 30 2015 10:17
you overflow the network buffers
Holger Lembke
@holgerlembke
Jun 30 2015 10:18
so how to avoid this?
Me No Dev
@me-no-dev
Jun 30 2015 10:19
call yield() at the end of each loop in the for-loop
even though... that might not help...
maybe also check the client in the loop
Holger Lembke
@holgerlembke
Jun 30 2015 10:21
yield doesn't help.
Me No Dev
@me-no-dev
Jun 30 2015 10:21
you use server.hadle() to parse the client requests right?
if so, call that in the for loop so it can handle the incomming requests
if that is possible
Holger Lembke
@holgerlembke
Jun 30 2015 10:27
ok, with server.handleClient(); it runs through. at least once.
I'm not sure what to think about that... unhandled server request shouldn't reboot.
Me No Dev
@me-no-dev
Jun 30 2015 10:30
they fill the memory and... :) reboot
what do you think should happen?
Holger Lembke
@holgerlembke
Jun 30 2015 10:31
don't accept them.
Me No Dev
@me-no-dev
Jun 30 2015 10:31
that is bad
first you will get another packet
because of TCP
Holger Lembke
@holgerlembke
Jun 30 2015 10:31
no, it is badder when my hardware reboots due to a deny of service attack
Me No Dev
@me-no-dev
Jun 30 2015 10:32
this is not a computar mate :)
this is normal, and it should be handled by you in your app
you do not have threads, so there is nothing to take care to even deny those packets
Holger Lembke
@holgerlembke
Jun 30 2015 10:33
you bro. if there are no threads, where do the packets come from.... :-)
Me No Dev
@me-no-dev
Jun 30 2015 10:34
it came in the hadrware, was dispatched by an interrupt to the buffer and sits there
no ACK is sent to the remote
Holger Lembke
@holgerlembke
Jun 30 2015 10:38
this might become a loop, but...
How to avoid a deny-of-service? How to know how man stuff I can do without calling .handleclient();?
Me No Dev
@me-no-dev
Jun 30 2015 10:42
you don't really :)
we are looking for a way around that problem
I have some success using espconn for some implementations
but is in no way universal
and requires separate parsing and whatnot
Holger Lembke
@holgerlembke
Jun 30 2015 10:50
ok, I start drinking now.
Holger Lembke
@holgerlembke
Jun 30 2015 12:35
This is new...
Exception (9):
epc1=0x40101c5d epc2=0x00000000 epc3=0x00000000 excvaddr=0xe39d239a depc=0x00000000

ctx: cont 
sp: 3ffeb390 end: 3ffeb700 offset: 01a0

>>>stack>>>
3ffeb530:  40211cc4 3ffeb5c0 0000000d 3fff63ab
Ivan Grokhotkov
@igrr
Jun 30 2015 12:55
when i last looked into this, this was due to heap corruption
Holger Lembke
@holgerlembke
Jun 30 2015 12:57
yes, I know. "new" is sometimes a matter of view... :-)
and this heap thing is still bothering me...
Ivan Grokhotkov
@igrr
Jun 30 2015 12:59
did you know that you can roll your own heap management functions, replacing the ones from SDK?
there's a cool feature in GNU linker, called function wrapping
it allows you to override any non-static function without resorting to objdump
Holger Lembke
@holgerlembke
Jun 30 2015 13:01
I remember you mentioned something like that...
Ivan Grokhotkov
@igrr
Jun 30 2015 13:01
so we can do our own heap thing if we think we can do it better
Holger Lembke
@holgerlembke
Jun 30 2015 13:02
not better. (perhaps better...) but avoid the wrong results of heapfree. and some safety features could be nice...
Ivan Grokhotkov
@igrr
Jun 30 2015 13:02
wrong results of heapfree?
Holger Lembke
@holgerlembke
Jun 30 2015 13:03
it gives (summe of free heap) which is quite useless, if you can't assign that size
for diagnostic it would be more usefull to get the smallest free piece.
Holger Lembke
@holgerlembke
Jun 30 2015 13:15
  p=malloc(100);
 if (! p) {Serial.println("Panic, less than 100 bytes free); Serial.println(heapfree()); }
doesn't work (beside all compiler errors...)
Ivan Grokhotkov
@igrr
Jun 30 2015 13:17
oh, okay.
Holger Lembke
@holgerlembke
Jun 30 2015 14:31
any chance to get the post mortem stack dump into line numbers/code references?
Ivan Grokhotkov
@igrr
Jun 30 2015 14:38
you can do it with some python/shell glue
the only caveat being that there is no way to identify stack frames reliably at runtime
on xtensa
so you would take anything which might be a PC and convert it to code reference
in current dump that means taking the rightmost column
filtering values which are between 0x40100000 and 0x40300000
and converting them to code refs using xtensa-lx106-elf-addr2line
Russ Mathis
@RussMathis
Jun 30 2015 18:05
WiFi client not working when using ADC?
Trying to read ADC A0 in loop. Then every so often trying to open telnet port to other device always fails to open. ?
Russ Mathis
@RussMathis
Jun 30 2015 19:33
Note: I've noticed that the chip will not boot if GPIO-02 is held low...
HIGH is OK
Markus
@Links2004
Jun 30 2015 19:33
yes
Russ Mathis
@RussMathis
Jun 30 2015 19:34
Does it have some mode?
Markus
@Links2004
Jun 30 2015 19:34
same for TX
Russ Mathis
@RussMathis
Jun 30 2015 19:34
K, thx
Markus
@Links2004
Jun 30 2015 19:34
no change in mode
but i have no idee why the do it this way.
Russ Mathis
@RussMathis
Jun 30 2015 19:35
Another mystery in the universe.