These are chat archives for esp8266/Arduino

9th
Apr 2016
Martin Ayotte
@martinayotte
Apr 09 2016 01:11
Anyone knows a link to Arduino IDE development where it is describes all the keywords for the platform.txt parsing and resolution ?
(I'm trying to figure out some discrepancies between seen 1.6.5 and 1.6.8, not ESP specific, but in general for third party MCU)
Martin Ayotte
@martinayotte
Apr 09 2016 01:38
BTW, if anyone knows, why with 1.6.8 the "-o {object_file}" been extanded to "-o /dev/null" ? :-(
Raph Hennessy
@raphydaphy
Apr 09 2016 02:06
Hi! Can i send MQTT data direct from a esp8266 connected to a sensor to a raspberry pi? Or do i need another esp8266 connected to the pi to recieve the data?
Keith Andrew Hill
@vic10us
Apr 09 2016 02:08
@raphydaphy you need a running MQTT server available on the same network. It could even be running in the raspberry Pi. But you do not need another esp8266.
Raph Hennessy
@raphydaphy
Apr 09 2016 02:09
yeah i have the mqtt server running on the pi so that should be good. Thanks! Some tutorial i found said i needed 2 ESP boards
Victor Tseng
@Palatis
Apr 09 2016 02:55
@raphydaphy well you publish to some topic and no one subscribes it it's a lonely operation.
Raph Hennessy
@raphydaphy
Apr 09 2016 09:16
Hopperpop
@Hopperpop
Apr 09 2016 09:45
@raphydaphy He is using the same esp board, so it should work.
Raph Hennessy
@raphydaphy
Apr 09 2016 09:49
alright thx :)
i wasnt sure if it was the same cuz there are lots of esp boards
Hopperpop
@Hopperpop
Apr 09 2016 09:55
It's the most basic esp board. Everything you do with this one, can be done with other ones.
Hopperpop
@Hopperpop
Apr 09 2016 10:02

I have another problem. Sometimes my Esp throws this error out:

Panic C:\Users\Bob\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266\core_esp8266_main.cpp:117 loop_task

ctx: sys 
sp: 3ffffdd0 end: 3fffffb0 offset: 01b0

>>>stack>>>
3fffff80:  40247d66 3fffdab0 00000000 3fff1a40  
3fffff90:  00000000 3fffdad0 3fff1a2c 40220361  
3fffffa0:  40000f49 40000f49 3fffdab0 40000f49  
<<<stack<<<

Decoding 5 results
0x40247d66: ets_timer_handler_isr at ??:?
0x40220361: loop_task at C:\Users\Bob\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266/core_esp8266_main.cpp:43
0x40000f49: ?? ??:0
0x40000f49: ?? ??:0
0x40000f49: ?? ??:0

When I look into the code, it seems to me that the stackguard gets corrupted. First I was thinking about a buffer overflow, but I haven't found one jet. Now I have the idea that maybe my stack is getting to big. I'm not an expert in stuff, so it would be great if someone can push me in the correct direction.

Victor Tseng
@Palatis
Apr 09 2016 13:26
u got mem leak?
like new-ed but not deleted?
Hopperpop
@Hopperpop
Apr 09 2016 15:28
I don't think so, there isn't anything allocated and my heap looks stable. The code runs fine. It's called multiple times without any problems. If it really was a memory leak, it should crash more often.
When it gets new data, it does some calculations and then it crash. I haven't find a way to recreate the crash. I can only wait until it happens and that's two times a day.
Hopperpop
@Hopperpop
Apr 09 2016 16:27
I managed to recreate it. I added this code to one of the first functions that's been called. It execute the code and calls some other functions, and than it gives me the same error as before.
My theorie that the stack is getting to big could be correct.
char dummy[820];
dummy[819] = '\0';
Serial.println(dummy + 810);
Martin Ayotte
@martinayotte
Apr 09 2016 17:26
What is that code ? "dummy + 810" is simply adding 810 to pointer, so it will println only the last 10 chars of that buffer, but the contain is unkown since it never been really initialized ...
Michael Miller
@Makuna
Apr 09 2016 17:28
@ystrem did you see that it was a preorder item?
ystrem
@ystrem
Apr 09 2016 17:29
nope
:+1:
Martin Ayotte
@martinayotte
Apr 09 2016 17:34
In case they run out of stock, I' ve just placed my order, even if in pre-order for 60 days.
Victor Tseng
@Palatis
Apr 09 2016 17:40
@Hopperpop so it prints at max 9 trash chars to the serial? try initialize dummy[810]~dummy[818] inclusive, and see what happens.
i dunt think you're running out of heap just by allocating 820 chars, try ESP.getFreeHeap()
Hopperpop
@Hopperpop
Apr 09 2016 17:42
I know it's garbage. I just want to add something to the stack to see if it creates the error, and it did.
Victor Tseng
@Palatis
Apr 09 2016 17:43
can you add these 2 lines to the very beginning of setup() and see what's the reboot reasons?
  Serial.println(ESP.getResetReason());
  Serial.println(ESP.getResetInfo());
and you can check the exception codes here http://0x04.net/~mwk/doc/xtensa.pdf
chap 4.4.1.5
Hopperpop
@Hopperpop
Apr 09 2016 18:02
I get this:
Software Watchdog
Fatal exception:4 flag:3 (SOFT_WDT) epc1:0x40201fdc epc2:0x00000000 epc3:0x00000000 excvaddr:0x00000000 depc:0x00000000
But the arduino core creates a panic here: L117
Victor Tseng
@Palatis
Apr 09 2016 18:08
u put those dummy codes in loop()?
or setup()?
because mine didn't crash, and is running fine.
void setup() {
  Serial.begin(74880);
  Serial.setDebugOutput(true);
  Serial.println();

  Serial.println(ESP.getResetReason());
  Serial.println(ESP.getResetInfo());

  Serial.print("Free heap before: ");
  Serial.println(ESP.getFreeHeap());
  char dummy[820];
  Serial.print("Free heap after: ");
  Serial.println(ESP.getFreeHeap());

  dummy[819] = '\0';
  Serial.println(dummy + 810);
}

void loop() {

}
no prob at all.
Hopperpop
@Hopperpop
Apr 09 2016 18:10
In a function that is called in setup.
Victor Tseng
@Palatis
Apr 09 2016 18:10
and does print garbage chars to the console...
yeah i moved them into a function and no problem at all.
void dummyFunc() {
  char dummy[820];
  dummy[819] = '\0';
  Serial.println(dummy + 810);
}
and called that in setup()
ahh i'm using the git version sdk...
dunno if that matters.
Gleb V
@glebv
Apr 09 2016 19:14
Hi, I’m frustrated with loop approach in esp. Unfortunately, I can lose some events while esp8266 tries to (re)connect to MQTT or WiFi. Is it possible to use an interrupt or some callbacks? Maybe I need use other SDK or what can you recommend to solve such kind of issues?
Hopperpop
@Hopperpop
Apr 09 2016 19:17
I can't make a simple program that recreates the problem. The code is to big to drop here.
I will move some things to the heap, and hope it will solve the problem.
Thanks anyways for the help.
Aditya Tannu
@AdySan
Apr 09 2016 20:07
The ESP32 FCC test report doesn't mention Bluetooth anywhere, only 803.11b/g/n
Victor Tseng
@Palatis
Apr 09 2016 20:09
@glebv listening for wifi events?
@Hopperpop then the problem is somewhere else i guess, you have software WDT firing, which means you're spending too much time on something and didn't let the os (okay, the fake os) stack do its thing.
@Hopperpop such as a for/while loop, or some very long (in execution time) function.
@Hopperpop try dig into the library codes if you're using any.