Help using the APA102 RGB LED on the FeatherS2 - "Invalid pin specified"

Hi everyone. I have an Unexpected Maker FeatherS2 (board: um_feathers2) that according to the pinout diagram, has an APA102 2020 RGB LED using pin 40 for data and pin 45 for the clock. It works fine with MicroPython, but for ESPHome, it refuses to compile if I define the LED like so:

light:
  - platform: fastled_spi
    chipset: APA102
    data_pin: GPIO40
    clock_pin: GPIO45
    num_leds: 1
    # rgb_order: BRG
    name: "RGB Light"

(full yaml)

It fails to compile with the error:

.piolibdeps/feathers2/FastLED/fastpin.h:207:24: error: static assertion failed: Invalid pin specified

(full build log)

There are a couple of warnings on the ESPHome FastLED docs, but I don’t think either apply. This is an ESP32, not an ESP8266, and I don’t think it’s using ESP-IDF to compile.

Any ideas on how I can get this to work?

For context: I’m using the ESPHome docker image on an x86-64 Unraid Linux server.


Also, for anyone else trying to use the feathers2 board, it’s a bit of a doosey to get the initial setup working. I was unable to flash it in the browser through either my ESPHome dashboard or web.esphome.io. esptool.py also failed when I used the version installed via apt-get, complaining about OSError: [Errno 71] Protocol error initially, and then A fatal error occurred: Failed to enter Flash download mode (result was 01050000) when I specified more flags.

But, I was finally able to get it to work by downloading the latest esptool release from github and running these commands (based on the instructions for reinstalling MicroPython):

esptool  --chip esp32s2 --port /dev/ttyACM0 erase_flash
esptool  --chip esp32s2 --port /dev/ttyACM0 write_flash 0x0 '/home/nfriedly/Downloads/feathers2-factory.bin'

(Where feathers2-factory.bin is the file I got after choosing Install > Manual Download > Modern format in the ESPHome dashboard.)

Maybe it’s a limitation of ESPHome. In the doco pin numbering finishes at GPIO39:

Also it says:

Note

Support for the ESP32-S2 and ESP32-C3 is still in development and there could be issues.

1 Like

Based on a GitHub comment, I’m trying the ESP32 RMT LED Strip — ESPHome library.

This config compiles, but the light doesn’t come on:

light:
  - platform: esp32_rmt_led_strip
    chipset: APA106 # really APA102, but that's not an option
    pin: GPIO40
    num_leds: 1
    rgb_order: RGB
    rmt_channel: 0 # 0-3
    name: "RGB Light"

I might try one of the other chipsets or try to figure out manual timings, but I’m about out of time for right now.

Just clutching at straws - have you tried using idf framework:

esp32:
  board: um_feathers2
  framework:
    type: esp-idf

Oh, no, I’ll try that. Thanks.

Update: nope. it compiles, but the light doesn’t come on.