I created a bin with the staircase and temperature mod. Works so far, but not both at the same time. If I turn on the temp mod to the running staircase I only get a “sensor error” message. If I turn off the Staircase mod and use only the Temp mod I get a Temp in the info field and via Mqtt transmitted. What could be the reason? The pin are stored correctly… Does anyone have a tip on what I can do? Many Thanks
Having multiple mods is not documented on how to do that (the last time I read the wiki on it was a while back, so if it’s there, pardon my ignorance). I think you have to modify so the mods are unique from main WLED’s perspective. Normally it just calls up the one default usermod’s code. (I think) you need an array of usermods rather than a single usermod.
Look in the WLED code that activates usermod setup() and make it look for all enabled usermods, and execute them all. Same for WLED code that activates usermod loop().
Does that make any sense?
Never had any issues with multiple usermods. Currently running 4 on ESP8266 and 6 on ESP32.
Temperature usermod is sensitive to timing errors on ESP32 (most likely due to dual-core achitecture of ESP32) so if you are receiving sensor error while simultaneously running staircase usermod you may need to do some debugging…
Forgive my ignorance. Is the process for enabling 4 usermod’s documented in the wiki or kb site? I get confused which is the “master” for documentation and stick to the wiki when I’m in doubt.
Is it a simple matter of individually adding the usermods even if it’s the older style usermod (Usermod 1.0) that does not share well with others?
When in doubt use https://kno.wled.ge
You enable multiple usermods by defining usermod inclusion variables in the form of -D USERMOD_...
in platformio_override.ini.
One of my samples:
[env:wemos_d1_mini32_debug]
extends = env:wemos_d1_mini32_1MFS
build_flags = ${common.build_flags_esp32}
-D WLED_DISABLE_BLYNK
; DEBUG reserves GPIO1
-D WLED_DEBUG
-D LEDPIN=16
-D RLYPIN=19
-D BTNPIN=17
-D IRPIN=18
; -D WLED_MAX_BUTTONS=12
-D USERMOD_DALLASTEMPERATURE
-D TEMPERATURE_PIN=23
-D USERMOD_FOUR_LINE_DISPLAY
-D USERMOD_ROTARY_ENCODER_UI
-D USE_ALT_DISPlAY
-D USERMOD_AUTO_SAVE
;-D USERMOD_ANIMATED_STAIRCASE
-D USERMOD_PIRSWITCH
-D PIR_SENSOR_PIN=36
-D USERMOD_MULTI_RELAY # 14, 15, 32
-D MULTI_RELAY_MAX_RELAYS=3
;-D USERMOD_PWM_FAN
-D STATUSLED=-1
-D WLED_DISABLE_BROWNOUT_DET
-UWLED_USE_MY_CONFIG