Using esp32 with Blynk and Fastled (disabled interrupts)

Hi guys,
I’m starting a new project that’s supposed to control my LEDs over Wifi (initially esp8266) with Blynk. Sounds simple, right?
Well, turns out my knowledge isn’t enough to do that. Since the FastLed library disables interrupts, to keep the timings for the LEDs in Sync, I can’t use Software Serial, since some of My data will get lost, if it arrives while the FastLed.show function is being executed. I basically need to
A) buffer the data till the show function is over, then request it and read it from my arduino
B) be able to request all the blynk data when the arduino has time to read it between two show executes

My idea was to maybe use a esp32 instead of an arduino UNO and esp8266, so ill be able to… I’m not quite sure what, but at least do something???

Does anyone have help or suggestions on how to get this to work?

Btw, connecting the Arduino to my PC and getting the Blynk data from the USBscript works, since it’s using hardware serial wich buffers a few bytes till they’re read(), so I’m trying to figure out a way to maybe use that? But I can’t connect the esp8266 to hardware serila, because it’s not able to read or write data, when connected to the usb serial of the arduino…

I am also having this issue. I am trying to use the SmartLED Controller by Jamin but modified a bit to use my Espressif ESP32 DevKitC rather than a ESP8266.

I got Blynk to work and connected the ESP32 to a project on my phone, and FastLed works on it’s own, but together I get the error message in this comment.

Doing a lot of research on the problem and it’s definitely interrupts. Hope someone sees this soon who is more knowledgeable in the matter.

Error:

ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:956
load:0x40078000,len:0
load:0x40078000,len:13076
entry 0x40078a58
[54] Connecting to NETGEAR13
[4555] Connected to WiFi
[4555] IP: 192.168.1.28
[4555]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
/
//_, /////_
/
__/ v0.4.10 on ESP32

[5001] Connecting to blynk-cloud.com:8442
[5223] Redirecting to 139.59.206.133:8442
[5224] Login timeout
[5224] Connecting to 139.59.206.133:8442
[5565] Ready (ping: 171ms).
[10566] Connecting to 139.59.206.133:8442
[10911] Ready (ping: 171ms).
Guru Meditation Error: Core 0 panic’ed (Interrupt wdt timeout on CPU1)
Register dump:
PC : 0x40085f40 PS : 0x00060834 A0 : 0x80086915 A1 : 0x3ffd5a30
A2 : 0x3ffc10a8 A3 : 0x3ffd5ab8 A4 : 0x00000008 A5 : 0x3ffd9d98
A6 : 0x00000004 A7 : 0x3ffdbd98 A8 : 0x0000abab A9 : 0x0000cdcd
A10 : 0xb33fffff A11 : 0x0000abab A12 : 0x3ffaff58 A13 : 0x00000001
A14 : 0x00060823 A15 : 0x00000000 SAR : 0x00000018 EXCCAUSE: 0x00000006
EXCVADDR: 0x00000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff

Backtrace: 0x40085f40:0x3ffd5a30 0x40086912:0x3ffd5a50 0x400852dd:0x3ffd5a70 0x4011f8a9:0x3ffd5ab0 0x4011fa73:0x3ffd5ae0 0x40120dd7:0x3ffd5b00 0x4012149d:0x3ffd5b20 0x401236fb:0x3ffd5b70

Rebooting…

I know I just posted my problems, but i found a solution!

As it turns out, I think the problem was blynk trying to send/receive data during the FastLed show() function.

Try reading up on FastLED Interrupt Problems. I solved my problem with adding these before calling to include FastLED:

#define FASTLED_ALLOW_INTERRUPTS 0
#define FASTLED_INTERRUPT_RETRY_COUNT 1

Hope this works for you too! (Also, tried different pins bc I thought that might be part of the problem and idk ifit really was but GPIO 5 is working like a charm)

1 Like