Hi All, A little help getting started please?

(Will Waterston) #1

Hi All,

A little help getting started please? my LED’s are not doing what I expect and I’m getting constant resets. Thanks for any suggestions :slight_smile:

I have -

esp32 dev board WROOM-32
using Arduino IDE with board “Esp32 Dev Module” and library loaded FastLED 3.1.6

Code example -

#include “FastLED.h”
#define NUM_LEDS 1
#define DATA_PIN 17

void setup() {

void loop() {
// Turn the LED on, then pause
leds[0] = CRGB::Red;
// Now turn the LED off, then pause
leds[0] = CRGB::Black;

I get these 2 pragma messages during compile -

pragma message “FastLED version 3.001.007”
pragma message “No hardware SPI pins defined. All SPI access will default to bitbanged output”

I also seem to be getting constant resets, this is from the serial monitor -

ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
mode:DIO, clock div:1
entry 0x400802e4
Guru Meditation Error: Core 1 panic’ed (Interrupt wdt timeout on CPU1)
Core 1 register dump:
PC : 0x40082eff PS : 0x00060334 A0 : 0x80082ce2 A1 : 0x3ffb1ee0
A2 : 0x018dbe85 A3 : 0x00000000 A4 : 0x3ffc10b4 A5 : 0x0000001c
A6 : 0x0000013c A7 : 0x000005dc A8 : 0x00000081 A9 : 0x00000000
A10 : 0x00000000 A11 : 0x3ffb2034 A12 : 0x00000050 A13 : 0x00000001
A14 : 0x00000000 A15 : 0x00000000 SAR : 0x0000000a EXCCAUSE: 0x00000006
EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000

Backtrace: 0x40082eff:0x3ffb1ee0 0x40082cdf:0x3ffb1f00 0x40081067:0x3ffb1f20 0x400d0e96:0x3ffb1f40 0x400d0a2f:0x3ffb1f80 0x400e3eee:0x3ffb1fa0

Core 0 register dump:
PC : 0x400e6c86 PS : 0x00060934 A0 : 0x80085510 A1 : 0x3ffc77f0
A2 : 0x00000008 A3 : 0x00000000 A4 : 0x00000001 A5 : 0x3ffc7e2c
A6 : 0x00000000 A7 : 0x00000001 A8 : 0x3ffc32f4 A9 : 0x3ffc32d8
A10 : 0x00000000 A11 : 0x00000001 A12 : 0x00000000 A13 : 0x00000001
A14 : 0x00060920 A15 : 0x00000000 SAR : 0x00000000 EXCCAUSE: 0x00000006
EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000

Backtrace: 0x400e6c86:0x3ffc77f0 0x4008550d:0x3ffc7810

(Marc Miller) #2

I don’t believe updates for the ESP32 have be added to the official FastLED library yet. Try the fork by @Sam_Guyer

(Marc Miller) #3

Those two pragma messages are normal.

(Will Waterston) #4

@marmil Thanks, will do

(Will Waterston) #5

@marmil I’ve imported the zip file and its in the libraries folder now, 3.1.3. When compiling I now get the error

In file included from C:\Users\Will\Documents\Arduino\libraries\FastLED-3.1.3/led_sysdefs.h:27:0,

             from C:\Users\Will\Documents\Arduino\libraries\FastLED-3.1.3/FastLED.h:44,

             from C:\Users\Will\Documents\Arduino\libraries\FastLED-3.1.3\examples\Blink\Blink.ino:1:

C:\Users\Will\Documents\Arduino\libraries\FastLED-3.1.3/platforms/avr/led_sysdefs_avr.h:12:20: fatal error: avr/io.h: No such file or directory

compilation terminated.

exit status 1
Error compiling for board ESP32 Dev Module.

(Marc Miller) #6

You’ll need to delete the original FastLED folder from your library folder, then unzip Sam’s fork, rename it to just FastLED, and put it in the library location where the other one was. Then close all windows of Arduino IDE you have open and restart Arduino.

(Marc Miller) #7

Note, there’s a new example for the ESP32 in the examples that Sam provided.

(Will Waterston) #8

@marmil Something is still amiss. I removed the library folder from the arduino install, and replaced it with the one from Git, but still getting the same error. Restarted Arduino, but still no change.

(Will Waterston) #9

@marmil I’ve read where other people are having the same problem, but most of those posts are people trying to compile for other boards; even so usually the question asked is “my board isn’t AVR so why is it trying to use that file?”

Is there a config or setting or something I might be missing so it doesn’t try to use it?

(Ken White) #10

@Will_Waterston - I have been using @Sam_Guyer ’s version of the FastLED library for the ESP32 MCUs with my Lolin D32 ESP32 MCU. It works fine with all of my sketches ( see https://github.com/chemdoc77/CD77_FastLED and https://gist.github.com/chemdoc77) that I previously ran with the current main version of FastLed on a Teensy 3.1 and 3.2 MCUs. FYI, Sam’s version works great on my Teensy MCUs and my Wemos D1 Mini Pro MCU, too.

I am using the Arduino 1.8.5 IDE running on a Windows 7 PC with my Lolin D32 ESP32 MCU.

Check in your library folder where you have the FastLed library to see if you have the avr library which should contain the missing file in your error message. If not, download that library and put it in the library folder. That should fix your problem.

(Will Waterston) #11

@Ken_White thanks, which particular AVR library? there are lots…

possibly avr-libc?

(Ken White) #12

@Will_Waterston - I believe that this is the one I have:

I have in my library directory both the avr_libc_master folder and the avr folder that I created with the following files that I copied from avr_libc_master in to it:

interrup.h, io.h, iom328p.h and sfr_defs.h

I do not remember why I had to copy those files into the avr folder I created but things work. Maybe if I had renamed the avc_libr_master to just avr, it would have worked correctly without the need for my fix.

(Will Waterston) #13

@Ken_White thanks, I’m at work right now but I’ll give it a go tonight.

(Will Waterston) #14

@Ken_White @marmil I think I followed the wrong instructions to install the library in the first place, downloading git GUI and updating using get etc… I deleted the library and just installed from the zip file and now its working. The LED’s aren’t operating 100% correctly yet, some transitions are just missed, but I’m only using 3.3V so that may be the issue.

Thanks for the help :slight_smile:

(Marc Miller) #15

Get yourself a level shifter and see if that helps out. These are the recommended ones to use:
SN74HCT245N or the SN74HCT125

Here’s how to wire the HCT245N

(Will Waterston) #16

@marmil Thanks, I do already have some of those so I’ll test it out on the weekend.

(Sam Guyer) #17

@Will_Waterston Try installing the ESP32 backtrace decoder – it’s super-useful!

(Will Waterston) #18

Thanks, all working now, but the backtracer may be useful in the future. It was just the way I had installed the library using GIT, I think the instructions I read were over complicated when just copying all the source to the library folder was all that was required.