Thanks for your input Josh.
The pixels were billed as WS2812B. But is anything you buy from Amazon exactly what is advertised these days? I was under the (mistaken?) impression that the WS2812 was the the RGB or GRB variant and the WS2812B was a variant that included the “W” component. Having said that, as I (excessively?) briefly mentioned, the pixels work as expected in another code context - specifically Arduino IDE using Adafruit NeoPixel library on the very same hardware. I was hoping someone could tell me “the following config works with the ESP32 with the WS2812B for me…” so I could focus my efforts a little more effectively.
The problem for me is that the config in esp home that I expect should work:
platformio_options:
lib_deps:
- [email protected]
# - [email protected]
- AsyncTCP
# - FastLED
# - ESPAsyncWebServer-esphome
light:
- platform: neopixelbus
# - platform: fastled_clockless
# chipset: neopixel
method: ESP32_RMT_0
# chipset: NEOPIXEL
type: GRBW
# variant: 800KBPS
variant: WS2812X
# variant: SK6812
# chipset: ws2812b
# chipset: SK6812
pin: GPIO22
num_leds: 4
# rgb_order: GRBW
name: "FastLED Light"
yields warnings or errors on compile or uploads and fails to run properly. Not that the wrong colors result, etc. if that were the case I think I could find my errors. Error follows
[13:15:37]ets Jun 8 2016 00:22:57
[13:15:37]
[13:15:37]rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[13:15:37]configsip: 0, SPIWP:0xee
[13:15:37]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[13:15:37]mode:DIO, clock div:2
[13:15:37]load:0x3fff0018,len:4
[13:15:37]load:0x3fff001c,len:952
[13:15:37]load:0x40078000,len:6084
[13:15:37]load:0x40080000,len:7944
[13:15:37]entry 0x40080310
[13:15:37][I][logger:166]: Log initialized
[13:15:37][C][ota:366]: There have been 8 suspected unsuccessful boot attempts.
[13:15:37][I][app:029]: Running through setup()...
[13:15:37][D][binary_sensor:034]: 'PIR Sensor': Sending initial state OFF
[13:15:37][D][binary_sensor:034]: 'Button': Sending initial state ON
[13:15:38][D][esp-idf:000]: E (72) rmt: rmt_driver_install(725): RMT driver already installed for channel
[13:15:38]
[13:15:38]ESP_ERROR_CHECK failed: esp_err_t 0x103 (ESP_ERR_INVALID_STATE) at 0x4008de7c
[13:15:38]file: "/data/kitty_kam_front_shelter/.piolibdeps/kitty_kam_front_shelter/NeoPixelBus/src/internal/NeoEsp32RmtMethod.h" line 425
[13:15:38]func: void NeoEsp32RmtMethodBase<T_SPEED, T_CHANNEL>::Initialize() [with T_SPEED = NeoEsp32RmtSpeedWs2812x; T_CHANNEL = NeoEsp32RmtChannel0]
[13:15:38]expression: rmt_driver_install(T_CHANNEL::RmtChannelNumber, 0, ESP_INTR_FLAG_IRAM | ESP_INTR_FLAG_LEVEL1)
[13:15:38]
[13:15:38]Backtrace: 0x4008d980:0x3ffb1c60 0x4008de7f:0x3ffb1c80 0x400dea80:0x3ffb1ca0 0x400deb05:0x3ffb1cf0 0x400deb1a:0x3ffb1d30 0x4015a83d:0x3ffb1d50 0x400d6c01:0x3ffb1d70 0x4015ac4d:0x3ffb1d90 0x400dd34d:0x3ffb1db0 0x400df2f6:0x3ffb1e00 0x400e3e33:0x3ffb1fb0 0x4008a0c9:0x3ffb1fd0
[13:15:38]
[13:15:38]Rebooting...
[13:15:38]ets Jun 8 2016 00:22:57
[13:15:38]
[13:15:38]rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[13:15:38]configsip: 0, SPIWP:0xee
[13:15:38]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[13:15:38]mode:DIO, clock div:2
[13:15:38]load:0x3fff0018,len:4
[13:15:38]load:0x3fff001c,len:952
[13:15:38]load:0x40078000,len:6084
[13:15:38]load:0x40080000,len:7944
[13:15:38]entry 0x40080310
[13:15:38][I][logger:166]: Log initialized
[13:15:38][C][ota:366]: There have been 9 suspected unsuccessful boot attempts.
[13:15:38][I][app:029]: Running through setup()...
[13:15:38][D][binary_sensor:034]: 'PIR Sensor': Sending initial state OFF
[13:15:38][D][binary_sensor:034]: 'Button': Sending initial state ON
[13:15:38][D][esp-idf:000]: E (72) rmt: rmt_driver_install(725): RMT driver already installed for channel
[13:15:38]
[13:15:38]ESP_ERROR_CHECK failed: esp_err_t 0x103 (ESP_ERR_INVALID_STATE) at 0x4008de7c
[13:15:38]file: "/data/kitty_kam_front_shelter/.piolibdeps/kitty_kam_front_shelter/NeoPixelBus/src/internal/NeoEsp32RmtMethod.h" line 425
[13:15:38]func: void NeoEsp32RmtMethodBase<T_SPEED, T_CHANNEL>::Initialize() [with T_SPEED = NeoEsp32RmtSpeedWs2812x; T_CHANNEL = NeoEsp32RmtChannel0]
[13:15:38]expression: rmt_driver_install(T_CHANNEL::RmtChannelNumber, 0, ESP_INTR_FLAG_IRAM | ESP_INTR_FLAG_LEVEL1)
[13:15:38]
[13:15:38]Backtrace: 0x4008d980:0x3ffb1c60 0x4008de7f:0x3ffb1c80 0x400dea80:0x3ffb1ca0 0x400deb05:0x3ffb1cf0 0x400deb1a:0x3ffb1d30 0x4015a83d:0x3ffb1d50 0x400d6c01:0x3ffb1d70 0x4015ac4d:0x3ffb1d90 0x400dd34d:0x3ffb1db0 0x400df2f6:0x3ffb1e00 0x400e3e33:0x3ffb1fb0 0x4008a0c9:0x3ffb1fd0
[13:15:38]
[13:15:38]Rebooting...
[13:15:38]ets Jun 8 2016 00:22:57
[13:15:38]
[13:15:38]rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[13:15:38]configsip: 0, SPIWP:0xee
[13:15:38]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[13:15:38]mode:DIO, clock div:2
[13:15:38]load:0x3fff0018,len:4
[13:15:38]load:0x3fff001c,len:952
[13:15:38]load:0x40078000,len:6084
[13:15:38]load:0x40080000,len:7944
[13:15:38]entry 0x40080310
[13:15:38][I][logger:166]: Log initialized
[13:15:38][C][ota:366]: There have been 10 suspected unsuccessful boot attempts.
[13:15:38][E][ota:371]: Boot loop detected. Proceeding to safe mode.
[13:15:38][I][app:029]: Running through setup()...
[13:15:38][C][wifi:033]: Setting up WiFi...
[13:15:38][D][wifi:324]: Starting scan...
[13:15:40][D][wifi:339]: Found networks:
[13:15:40][I][wifi:385]: - 'XXXXXXXXXXXXXXXXXXXX ▂▄▆█
[13:15:40][D][wifi:386]: Channel: 4
[13:15:40][D][wifi:387]: RSSI: -43 dB
[13:15:40][I][wifi:194]: WiFi Connecting to 'Israel 2.4'...
[13:15:41][I][wifi:457]: WiFi Connected!
[13:15:41][C][wifi:303]: SSID: 'XXXXXXX'
[13:15:41][C][wifi:304]: IP Address: 192.168.1.142
[13:15:41][C][wifi:306]: BSSID: XXXXXXXXXXXXXXXXX
[13:15:41][C][wifi:307]: Hostname: 'kitty_kam_front_shelter'
[13:15:41][C][wifi:311]: Signal strength: -42 dB ▂▄▆█
[13:15:41][C][wifi:315]: Channel: 4
[13:15:41][C][wifi:316]: Subnet: 255.255.255.0
[13:15:41][C][wifi:317]: Gateway: 192.168.1.198
[13:15:41][C][wifi:318]: DNS1: 0.0.0.0
[13:15:41][C][wifi:319]: DNS2: 0.0.0.0
[13:15:41][C][ota:029]: Over-The-Air Updates:
[13:15:41][C][ota:030]: Address: 192.168.1.142:3232
[13:15:41][C][ota:032]: Using Password.
[13:15:41][W][ota:036]: Last Boot was an unhandled reset, will proceed to safe mode in 0 restarts
[13:15:41][I][app:059]: setup() finished successfully!
[13:15:41][I][ota:381]: Waiting for OTA attempt.
[13:15:41][I][app:105]: ESPHome version 1.15.3 compiled on Jan 1 2021, 13:04:48
[13:15:41][C][wifi:443]: WiFi:
[13:15:41][C][wifi:303]: SSID: 'Israel 2.4'
[13:15:41][C][wifi:304]: IP Address: 192.168.1.142
[13:15:41][C][wifi:306]: BSSID: 50:6A:03:A6:AD:0F
[13:15:41][C][wifi:307]: Hostname: 'kitty_kam_front_shelter'
[13:15:41][C][wifi:311]: Signal strength: -38 dB ▂▄▆█
[13:15:41][C][wifi:315]: Channel: 4
[13:15:41][C][wifi:316]: Subnet: 255.255.255.0
[13:15:41][C][wifi:317]: Gateway: 192.168.1.198
[13:15:41][C][wifi:318]: DNS1: 0.0.0.0
[13:15:41][C][wifi:319]: DNS2: 0.0.0.0
[13:15:41][C][logger:185]: Logger:
[13:15:41][C][logger:186]: Level: DEBUG
[13:15:41][C][logger:187]: Log Baud Rate: 115200
[13:15:41][C][logger:188]: Hardware UART: UART0
[13:15:41][C][ota:029]: Over-The-Air Updates:
[13:15:41][C][ota:030]: Address: 192.168.1.142:3232
[13:15:41][C][ota:032]: Using Password.
[13:15:41][W][ota:036]: Last Boot was an unhandled reset, will proceed to safe mode in 0 restarts
The board ends up in a boot loop and I cannot access except by usb serial connection to reload.
As I understand it, to get this to work with neopixelbus, I must use method: ESP32_RMT_(x)
which handles the merger of the clock and data using the Consumer IR hardware in the ESP32 into the single data line the WS2812B uses and nepixelbus allows a GRBW data format. This evidenced by the lack of an error for unsupported type
. Other methods
result in compile errors from not allocating the clock pin needed by other pixel chip types as one would expect.
Some other things to note.
- I have started each attempt with a
clean
then compile
.
- Note that I have tried numerous variants (commented out) that did not result in errors flagged in error.
- I am not now using
- platform: fastled_clockless
because it does not allow an rgb_order: GRBW.
- I am now using ESPHome Current version: 1.15.3. I was unable to automagically upgrade from .2 but that is another issue. The .2 version showed green dot. but version numbers disagreed. Uninstall and reinstall ?fixed?.
- While testing the pixels, I have commented out references to the oled display and the camera on the board in the ESPHome config file.
- This same board works as-is in Arduino IDE with what is - to the best of my knowledge - an equivalent software setup. Essentially just a reference to the gpio pin for pixel data and how to use it.
- I have discounted (see above) the mere presence of any existing components on the board- either active or passive as a cause of my problems.
Thanks again.
Q