Post topics, source code that relate to the Arduino Platform

User avatar
By Tinker1
#46463 I have been testing a sample sketch (listed below) for the wemos D1 using the Arduino 1.6.8 IDE and the esp8266 version 2.2.0 build installed in the board manager and have become stuck.

The sketch is designed to listen for E1.31 data using either Unicast or Multicast.

In Unicast mode it works great and will run forever.

However if I attempt to use Multicast, after connecting the watchdog timer will reset like clockwork over and over again every 60 seconds.

I have tried this using both the Wemos D1 retired board as well as the Wemos D1 Mini. Same results.

I have even tried adding yield(), delay() to the void loop as well as deleting all the code (out of the void loop) so the board should be doing nothing other than just the setup routine.

Has anyone ever seen this or does anyone have any ideas of what I can do to solve this problem? Thanks.



/*
* ESP8266_Test.ino - Simple sketch to listen for E1.31 data on an ESP8266
* and print some statistics.
*
* Project: E131 - E.131 (sACN) library for Arduino
* Copyright (c) 2015 Shelby Merrick
* http://www.forkineye.com
*
* This program is provided free for you to use in any way that you wish,
* subject to the laws and regulations where you are using it. Due diligence
* is strongly suggested before using this code. Please give credit where due.
*
* The Author makes no warranty of any kind, express or implied, with regard
* to this program or the documentation contained in this document. The
* Author shall not be liable in any event for incidental or consequential
* damages in connection with, or arising out of, the furnishing, performance
* or use of these programs.
*
*/

#include <ESP8266WiFi.h>
#include <E131.h>

const char ssid[] = "........"; /* Replace with your SSID */
const char passphrase[] = "........"; /* Replace with your WPA2 passphrase */

E131 e131;

void setup() {
Serial.begin(115200);
delay(10);

/* Choose one to begin listening for E1.31 data */
e131.begin(ssid, passphrase); /* via Unicast on the default port */
//e131.beginMulticast(ssid, passphrase, 1); /* via Multicast for Universe 1 */
}

void loop() {
/* Parse a packet */
uint16_t num_channels = e131.parsePacket();

/* Process channel data if we have it */
if (num_channels) {
Serial.print("Universe ");
Serial.print(e131.universe);
Serial.print(" / ");
Serial.print(num_channels);
Serial.print(" Channels | Packets: ");
Serial.print(e131.stats.num_packets);
Serial.print(" / Sequence Errors: ");
Serial.print(e131.stats.sequence_errors);
Serial.print(" / CH1: ");
Serial.println(e131.data[0]);
}
}
User avatar
By martinayotte
#46489 Which library are you using ? (Could you share link ?)
When you get crashes, did you decode the stacktraces to get more meaningful details using EspExceptionDecoder ?
https://github.com/me-no-dev/EspExceptionDecoder
Some people facing issues with UDP, maybe the stacktrace will reveal the same issue.
User avatar
By Tinker1
#46501 The E131 library is available from this link: https://github.com/seco/E131

I have not tried to decode the stacktraces yet. At first I thought perhaps my problem was the older IDE version I was using (1..6.5 r5) and the board manager version of esp8266 I was using (version 2.1.0). But after updating both the IDE and the board manager version to the latest with the same issue remaining that went out the window as an idea.


I believe it has to be something with UDP since unicast works without issue. It's almost appears as if something in the multicast code is getting stuck in a loop somewhere.

I thought perhaps it was a "speed of execution" thing so I also tried to upload the code using the 160mhz option instead of the 80mhz option but that made no difference either.