forkineye / E131

E1.31 (sACN) library for Arduino with ESP8266 support
127 stars 44 forks source link

Strip doing strange things after router upgrade. #26

Closed gpperrone closed 4 years ago

gpperrone commented 5 years ago

I am using the Feather Huzzah, and your ESP8266_Neopixel demo sketch, to drive 47 LEDs in a strip. Don't ask about the odd number. It fits the environment perfectly. Everything worked great until I upgraded my router. Suddenly, the ESP would not connect to the wifi. I found out it has something to do with an incompatibility between the Wifi config on the ESP8266 and the Marvell radio in my router. That problem is "solved", meaning that, through modifications to the router config, I can now get the ESP8266 to connect to the AP, and acquire an IP address. But now... the first 11 pixels in my strip blink on and off, at the chosen color, at around a 1hz frequency. This only happens when the strip is set to hold a solid color. When the strip is getting a constantly changing stream of data, it seems to work as advertised.

I have modified your example sketch, to see if I can tell what is going on. I have placed my loop code at the bottom of this message. After successfully connecting to Wifi, serial monitor goes quiet, as expected. I send a change to the ESP8266, the Serial monitor spits results that match what the strips are actually doing, but it is not what the software is sending. See the actual output, below the loop code. This is cut and paste from a putty session log. All of this would be easily explained if I could see packets being transmitted on the network, but here is the strange part... I have Wiresharked the network, and the software is sending one, and only one, correctly formed packet. This second, interlaced result of e131.parsepacket(), is definitely not being sent via the network. It is coming from or resident in the buffer of, the code/MCU. But it only happens with the full 802.11n standard in play. Move away from the standard (disable WMM and allow older security protocols), it works without a hitch, as it did for 6 months before I upgraded the router. I have flashed a different sketch, for Art-Net. It works properly for a while, then exhibits the same symptoms. I switch back to your E1.31 sketch, and it works properly for a while, then starts this all over again. If I load a test program, an LED torture test that just holds full white(255, 255, 255) forever, it runs properly, and doesn't start blinking at all. It seems to be network related, but not caused by the network. The reverse of that perhaps. I am thinking it is actually related to the ESP8266Wifi.h library, but don't know how to prove it.

void loop() {
    /* Parse a packet and update pixels */
    if (WiFi.status() != WL_CONNECTED) {
      Serial.println(F("Not connected, resetting!"));
      setup();
    }
    if(e131.parsePacket()) {
      Serial.println(F("DMX packet recieved!"));
        if (e131.universe == UNIVERSE) {
            for (int i = 0; i < NUM_PIXELS; i++) {
                int j = i * 3 + (CHANNEL_START - 1);
                pixels.setPixelColor(i, e131.data[j], e131.data[j+1], e131.data[j+2]);

                Serial.print(F("Pixel #"));
                Serial.print(i+1);
                Serial.print(F(" Color "));
                Serial.print(e131.data[j]);
                Serial.print(F(", "));
                Serial.print(e131.data[j+1]);
                Serial.print(F(", "));
                Serial.println(e131.data[j+2]);
            }
            Serial.println(F("Showing color!"));
            pixels.show();

        }
    }
}

_Serial terminal text. These sets alternate. The LEDs are actually doing this:

DMX packet recieved! Pixel #1 Color 255, 255, 255 Pixel #2 Color 255, 255, 255 Pixel #3 Color 255, 255, 255 Pixel #4 Color 255, 255, 255 Pixel #5 Color 255, 255, 255 Pixel #6 Color 255, 255, 255 Pixel #7 Color 255, 255, 255 Pixel #8 Color 255, 255, 255 Pixel #9 Color 255, 255, 255 Pixel #10 Color 255, 255, 255 Pixel #11 Color 255, 255, 255 Pixel #12 Color 255, 255, 255 Pixel #13 Color 255, 255, 255 Pixel #14 Color 255, 255, 255 Pixel #15 Color 255, 255, 255 Pixel #16 Color 255, 255, 255 Pixel #17 Color 255, 255, 255 Pixel #18 Color 255, 255, 255 Pixel #19 Color 255, 255, 255 Pixel #20 Color 255, 255, 255 Pixel #21 Color 255, 255, 255 Pixel #22 Color 255, 255, 255 Pixel #23 Color 255, 255, 255 Pixel #24 Color 255, 255, 255 Pixel #25 Color 255, 255, 255 Pixel #26 Color 255, 255, 255 Pixel #27 Color 255, 255, 255 Pixel #28 Color 255, 255, 255 Pixel #29 Color 255, 255, 255 Pixel #30 Color 255, 255, 255 Pixel #31 Color 255, 255, 255 Pixel #32 Color 255, 255, 255 Pixel #33 Color 255, 255, 255 Pixel #34 Color 255, 255, 255 Pixel #35 Color 255, 255, 255 Pixel #36 Color 255, 255, 255 Pixel #37 Color 255, 255, 255 Pixel #38 Color 255, 255, 255 Pixel #39 Color 255, 255, 255 Pixel #40 Color 255, 255, 255 Pixel #41 Color 255, 255, 255 Pixel #42 Color 255, 255, 255 Pixel #43 Color 255, 255, 255 Pixel #44 Color 255, 255, 255 Pixel #45 Color 255, 255, 255 Pixel #46 Color 255, 255, 255 Pixel #47 Color 255, 255, 255 Showing color!

DMX packet recieved! Pixel #1 Color 0, 0, 0 Pixel #2 Color 0, 0, 0 Pixel #3 Color 0, 0, 0 Pixel #4 Color 0, 0, 0 Pixel #5 Color 0, 0, 0 Pixel #6 Color 0, 0, 0 Pixel #7 Color 0, 0, 0 Pixel #8 Color 0, 0, 0 Pixel #9 Color 0, 0, 0 Pixel #10 Color 0, 0, 0 Pixel #11 Color 0, 0, 0 Pixel #12 Color 255, 255, 255 Pixel #13 Color 255, 255, 255 Pixel #14 Color 255, 255, 255 Pixel #15 Color 255, 255, 255 Pixel #16 Color 255, 255, 255 Pixel #17 Color 255, 255, 255 Pixel #18 Color 255, 255, 255 Pixel #19 Color 255, 255, 255 Pixel #20 Color 255, 255, 255 Pixel #21 Color 255, 255, 255 Pixel #22 Color 255, 255, 255 Pixel #23 Color 255, 255, 255 Pixel #24 Color 255, 255, 255 Pixel #25 Color 255, 255, 255 Pixel #26 Color 255, 255, 255 Pixel #27 Color 255, 255, 255 Pixel #28 Color 255, 255, 255 Pixel #29 Color 255, 255, 255 Pixel #30 Color 255, 255, 255 Pixel #31 Color 255, 255, 255 Pixel #32 Color 255, 255, 255 Pixel #33 Color 255, 255, 255 Pixel #34 Color 255, 255, 255 Pixel #35 Color 255, 255, 255 Pixel #36 Color 255, 255, 255 Pixel #37 Color 255, 255, 255 Pixel #38 Color 255, 255, 255 Pixel #39 Color 255, 255, 255 Pixel #40 Color 255, 255, 255 Pixel #41 Color 255, 255, 255 Pixel #42 Color 255, 255, 255 Pixel #43 Color 255, 255, 255 Pixel #44 Color 255, 255, 255 Pixel #45 Color 255, 255, 255 Pixel #46 Color 255, 255, 255 Pixel #47 Color 255, 255, 255 Showing color!_

forkineye commented 4 years ago

It could be related to the neopixel library as well. You'll experience all sorts of issues with bit-banging ws2811 and watchdog resets. Since you're on ESP8266, I recommend this library instead - https://github.com/forkineye/ESPAsyncE131 and you can reference https://github.com/forkineye/ESPixelStick for how to do ws2811.

gpperrone commented 4 years ago

Thanks. I am using your ESPixelStick program, and it works great.

On Tue, Oct 22, 2019 at 10:56 AM Shelby Merrick notifications@github.com wrote:

It could be related to the neopixel library as well. You'll experience all sorts of issues with bit-banging ws2811 and watchdog resets. Since you're on ESP8266, I recommend this library instead - https://github.com/forkineye/ESPAsyncE131 and you can reference https://github.com/forkineye/ESPixelStick for how to do ws2811.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/forkineye/E131/issues/26?email_source=notifications&email_token=AK6RJQWWJMZ55CRWKN4MLWTQP4PC5A5CNFSM4GTVWST2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB6IMAI#issuecomment-545031681, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK6RJQRXX4JCHLNCQ6YZTILQP4PC5ANCNFSM4GTVWSTQ .