esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 34 forks source link

Compilation error for NeoPixelBus Light when specifying data_pin & clock_pin #2491

Open noofny opened 2 years ago

noofny commented 2 years ago

The problem

I can successfully use this component when using a single-pin configuration, by defining value for pin. When I try using a 2-pin configuration by defining values for data_pin and clock_pin the core compilation fails with the following error...

In file included from src/esphome/components/neopixelbus/neopixelbus_light.h:14:0,
                 from src/esphome.h:41,
                 from src/main.cpp:3:
/root/.platformio/lib/NeoPixelBus-esphome/src/NeoPixelBus.h: In instantiation of 'NeoPixelBus<T_COLOR_FEATURE, T_METHOD>::NeoPixelBus(uint16_t, uint8_t, uint8_t) [with T_COLOR_FEATURE = NeoRgbFeature; T_METHOD = NeoEsp32I2sMethodBase<NeoEsp32I2sSpeed800Kbps, NeoEsp32I2sBusOne, NeoEsp32I2sNotInverted>; uint16_t = short unsigned int; uint8_t = unsigned char]':
src/esphome/components/neopixelbus/neopixelbus_light.h:67:5:   required from 'void esphome::neopixelbus::NeoPixelBusLightOutputBase<T_METHOD, T_COLOR_FEATURE>::add_leds(uint16_t, uint8_t, uint8_t) [with T_METHOD = NeoEsp32I2sMethodBase<NeoEsp32I2sSpeed800Kbps, NeoEsp32I2sBusOne, NeoEsp32I2sNotInverted>; T_COLOR_FEATURE = NeoRgbFeature; uint16_t = short unsigned int; uint8_t = unsigned char]'
src/main.cpp:3157:64:   required from here
/root/.platformio/lib/NeoPixelBus-esphome/src/NeoPixelBus.h:148:106: error: invalid conversion from 'size_t {aka unsigned int}' to 'NeoBusChannel' [-fpermissive]
         _method(pinClock, pinData, countPixels, T_COLOR_FEATURE::PixelSize, T_COLOR_FEATURE::SettingsSize)
                                                                                                          ^
In file included from /root/.platformio/lib/NeoPixelBus-esphome/src/NeoPixelBus.h:104:0,
                 from src/esphome/components/neopixelbus/neopixelbus_light.h:14,
                 from src/esphome.h:41,
                 from src/main.cpp:3:
/root/.platformio/lib/NeoPixelBus-esphome/src/internal/NeoEsp32I2sMethod.h:148:5: note:   initializing argument 5 of 'NeoEsp32I2sMethodBase<T_SPEED, T_BUS, T_INVERT>::NeoEsp32I2sMethodBase(uint8_t, uint16_t, size_t, size_t, NeoBusChannel) [with T_SPEED = NeoEsp32I2sSpeed800Kbps; T_BUS = NeoEsp32I2sBusOne; T_INVERT = NeoEsp32I2sNotInverted; uint8_t = unsigned char; uint16_t = short unsigned int; size_t = unsigned int]'
     NeoEsp32I2sMethodBase(uint8_t pin, uint16_t pixelCount, size_t elementSize, size_t settingsSize, NeoBusChannel channel) :
     ^
*** [/data/env-office-a/.pioenvs/env-office-a/src/main.cpp.o] Error 1

I have tried different different permutations of values for type and method but the same compilation error occurs.

Which version of ESPHome has the issue?

2021.9.1

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

core-2021.9.6

What platform are you using?

ESP32

Board

Adafruit Feather 32

Component causing the issue

NeoPixelBus Light

Example YAML snippet

- platform: neopixelbus
    id: neo_matrix_light
    name: "Neo Matrix Light"
    type: GRB
    data_pin: A0
    clock_pin: A1
    num_leds: 72

Anything in the logs that might be useful for us?

Full log is here...

 Reading configuration /config/esphome/env-office-a.yaml...
INFO Generating C++ source...
INFO Compiling app...
INFO Running:  platformio run -d /config/esphome/env-office-a
Processing env-office-a (board: featheresp32; framework: arduino; platform: platformio/espressif32@3.2.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
PACKAGES: 
 - framework-arduinoespressif32 3.10006.210326 (1.0.6) 
 - tool-esptoolpy 1.30000.201119 (3.0.0) 
 - toolchain-xtensa32 2.50200.97 (5.2.0)
Library Manager: Installing Hash
Library Manager: Already installed, built-in library
Dependency Graph
|-- <AsyncTCP-esphome> 1.2.2
|-- <Adafruit BusIO> 1.9.1
|   |-- <Wire> 1.0.1
|   |-- <SPI> 1.0
|-- <Adafruit GFX Library> 1.10.12
|   |-- <Wire> 1.0.1
|   |-- <Adafruit BusIO> 1.9.1
|   |   |-- <Wire> 1.0.1
|   |   |-- <SPI> 1.0
|   |-- <SPI> 1.0
|-- <FS> 1.0
|-- <ESPAsyncWebServer-esphome> 1.3.0
|   |-- <AsyncTCP-esphome> 1.2.2
|   |-- <Crypto> 0.2.0
|   |-- <FS> 1.0
|   |-- <WiFi> 1.0
|-- <ESPmDNS> 1.0
|   |-- <WiFi> 1.0
|-- <Wire> 1.0.1
|-- <BSEC Software Library> 1.6.1480
|   |-- <SPI> 1.0
|   |-- <Wire> 1.0.1
|-- <NeoPixelBus-esphome> 2.6.2
|   |-- <SPI> 1.0
|-- <noise-c> 0.1.1
|-- <DNSServer> 1.1.0
|   |-- <WiFi> 1.0
|-- <Update> 1.0
|-- <WiFi> 1.0
Compiling /data/env-office-a/.pioenvs/env-office-a/src/main.cpp.o
In file included from src/esphome/components/neopixelbus/neopixelbus_light.h:14:0,
                 from src/esphome.h:41,
                 from src/main.cpp:3:
/root/.platformio/lib/NeoPixelBus-esphome/src/NeoPixelBus.h: In instantiation of 'NeoPixelBus<T_COLOR_FEATURE, T_METHOD>::NeoPixelBus(uint16_t, uint8_t, uint8_t) [with T_COLOR_FEATURE = NeoRgbFeature; T_METHOD = NeoEsp32RmtMethodBase<NeoEsp32RmtSpeed800Kbps, NeoEsp32RmtChannel1>; uint16_t = short unsigned int; uint8_t = unsigned char]':
src/esphome/components/neopixelbus/neopixelbus_light.h:67:5:   required from 'void esphome::neopixelbus::NeoPixelBusLightOutputBase<T_METHOD, T_COLOR_FEATURE>::add_leds(uint16_t, uint8_t, uint8_t) [with T_METHOD = NeoEsp32RmtMethodBase<NeoEsp32RmtSpeed800Kbps, NeoEsp32RmtChannel1>; T_COLOR_FEATURE = NeoRgbFeature; uint16_t = short unsigned int; uint8_t = unsigned char]'
src/main.cpp:3157:64:   required from here
/root/.platformio/lib/NeoPixelBus-esphome/src/NeoPixelBus.h:148:106: error: invalid conversion from 'size_t {aka unsigned int}' to 'NeoBusChannel' [-fpermissive]
         _method(pinClock, pinData, countPixels, T_COLOR_FEATURE::PixelSize, T_COLOR_FEATURE::SettingsSize)
                                                                                                          ^
In file included from /root/.platformio/lib/NeoPixelBus-esphome/src/NeoPixelBus.h:105:0,
                 from src/esphome/components/neopixelbus/neopixelbus_light.h:14,
                 from src/esphome.h:41,
                 from src/main.cpp:3:
/root/.platformio/lib/NeoPixelBus-esphome/src/internal/NeoEsp32RmtMethod.h:477:5: note:   initializing argument 5 of 'NeoEsp32RmtMethodBase<T_SPEED, T_CHANNEL>::NeoEsp32RmtMethodBase(uint8_t, uint16_t, size_t, size_t, NeoBusChannel) [with T_SPEED = NeoEsp32RmtSpeed800Kbps; T_CHANNEL = NeoEsp32RmtChannel1; uint8_t = unsigned char; uint16_t = short unsigned int; size_t = unsigned int]'
     NeoEsp32RmtMethodBase(uint8_t pin, uint16_t pixelCount, size_t elementSize, size_t settingsSize, NeoBusChannel channel) :
     ^
*** [/data/env-office-a/.pioenvs/env-office-a/src/main.cpp.o] Error 1
========================= [FAILED] Took 15.87 seconds =========================

Additional information

No response

martgras commented 2 years ago

From looking at https://github.com/Makuna/NeoPixelBus/wiki/NeoPixelBus-object-API it appears that clock_pin is only valid for DotStar . But I may have missed something since I don't understand the API completely

noofny commented 2 years ago

Thank you @martgras - yes that's right, I was using clock_pin & data_pin to try get a DotStar working. I have a NeoPixel and a DotStar device, both are mini-LED-matrix Feather boards (Adafruit). The NeoPixel works flawlessly so I got excited and was trying to get the DotStar going. Maybe I'm trying to do something that isn't possible? Apologies for my ignorance.

This is the NeoPixel board that works fine... https://www.adafruit.com/product/2945

This is the DotStar board that I was trying to get working... https://www.adafruit.com/product/3449

I hope that is helpful.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.