Need help using Neopixel with a FireBeelte-Esp32

I'm trying to get the example code for the NeoPixel on a FireBeetle ESP32 (FireBeetle ESP32 IoT Microcontroller with 250+ ESP32 Tutorials (Supports Wi-Fi & Bluetooth) - DFRobot) though there's an error within the Adafruit_NeoPixel\esp.c. I'm not sure how to address this error or what else to do to control the NeoPixel Strip (Adafruit NeoPixel LED Strip with 3-pin JST PH 2mm Connector [60 LED/meter / 0.5 Meter] : ID 3919 : Adafruit Industries, Unique & fun DIY electronics and kits)

Example Code with 30 pixel strip

/*
 * This ESP32 code is created by esp32io.com
 *
 * This ESP32 code is released in the public domain
 *
 * For more detail (instruction and wiring diagram), visit https://esp32io.com/tutorials/esp32-neopixel-led-strip
 */

#include <Adafruit_NeoPixel.h>

#define PIN_NEO_PIXEL 6  
#define NUM_PIXELS 30     // The number of LEDs (pixels) on NeoPixel LED strip

Adafruit_NeoPixel NeoPixel(NUM_PIXELS, PIN_NEO_PIXEL, NEO_GRB + NEO_KHZ800);

void setup() {
  NeoPixel.begin();  // initialize NeoPixel strip object (REQUIRED)
}

void loop() {
  NeoPixel.clear();  // set all pixel colors to 'off'. It only takes effect if pixels.show() is called

  // turn pixels to green one-by-one with delay between each pixel
  for (int pixel = 0; pixel < NUM_PIXELS; pixel++) {           // for each pixel
    NeoPixel.setPixelColor(pixel, NeoPixel.Color(0, 255, 0));  // it only takes effect if pixels.show() is called
    NeoPixel.show();                                           // update to the NeoPixel Led Strip

    delay(500);  // 500ms pause between each pixel
  }

  // turn off all pixels for two seconds
  NeoPixel.clear();
  NeoPixel.show();  // update to the NeoPixel Led Strip
  delay(2000);      // 2 seconds off time

  // turn on all pixels to red at the same time for two seconds
  for (int pixel = 0; pixel < NUM_PIXELS; pixel++) {           // for each pixel
    NeoPixel.setPixelColor(pixel, NeoPixel.Color(255, 0, 0));  // it only takes effect if pixels.show() is called
  }
  NeoPixel.show();  // update to the NeoPixel Led Strip
  delay(1000);      // 1 second on time

  // turn off all pixels for one seconds
  NeoPixel.clear();
  NeoPixel.show();  // update to the NeoPixel Led Strip
  delay(1000);      // 1 second off time
}

Error Message:

c:\Users\Jared\OneDrive\Documents\Arduino\libraries\Adafruit_NeoPixel\esp.c: In function 'espShow':
c:\Users\Jared\OneDrive\Documents\Arduino\libraries\Adafruit_NeoPixel\esp.c:184:26: error: 'REF_CLK_FREQ' undeclared (first use in this function)
         counter_clk_hz = REF_CLK_FREQ / (div);
                          ^
c:\Users\Jared\OneDrive\Documents\Arduino\libraries\Adafruit_NeoPixel\esp.c:184:26: note: each undeclared identifier is reported only once for each function it appears in
c:\Users\Jared\OneDrive\Documents\Arduino\libraries\Adafruit_NeoPixel\esp.c:212:5: error: too many arguments to function 'rmt_wait_tx_done'
     rmt_wait_tx_done(config.channel, pdMS_TO_TICKS(100));
     ^
In file included from c:\Users\Jared\OneDrive\Documents\Arduino\libraries\Adafruit_NeoPixel\esp.c:71:0:
C:\Users\Jared\AppData\Local\Arduino15\packages\esp32\hardware\DFRobot_FireBeetle-ESP32\0.0.6/tools/sdk/include/driver/driver/rmt.h:684:11: note: declared here
 esp_err_t rmt_wait_tx_done(rmt_channel_t channel);
           ^

exit status 1

Compilation error: exit status 1

Are your libraries and code "up to date" or the same age (if one is old, both must be old). This looks like either the sketch or the library is not the correct version.

1 Like

Your sketch compiles clean for me. NANO board, all libs and boards current.

I could not find the directory C:\Users\bugge\AppData\Local\Arduino15\packages\esp32\hardware\DFRobot_FireBeetle-ESP32\0.0.6 on my system. Which board package did you install? What is the additional boards URL in file/preferences? Or which instructions did you follow?

Please enable verbose output during compilation under file/preferences in the IDE and compile your sketch. Please let us know what you get; I suspect 0.0.6 (based on the error that you posted)

The first few lines of the output will tell us for which board you compiled and which version of the board package you are using

For the official ESP32 board package

FQBN: esp32:esp32:dfrobot_firebeetle2_esp32c6
Using board 'dfrobot_firebeetle2_esp32c6' from platform in folder: C:\Users\bugge\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7
Using core 'esp32' from platform in folder: C:\Users\bugge\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7

For the latest DFRobot ESP32 board package (additional board URL: https://downloadcd.dfrobot.com.cn/boards/package_DFRobot_index.json)

FQBN: DFRobot:esp32:esp32
Using board 'esp32' from platform in folder: C:\Users\bugge\AppData\Local\Arduino15\packages\DFRobot\hardware\esp32\0.2.1
Using core 'esp32' from platform in folder: C:\Users\bugge\AppData\Local\Arduino15\packages\DFRobot\hardware\esp32\0.2.1

A little further it will tell us which version of the Adafruit library you are using

Detecting libraries used...
C:\Users\bugge\AppData\Local\Arduino15\packages\esp32\tools\esp-rv32\2302/bin/riscv32-esp-elf-g++ -c @C:\Users\bugge\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-632e0c2a\esp32c6/flags/cpp_flags -w -Os -Werror=return-type -w -x c++ -E -CC -DF_CPU=160000000L -DARDUINO=10607 -DARDUINO_DFROBOT_FIREBEETLE_2_ESP32C6 -DARDUINO_ARCH_ESP32 -DARDUINO_BOARD="DFROBOT_FIREBEETLE_2_ESP32C6" -DARDUINO_VARIANT="dfrobot_firebeetle2_esp32c6" -DARDUINO_PARTITION_default -DARDUINO_HOST_OS="windows" -DARDUINO_FQBN="esp32:esp32:dfrobot_firebeetle2_esp32c6:UploadSpeed=921600,CDCOnBoot=default,CPUFreq=160,FlashFreq=80,FlashMode=qio,FlashSize=4M,PartitionScheme=default,DebugLevel=none,EraseFlash=none,JTAGAdapter=default,ZigbeeMode=default" -DESP32=ESP32 -DCORE_DEBUG_LEVEL=0 -DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=0 @C:\Users\bugge\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-632e0c2a\esp32c6/flags/defines -IC:\Users\bugge\AppData\Local\Temp\.arduinoIDE-unsaved20241028-10556-iiqkju.omrx\sketch_nov28a -iprefix C:\Users\bugge\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-632e0c2a\esp32c6/include/ @C:\Users\bugge\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-632e0c2a\esp32c6/flags/includes -IC:\Users\bugge\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-632e0c2a\esp32c6/qio_qspi/include -IC:\Users\bugge\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\cores\esp32 -IC:\Users\bugge\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\variants\dfrobot_firebeetle2_esp32c6 @C:\Users\bugge\AppData\Local\Temp\arduino\sketches\CCEFE0199EF58E97625D7F3E1CC26474/build_opt.h @C:\Users\bugge\AppData\Local\Temp\arduino\sketches\CCEFE0199EF58E97625D7F3E1CC26474/file_opts C:\Users\bugge\AppData\Local\Temp\arduino\sketches\CCEFE0199EF58E97625D7F3E1CC26474\sketch\sketch_nov28a.ino.cpp -o nul
Alternatives for Adafruit_NeoPixel.h: [Adafruit NeoPixel@1.12.3]
ResolveLibrary(Adafruit_NeoPixel.h)
  -> candidates: [Adafruit NeoPixel@1.12.3]

With either of the board packages and boards mentioned above and the Adafruit NeoPixel@1.12.3] library your sketch does compile. I suspect that you are using a severely outdated version of a board package and the Adafruit library is not compatible with it; see also post #2 by @xfpd

Your options are:

  1. Downgrade the Adafruit library to something that works with your board package.
  2. Upgrade the board package that you're using.

Your topic was moved !! Please do not post in "Uncategorized"; see the sticky topics in Uncategorized - Arduino Forum.


Thanks for using code tags in your first post for both your code and the errors :+1:

Thank you so much, I had the wrong board package and library. I used the latest package you sent and fixed the correct library.