SparkFun DMX Examples not working

Hi! I’m missing something and I don’t know what, so I thought I’d give it a go here. Although I’m a software developer, it’s my first time playing around with the ESP32 or development boards in general, so bear with me :slight_smile:

I’ve bought the SparkFun Thing Plus and SparkFun ESP32 Thing Plus DMX to LED Shield in an attempt to do some stuff with DMX lighting. I got the SparkFun Thing Plus examples (light blinking, bluetooth connection) to work perfectly, so I know I have my Arduino IDE and connection to my board setup right.

Next step for me is to try and get one of the examples from sparkfun/SparkFunDMX to work, but here I’m running into issues quickly. I’ve added the libraries according to SparkFun ESP32 DMX to LED Shield - SparkFun Learn and I’ve put Example 1 - DMX Output in Arduino IDE. I’m trying to just verify the code, but I quickly run into errors not in my code but having to do with HardwareSerial used by the SparkfunDMX code. I’ll put the errors below. I’m a bit lost as to whether I’m missing a step, whether these errors could be caused due to version mismatches between the libraries used or whether there’s a whole different cause. I hope anyone can give me a push into the right direction.

c:\Users\Tim\Documents\Arduino\libraries\SparkFun_DMX_Shield_Library\src\SparkFunDMX.cpp: In member function 'void SparkFunDMX::setComDir(bool)':
c:\Users\Tim\Documents\Arduino\libraries\SparkFun_DMX_Shield_Library\src\SparkFunDMX.cpp:55:28: error: no matching function for call to 'HardwareSerial::flush(bool)'
     _dmxSerial->flush(false);
                            ^
In file included from C:\Users\Tim\AppData\Local\Arduino15\packages\SparkFun\hardware\esp32\1.0.1\cores\esp32/Arduino.h:154:0,
                 from c:\Users\Tim\Documents\Arduino\libraries\SparkFun_DMX_Shield_Library\src\SparkFunDMX.h:19,
                 from c:\Users\Tim\Documents\Arduino\libraries\SparkFun_DMX_Shield_Library\src\SparkFunDMX.cpp:17:
C:\Users\Tim\AppData\Local\Arduino15\packages\SparkFun\hardware\esp32\1.0.1\cores\esp32/HardwareSerial.h:65:10: note: candidate: virtual void HardwareSerial::flush()
     void flush(void);
          ^
C:\Users\Tim\AppData\Local\Arduino15\packages\SparkFun\hardware\esp32\1.0.1\cores\esp32/HardwareSerial.h:65:10: note:   candidate expects 0 arguments, 1 provided
c:\Users\Tim\Documents\Arduino\libraries\SparkFun_DMX_Shield_Library\src\SparkFunDMX.cpp: In member function 'bool SparkFunDMX::update()':
c:\Users\Tim\Documents\Arduino\libraries\SparkFun_DMX_Shield_Library\src\SparkFunDMX.cpp:150:36: error: no matching function for call to 'HardwareSerial::flush(bool)'
             _dmxSerial->flush(false);
                                    ^
In file included from C:\Users\Tim\AppData\Local\Arduino15\packages\SparkFun\hardware\esp32\1.0.1\cores\esp32/Arduino.h:154:0,
                 from c:\Users\Tim\Documents\Arduino\libraries\SparkFun_DMX_Shield_Library\src\SparkFunDMX.h:19,
                 from c:\Users\Tim\Documents\Arduino\libraries\SparkFun_DMX_Shield_Library\src\SparkFunDMX.cpp:17:
C:\Users\Tim\AppData\Local\Arduino15\packages\SparkFun\hardware\esp32\1.0.1\cores\esp32/HardwareSerial.h:65:10: note: candidate: virtual void HardwareSerial::flush()
     void flush(void);
          ^
C:\Users\Tim\AppData\Local\Arduino15\packages\SparkFun\hardware\esp32\1.0.1\cores\esp32/HardwareSerial.h:65:10: note:   candidate expects 0 arguments, 1 provided
c:\Users\Tim\Documents\Arduino\libraries\SparkFun_DMX_Shield_Library\src\SparkFunDMX.cpp:155:50: error: no matching function for call to 'HardwareSerial::read(uint8_t [513], uint16_t&)'
         _dmxSerial->read(_dmxBuffer, _numChannels);
                                                  ^
In file included from C:\Users\Tim\AppData\Local\Arduino15\packages\SparkFun\hardware\esp32\1.0.1\cores\esp32/Arduino.h:154:0,
                 from c:\Users\Tim\Documents\Arduino\libraries\SparkFun_DMX_Shield_Library\src\SparkFunDMX.h:19,
                 from c:\Users\Tim\Documents\Arduino\libraries\SparkFun_DMX_Shield_Library\src\SparkFunDMX.cpp:17:
C:\Users\Tim\AppData\Local\Arduino15\packages\SparkFun\hardware\esp32\1.0.1\cores\esp32/HardwareSerial.h:64:9: note: candidate: virtual int HardwareSerial::read()
     int read(void);
         ^
C:\Users\Tim\AppData\Local\Arduino15\packages\SparkFun\hardware\esp32\1.0.1\cores\esp32/HardwareSerial.h:64:9: note:   candidate expects 0 arguments, 2 provided
exit status 1

Compilation error: exit status 1

In case it’s relevant, here’s some versions:

Libraries:

  • ArtnetWifi: 1.6.1
  • ESP32Servo: 3.0.9
  • Sparkfun DMX Shield Library: 3.0.1

Boards:

  • Sparkfun ESP32 Boards: 1.0.1

Looking at your error messages, the issue is clear: there’s a version incompatibility between the SparkFun DMX Shield Library and your ESP32 board package.

The Problem

The SparkFun DMX library is calling HardwareSerial methods with parameters that don’t exist in your version:

  1. flush(false) - Your HardwareSerial only has flush() with no parameters

  2. read(_dmxBuffer, _numChannels) - Your HardwareSerial only has read() with no parameters

The SparkFun ESP32 Boards package version 1.0.1 is very old and uses an older version of the ESP32 Arduino core that doesn’t have these extended methods.

The Solution

You need to update your ESP32 board package to a newer version that’s compatible with the DMX library. Here’s how:

Step 1: Update the Board Package

  1. In Arduino IDE, go to Tools → Board → Boards Manager

  2. Search for “ESP32”

  3. Find “SparkFun ESP32 Boards” or “esp32 by Espressif Systems”

  4. Update to at least version 2.0.0 or newer (the latest stable version is recommended)

Step 2: Verify Board Selection

After updating:

  1. Go to Tools → Board

  2. Make sure your SparkFun ESP32 Thing Plus is still selected

  3. Verify the port is correct under Tools → Port

Step 3: Try Compiling Again

The newer ESP32 core includes the extended HardwareSerial methods that the DMX library expects.

Additional Notes

  • SparkFun DMX Shield Library 3.0.1 requires ESP32 core 2.x or newer

  • If you’re using the SparkFun board definitions, you may want to switch to the official Espressif ESP32 board package (which SparkFun’s newer versions are based on anyway)

  • Your board should still work with all the examples once the core is updated

Let me know if you run into any issues after updating!

Hi Tim (@tim2 ),

Apologies. The “SparkFun ESP32 Arduino” / “SparkFun ESP32 Boards” Board Package is way out of date. It has been superseded by “ESP32 Arduino” / “esp32” by “Espressif Systems”. You will find the SparkFun ESP32 Thing Plus boards if you scroll down the list of boards. Please make sure you select the correct one, as the different variants have different pinouts.

Apologies for the hassle - and the slow reply,
Paul

1 Like