New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32 with enabled WiFi produces random colors and flickering on Neopixel #507

Closed
tbnobody opened this Issue Sep 29, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@tbnobody

tbnobody commented Sep 29, 2017

It seems that the interrupt handling of the wifi stack is disturbing the output of the signal to handle the ws2801 (neopixel) correctly. I have a sketch which is basically like this example: https://github.com/espressif/esp-idf/blob/master/examples/protocols/sntp/main/sntp_example_main.c

in combination with this main method:

extern "C" void app_main(void)
{
    initArduino();
    xTaskCreatePinnedToCore(loopTask, "loopTask", 8192, NULL, 1, NULL, ARDUINO_RUNNING_CORE);
    obtain_time();
}

The loopTask method contains e.g. the following:

FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
FastLED.setBrightness(50);
while (1) {
    micros();
    time(&now);
    localtime_r(&now, &timeinfo);

    clearClock();
    int Hours = timeinfo.tm_hour;
    int Minutes = timeinfo.tm_min;
    int Seconds = timeinfo.tm_sec;
    timeToStrip(Hours, Minutes, Seconds);
    FastLED.show();  
    yield();
    delay(1000 / 120);
    yield();
}

If I comment out the obtain_time() method, everything works very reliable. But with the obtain_time method included, I have some leds with random colors and in general random leds lighting up.

I already tried the new version of "clockless_esp32.h" as mentioned here: samguyer@b1ffc70 but without any effect

@tbnobody

This comment has been minimized.

Show comment
Hide comment
@tbnobody

tbnobody Sep 30, 2017

I just integrated the RMT based solution into the clockless_esp32.h file https://github.com/MartyMacGyver/ESP32-Digital-RGB-LED-Drivers/blob/master/esp-idf/demo1/components/ws2812/ws2812.cpp

The timings are currently hard coded for the WS2812 but it works perfectly! Maybe thats a better solution than the bit banging.

tbnobody commented Sep 30, 2017

I just integrated the RMT based solution into the clockless_esp32.h file https://github.com/MartyMacGyver/ESP32-Digital-RGB-LED-Drivers/blob/master/esp-idf/demo1/components/ws2812/ws2812.cpp

The timings are currently hard coded for the WS2812 but it works perfectly! Maybe thats a better solution than the bit banging.

@astro0302

This comment has been minimized.

Show comment
Hide comment
@astro0302

astro0302 Oct 23, 2017

I can confirm the error with WS2812B and the FastLed Library. Same script with APA102 is without this error.

astro0302 commented Oct 23, 2017

I can confirm the error with WS2812B and the FastLed Library. Same script with APA102 is without this error.

@tbnobody

This comment has been minimized.

Show comment
Hide comment
@tbnobody

tbnobody Oct 23, 2017

Yes, thats clear.
Please see #504
Duplicate of #504

tbnobody commented Oct 23, 2017

Yes, thats clear.
Please see #504
Duplicate of #504

@tbnobody tbnobody closed this Oct 23, 2017

@Wetterprophet

This comment has been minimized.

Show comment
Hide comment
@Wetterprophet

Wetterprophet Mar 22, 2018

Hey everybody, I always had the problem that my ESP32 resetted on FastLED.show();
Resolved it by calling
#define FASTLED_ALLOW_INTERRUPTS 0
before including the FastLED-library. also i think that this only works with FastLED version from the 2018/01/18th on.
Hope that helps ;)

Wetterprophet commented Mar 22, 2018

Hey everybody, I always had the problem that my ESP32 resetted on FastLED.show();
Resolved it by calling
#define FASTLED_ALLOW_INTERRUPTS 0
before including the FastLED-library. also i think that this only works with FastLED version from the 2018/01/18th on.
Hope that helps ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment