Post topics, source code that relate to the Arduino Platform

User avatar
By Tinker1
#46702 Interesting. I had not seen that issue posted. But you raise a very good question about which mode the board is in.

I looked at the E131 code (E131.cpp) and could not find where the state of the board was configured anywhere after powerup, to be able to determine weather the ESP was set to AP or STA mode.

However I did see, as the issue had called out, that WiFi.localIP() was being used instead of WiFi.softAPIP() in the udp.beginMulticast call. I changed it but this made no difference. The board still reboots, so I switch it back to the original code.

So the next step I too was to add the following to the initMulticast procedure, right before the udp.beginMulticast call:
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);

When compiled and ran the code, it now connects in multicast mode, still returning valid universe, multicast and ip address information, and no longer crashes with the watchdog timer :) However it also appears I now no longer am receiving any packets (at least none that are parsed). I did not have the time to look further to see if the mode setting is impacting the way data is retrieved from the udp object to see why this would be. I also had thought of changing the mode to "both" to see if this would work.

Could it be that the wifi library itself has a flaw? I saw where you responded to a thread started by user "picstart" about UDP multicast receive crashes and some sort of bug introduced with the latest core 2.2.0. Do you know if there is a core in existence previous to this where multicast does work?
User avatar
By martinayotte
#46707 Interesting ! So, maybe there are 2 issues, one with STA+AP, and another with UDP Multicast, and yes, it seems there a bug introduced in 2.2.0 about the latest.
So, that is why I was asking you to decode stacktrace, to see if it is the same that @picstart and others faced.
User avatar
By Tinker1
#46729 Understood. I had a chance to finally install and run the stack trace tool. Here are the results putting the sketch back to the way it was when the watchdog causes the reset. I captured it 3 times for good measure :) Does this help shed any light on the issue? I still need to dig into the code to see why I am not receiving packets when it is initialized (but not crashing), but I wanted to post the trace info in the hopes that it might further the cause toward a solution:

Decoding 14 results
0x40106752: __umodsi3 at d:\ivan\projects\arduinoesp\toolchain\dl\gcc-xtensa\build-2\xtensa-lx106-elf\libgcc/../../../libgcc/config/xtensa/lib1funcs.S line 696
0x40221f37: igmp_tmr at ?? line ?
0x4020bd30: ieee80211_deliver_data at ?? line ?
0x40221f76: igmp_tmr at ?? line ?
0x4020bd49: ieee80211_deliver_data at ?? line ?
0x40221d85: igmp_input at ?? line ?
0x40220000: espconn_find_current_pcb at ?? line ?
0x40222774: ip_input at ?? line ?
0x402214d7: etharp_find_addr at ?? line ?
0x40221a82: ethernet_input at ?? line ?
0x40219417: ets_snprintf at ?? line ?
0x402032cb: loop_task at C:\Documents and Settings\dev\Local Settings\Application Data\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\cores\esp8266/core_esp8266_main.cpp line 43


Decoding 13 results
0x40221f37: igmp_tmr at ?? line ?
0x4020bd30: ieee80211_deliver_data at ?? line ?
0x40221f76: igmp_tmr at ?? line ?
0x4020bd49: ieee80211_deliver_data at ?? line ?
0x40221d85: igmp_input at ?? line ?
0x40220000: espconn_find_current_pcb at ?? line ?
0x40222774: ip_input at ?? line ?
0x402214d7: etharp_find_addr at ?? line ?
0x40221a82: ethernet_input at ?? line ?
0x40219417: ets_snprintf at ?? line ?
0x402032cb: loop_task at C:\Documents and Settings\dev\Local Settings\Application Data\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\cores\esp8266/core_esp8266_main.cpp line 43


Decoding 15 results
0x40106752: __umodsi3 at d:\ivan\projects\arduinoesp\toolchain\dl\gcc-xtensa\build-2\xtensa-lx106-elf\libgcc/../../../libgcc/config/xtensa/lib1funcs.S line 696
0x40221f37: igmp_tmr at ?? line ?
0x4020bd30: ieee80211_deliver_data at ?? line ?
0x40221f76: igmp_tmr at ?? line ?
0x4020bd49: ieee80211_deliver_data at ?? line ?
0x40221d85: igmp_input at ?? line ?
0x40220000: espconn_find_current_pcb at ?? line ?
0x40222774: ip_input at ?? line ?
0x402214d7: etharp_find_addr at ?? line ?
0x40221a82: ethernet_input at ?? line ?
0x40219417: ets_snprintf at ?? line ?
0x402032cb: loop_task at C:\Documents and Settings\dev\Local Settings\Application Data\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\cores\esp8266/core_esp8266_main.cpp line 43