rotary_encoder_ui_ALT: FourLineDisplayUsermod undefined

Hi!
I am trying to build an audioreactive rotary and display esp32 from the GitHub - Aircoookie/WLED: Control WS2812B and many more types of digital RGB LEDs with an ESP8266 or ESP32 over WiFi! repository.
My build options are:

[env:esp32dev]
board = esp32dev
platform = ${esp32.platform}
platform_packages = ${esp32.platform_packages}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp32}
  ${esp32.AR_build_flags}
  -D WLED_RELEASE_NAME=ESP32ROTDIS #-D WLED_DISABLE_BROWNOUT_DET
  -D USERMOD_AUDIOREACTIVE -D AUDIOPIN=36 -D SR_DMTYPE=0 -D SR_SQUELCH=9 -D SR_GAIN=40
  -D USERMOD_FOUR_LINE_DISPLAY -D FLD_PIN_SCL=22 -D FLD_PIN_SDA=21
  -D USERMOD_ROTARY_ENCODER_UI -D ENCODER_DT_PIN=12 -D ENCODER_CLK_PIN=14 -D ENCODER_SW_PIN=13
  -D USE_ALT_DISPlAY
lib_deps = ${esp32.lib_deps}
  https://github.com/blazoncek/arduinoFFT.git
  olikraus/U8g2 @ ^2.34.22
  ${esp32.AR_lib_deps}
  Wire

Unfortunately I am getting this error in usermod_v2_rotary_encoder_ui_ALT.h

identifier "FourLineDisplayUsermod" is undefinedC/C++(20)

as it does not see the FourLineDisplayUsermod class

  #ifdef USERMOD_FOUR_LINE_DISPLAY
    FourLineDisplayUsermod *display;

Is there a further configuration I should do in order to get the FourLineDisplayUsermod definition?

Thanks!

You can take a look on my custom builds and figure out what is will be useful for you GitHub - srg74/WLED at Shileds look at the file platformio_override.ini

Thank you for your reply!
I am not an expert programmer but I feel the platformio set up I have done is unstable.

  1. I get various and different include and not defined errors. It all depends which .h file I open or when I restart the vs code different errors appear. In the end it all compiles, but…
  2. If I do the same actions twice I don’t get the same results!
    For instance,
    I make a small change in platformio.ini
    full clean
    build

I get my .bin file.
If I do the same again it does not work, the .bin is not overwritten and if I delete it before build it’s not created again :slight_smile: , I get no binary file whatsoever. The only workaround with this is to change the name each time I want to test a change.

-D WLED_RELEASE_NAME=ESP32_v23

  1. My aim is to create a rotary enoder+display+autosave+audioreactive. I have managed to build them all but when I activate the autosave:
  • It start well but after autosaving for the first time the display becomes corrupted with dots, slow and after half a minute it hangs.
  • Unable to change the default preset number, neither from the build flags nor from the GUI menu. It is always 10/100.

Thanks again for supporting this amazing project, I am looking forward to see it running!

I managed to solve 1 and 2 by ignoring Intellisense messaging and giving a different name to the compiled .bin file each time (this needs a more permanent solution).

About 3 which is the more important part, I have the following issues to solve:

  1. Autosave: I am unable to change the settings from GUI, they always go time 10 and autosave preset 100. The other issue is that even if I get the message “Settings auto saved” the actual autosave happens much later (it is really difficult to calculate how much, but some minutes for sure). The other issue is that the autosaved presets has stored only the effect but not its time and color configuration.
  2. Rotary: It is stable. The only issue is that the setting are increased counter clock wise, whereas the OFF icon appears when the led strip is on. I have to check the wiring in case something is connected wrong.
  3. Display: Every now and then I get dots and glitches sometimes to the point I have to reboot it. It could be a loose breadboard I am using, but after soldering the project I will know for sure if it is a software issure.

If you have any ideas on the issues described above you are more than welcome!

Swap the A and B pins on your rotary encoder and you will get the expected behavior. Sounds like you’re on a breadboard so you can either swap the physical pins or in the settings.

1 Like

I triple-checked wiring and port configuration/port build options and they seem right. (I have a DFRobot
EC11 Rotary Encoder Module). Anyway I swapped A and B and it all works now.