These are chat archives for esp8266/Arduino

Jul 2016
Stavros Korokithakis
Jul 01 2016 00:53 UTC
@MarcoMengoli it just worked for me
Marco Mengoli
Jul 01 2016 07:36 UTC
@skorokithakis maybe could it be the SPI frequency? My connections are right (followed more than on guide)
Marco Mengoli
Jul 01 2016 09:54 UTC
From the RC522 datasheet, its SPI connection works up to 10MHz, MSB first, clock idle when low and sample the data on the rising edge.
SPI.begin(); //works on Arduino, not on my Sparkfun ESP8266 shield
SPI.begin(); SPI.setClockDivider(SPI_CLOCK_DIV8); //works on Arduino, not on my Sparkfun ESP8266 shield
SPI.beginTransaction(SPISettings(10000000, MSBFIRST, SPI_MODE0)); does not work on both Arduino and ESP
Me No Dev
Jul 01 2016 09:58 UTC
SPI_CLOCK_DIV8 == 2000000 Hz not 10MHz
Jul 01 2016 10:11 UTC

Hi, I am getting this error for my sketch on ESP

If someone knows the cause of it the please share it with me.

<\n>Panic .pioenvs\esp12e\FrameworkArduino\core_esp8266_main.cpp:131 loop_task<\r>
<\n>ctx: sys <\r>
<\n>sp: 3ffffe00 end: 3fffffb0 offset: 01a0<\r>

Me No Dev
Jul 01 2016 10:11 UTC
maybe tell us about your sketch?
the error menas that you are calling delay or yield inside ticker or async network callback
@igrr or is this some other context panic?
Ivan Grokhotkov
Jul 01 2016 10:19 UTC
This message was deleted
scratch that
this is stack overflow check
once in a while (after setup or loop completes) we check if there was stack overflow
check your stack usage, total stack available to the sketch is 4096 bytes.
large arrays allocated on the stack are primary candidates
also check if you accidentally use VLAs somewhere
Jul 01 2016 10:23 UTC
what are VLA's ?
Jul 01 2016 10:46 UTC
I got the free stack where my program crashes by "ESP.getFreeHeap() " and I got it "25360".
Ivan Grokhotkov
Jul 01 2016 11:05 UTC
Free stack? The function is called getFreeHeap, how is that related to stack?
it returns exactly what its name implies, that is free heap.
Jul 01 2016 11:07 UTC
Then how could I get the free stack ?
Ivan Grokhotkov
Jul 01 2016 11:15 UTC
let me see
something like this:
extern "C" {
#include "cont.h" 
extern cont_t g_cont;
loop() {
  size_t free = cont_get_free_stack(&g_cont);
  // etc
but, the point is, it only tells you how much you have at the point of the call. but then next function you call can request a lot of space on the stack and overflow it.
actually it would be much easier if you would post your sketch.
or better, a link to it
Jul 01 2016 11:26 UTC
I put it at the point of crash and I got now free stack of 32.
So it means stack overflow would be a reason?
How much it should be ?
Ivan Grokhotkov
Jul 01 2016 11:44 UTC
Total stack is 4096
So if you have 32 bytes left it means that you have used pretty much all of it.
Mehrdad K
Jul 01 2016 20:44 UTC
can anyone tell what meaning of following debug report is , after download the file my connection lost and try reconnect to modem

state: 2 -> 0 (0)
f r0, scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 1

connected with myModem, channel 1
dhcp client start...
pm open,type:2 0