Help compiling the stairs_wipe_basic usermod

Hello,
Hoping someone can help me add the stairs_wipe_basic usermod.

I am able to compile the main branch and have also successfully added the Animated_Staircase usermod.

The readme file in stairs_wipe_basic doesn’t really outline what to do. There are some instructions in the stairway-wipe-usermod-v2.h file which I thought I followed correctly but I keep getting errors.

If anyone has successfully added this usermod, could you please outline the steps?

Thank you in advance

1 Like

Finally…figured it out.

For anyone in the future needing more detailed steps, here is what to do.

  1. Copy the stairway-wipe-usermod-v2.h file and place it in the wled00 folder (same folder that contains the wled00.ino file).

  2. add #include "stairway-wipe-usermod-v2.h" to the top of the usermods_list.cpp file. This goes just under the green comments. Be sure to add a blank line before and after.

  3. add usermods.add(new StairwayWipeUsermod()); to the end of the usermods_list.cpp file. This goes before the ending } and be sure to also add a blank line between the code above and the }. Also confirm spacing is correct. If using VS the file tab will light up red and show how many errors you have. There should not be any.

Final clarification here is the entire usermods_list.cpp file for reference.

#include "wled.h"
/*
 * Register your v2 usermods here!
 *   (for v1 usermods using just usermod.cpp, you can ignore this file)
 */

/*
 * Add/uncomment your usermod filename here (and once more below)
 * || || ||
 * \/ \/ \/
 */
//#include "../usermods/EXAMPLE_v2/usermod_v2_example.h"

#include "stairway-wipe-usermod-v2.h"

#ifdef USERMOD_BATTERY_STATUS_BASIC
#include "../usermods/battery_status_basic/usermod_v2_battery_status_basic.h"
#endif

#ifdef USERMOD_DALLASTEMPERATURE
#include "../usermods/Temperature/usermod_temperature.h"
#endif

#ifdef USERMOD_SN_PHOTORESISTOR
#include "../usermods/SN_Photoresistor/usermod_sn_photoresistor.h"
#endif

#ifdef USERMOD_PWM_FAN
#include "../usermods/PWM_fan/usermod_PWM_fan.h"
#endif

#ifdef USERMOD_BUZZER
#include "../usermods/buzzer/usermod_v2_buzzer.h"
#endif
#ifdef USERMOD_SENSORSTOMQTT
#include "../usermods/sensors_to_mqtt/usermod_v2_SensorsToMqtt.h"
#endif
#ifdef USERMOD_PIRSWITCH
#include "../usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h"
#endif

#ifdef USERMOD_MODE_SORT
#include "../usermods/usermod_v2_mode_sort/usermod_v2_mode_sort.h"
#endif

// BME280 v2 usermod. Define "USERMOD_BME280" in my_config.h
#ifdef USERMOD_BME280
#include "../usermods/BME280_v2/usermod_bme280.h"
#endif
#ifdef USERMOD_FOUR_LINE_DISPLAY
  #ifdef USE_ALT_DISPlAY
    #include "../usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h"
  #else 
    #include "../usermods/usermod_v2_four_line_display/usermod_v2_four_line_display.h"
  #endif
#endif
#ifdef USERMOD_ROTARY_ENCODER_UI
  #ifdef USE_ALT_DISPlAY
    #include "../usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.h"
  #else
    #include "../usermods/usermod_v2_rotary_encoder_ui/usermod_v2_rotary_encoder_ui.h"
  #endif
#endif
#ifdef USERMOD_AUTO_SAVE
#include "../usermods/usermod_v2_auto_save/usermod_v2_auto_save.h"
#endif

#ifdef USERMOD_DHT
#include "../usermods/DHT/usermod_dht.h"
#endif

#ifdef USERMOD_VL53L0X_GESTURES
#include <Wire.h> //it's needed here to correctly resolve dependencies
#include "../usermods/VL53L0X_gestures/usermod_vl53l0x_gestures.h"
#endif

#ifdef USERMOD_ANIMATED_STAIRCASE
#include "../usermods/Animated_Staircase/Animated_Staircase.h"
#endif

#ifdef USERMOD_MULTI_RELAY
#include "../usermods/multi_relay/usermod_multi_relay.h"
#endif

#ifdef USERMOD_RTC
#include "../usermods/RTC/usermod_rtc.h"
#endif

#ifdef USERMOD_ELEKSTUBE_IPS
#include "../usermods/EleksTube_IPS/usermod_elekstube_ips.h"
#endif

#ifdef USERMOD_ROTARY_ENCODER_BRIGHTNESS_COLOR
#include "../usermods/usermod_rotary_brightness_color/usermod_rotary_brightness_color.h"
#endif

#ifdef RGB_ROTARY_ENCODER
#include "../usermods/rgb-rotary-encoder/rgb-rotary-encoder.h"
#endif

#ifdef USERMOD_SEVEN_SEGMENT
#include "../usermods/seven_segment_display/usermod_v2_seven_segment_display.h"
#endif

#ifdef USERMOD_SSDR
#include "../usermods/seven_segment_display_reloaded/usermod_seven_segment_reloaded.h"
#endif

#ifdef USERMOD_CRONIXIE
#include "../usermods/Cronixie/usermod_cronixie.h"
#endif

#ifdef QUINLED_AN_PENTA
#include "../usermods/quinled-an-penta/quinled-an-penta.h"
#endif

#ifdef USERMOD_WIZLIGHTS
#include "../usermods/wizlights/wizlights.h"
#endif

#ifdef USERMOD_WORDCLOCK
#include "../usermods/usermod_v2_word_clock/usermod_v2_word_clock.h"
#endif

#ifdef USERMOD_MY9291
#include "../usermods/MY9291/usermode_MY9291.h"
#endif

#ifdef USERMOD_SI7021_MQTT_HA
#include "../usermods/Si7021_MQTT_HA/usermod_si7021_mqtt_ha.h"
#endif

void registerUsermods()
{
/*
   * Add your usermod class name here
   * || || ||
   * \/ \/ \/
   */
  //usermods.add(new MyExampleUsermod());
  
  #ifdef USERMOD_BATTERY_STATUS_BASIC
  usermods.add(new UsermodBatteryBasic());
  #endif

  #ifdef USERMOD_DALLASTEMPERATURE
  usermods.add(new UsermodTemperature());
  #endif

  #ifdef USERMOD_SN_PHOTORESISTOR
  usermods.add(new Usermod_SN_Photoresistor());
  #endif

  #ifdef USERMOD_PWM_FAN
  usermods.add(new PWMFanUsermod());
  #endif

  #ifdef USERMOD_BUZZER
  usermods.add(new BuzzerUsermod());
  #endif

  #ifdef USERMOD_BME280
  usermods.add(new UsermodBME280());
  #endif
  #ifdef USERMOD_SENSORSTOMQTT
  usermods.add(new UserMod_SensorsToMQTT());
  #endif
  #ifdef USERMOD_PIRSWITCH
  usermods.add(new PIRsensorSwitch());
  #endif

  #ifdef USERMOD_MODE_SORT
  usermods.add(new ModeSortUsermod());
  #endif
  #ifdef USERMOD_FOUR_LINE_DISPLAY
  usermods.add(new FourLineDisplayUsermod());
  #endif
  #ifdef USERMOD_ROTARY_ENCODER_UI
  usermods.add(new RotaryEncoderUIUsermod()); // can use USERMOD_FOUR_LINE_DISPLAY
  #endif
  #ifdef USERMOD_AUTO_SAVE
  usermods.add(new AutoSaveUsermod());  // can use USERMOD_FOUR_LINE_DISPLAY
  #endif

  #ifdef USERMOD_DHT
  usermods.add(new UsermodDHT());
  #endif

  #ifdef USERMOD_VL53L0X_GESTURES
  usermods.add(new UsermodVL53L0XGestures());
  #endif

  #ifdef USERMOD_ANIMATED_STAIRCASE
  usermods.add(new Animated_Staircase());
  #endif

  #ifdef USERMOD_MULTI_RELAY
  usermods.add(new MultiRelay());
  #endif

  #ifdef USERMOD_RTC
  usermods.add(new RTCUsermod());
  #endif

  #ifdef USERMOD_ELEKSTUBE_IPS
  usermods.add(new ElekstubeIPSUsermod());
  #endif

  #ifdef USERMOD_ROTARY_ENCODER_BRIGHTNESS_COLOR
  usermods.add(new RotaryEncoderBrightnessColor());
  #endif

  #ifdef RGB_ROTARY_ENCODER
  usermods.add(new RgbRotaryEncoderUsermod());
  #endif

  #ifdef USERMOD_SEVEN_SEGMENT
  usermods.add(new SevenSegmentDisplay());
  #endif

  #ifdef USERMOD_SSDR
  usermods.add(new UsermodSSDR());
  #endif

  #ifdef USERMOD_CRONIXIE
  usermods.add(new UsermodCronixie());
  #endif

  #ifdef QUINLED_AN_PENTA
  usermods.add(new QuinLEDAnPentaUsermod());
  #endif

  #ifdef USERMOD_WIZLIGHTS
  usermods.add(new WizLightsUsermod());
  #endif
  
  #ifdef USERMOD_WORDCLOCK
  usermods.add(new WordClockUsermod());
  #endif

  #ifdef USERMOD_MY9291
  usermods.add(new MY9291Usermod());
  #endif
  
  #ifdef USERMOD_SI7021_MQTT_HA
  usermods.add(new Si7021_MQTT_HA());
  #endif

  usermods.add(new StairwayWipeUsermod());
  
}

Well dang it. I thought I figured it out. The code compiled but when I uploaded it, nothing is showing in my Usermods.

Maybe there is something I need to do with the .ino file that is not outlined in the instructions?

I found another post where the person copied the contents of the wled06_usermod.ino file into the usermod.cpp file. When I do this and try to compile I get two errors:

wled00/usermod.cpp: In function 'void userLoop()':
wled00/usermod.cpp:44:17: error: 'startWipe' was not declared in this scope
       startWipe();
                 ^
wled00/usermod.cpp:69:80: error: 'turnOff' was not declared in this scope
       if (millis() + strip.timebase > (725 + (255 - effectSpeed)*150)) turnOff(); //wipe complete
                                                                                ^

I found another article here that says to add:

#include <Arduino.h>
#include "wled.h"

void startWipe();
void turnOff();

to the top of the usermod.cpp file. I did this and the two errors mentioned above went away and the code compiled. But again, it doesn’t show up in my Usermods. So I’m not sure if it worked or not…

download ready bin files WLED-wemos-shield/resources/Firmware/WLED_wemos_shield/v0.13.2-a0 at master · srg74/WLED-wemos-shield · GitHub

1 Like

Even better! Thank you.

Hi,
The download link doesn’t work anymore and I’m struggling to compile.
Could someone help with clear steps to use this please?

You may need to consult original author to update the usermod to be compatible with recent WLED version.
Or do it yourself by studying the code and adjusting appropriately.

Animated staircase has been recently updated and supports PIR sensors as well as ultrasonic sensors.

NOTE: I do not recommend ultrasonic sensors as the speed of sound is not adequate for good operation (detection of object more than 40cm away).

Thanks,
Can animated staircase work the same way as this mod?
I’ve been playing around and couldn’t find any way as it looks for segments

IMO no, but haven’t used any of them, animated staircase needs as many segments as there are steps for best function.
search this forum as there were a lot of words exchanged about that particular usermod

I’m here again as I found the solution and seen in many places where the people makes a mistake.
thanks to @blazoncek I have studied the code a little bit
Here you go:
1: to compile
from main repo without any changes add #include "../usermods/stairway_wipe_basic/stairway-wipe-usermod-v2.h" at the top of usermods_list.cpp and usermods.add(new StairwayWipeUsermod()); at the bottom
final file should look like this:

#include "wled.h"
/*
 * Register your v2 usermods here!
 *   (for v1 usermods using just usermod.cpp, you can ignore this file)
 */

/*
 * Add/uncomment your usermod filename here (and once more below)
 * || || ||
 * \/ \/ \/
 */
//#include "../usermods/EXAMPLE_v2/usermod_v2_example.h"
#include "../usermods/stairway_wipe_basic/stairway-wipe-usermod-v2.h"

#ifdef USERMOD_BATTERY_STATUS_BASIC
#include "../usermods/battery_status_basic/usermod_v2_battery_status_basic.h"
#endif

#ifdef USERMOD_DALLASTEMPERATURE
#include "../usermods/Temperature/usermod_temperature.h"
#endif

#ifdef USERMOD_SN_PHOTORESISTOR
#include "../usermods/SN_Photoresistor/usermod_sn_photoresistor.h"
#endif

#ifdef USERMOD_PWM_FAN
#include "../usermods/PWM_fan/usermod_PWM_fan.h"
#endif

#ifdef USERMOD_BUZZER
#include "../usermods/buzzer/usermod_v2_buzzer.h"
#endif
#ifdef USERMOD_SENSORSTOMQTT
#include "../usermods/sensors_to_mqtt/usermod_v2_SensorsToMqtt.h"
#endif
#ifdef USERMOD_PIRSWITCH
#include "../usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h"
#endif

#ifdef USERMOD_MODE_SORT
#include "../usermods/usermod_v2_mode_sort/usermod_v2_mode_sort.h"
#endif

// BME280 v2 usermod. Define "USERMOD_BME280" in my_config.h
#ifdef USERMOD_BME280
#include "../usermods/BME280_v2/usermod_bme280.h"
#endif
#ifdef USERMOD_FOUR_LINE_DISPLAY
  #ifdef USE_ALT_DISPlAY
    #include "../usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h"
  #else 
    #include "../usermods/usermod_v2_four_line_display/usermod_v2_four_line_display.h"
  #endif
#endif
#ifdef USERMOD_ROTARY_ENCODER_UI
  #ifdef USE_ALT_DISPlAY
    #include "../usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.h"
  #else
    #include "../usermods/usermod_v2_rotary_encoder_ui/usermod_v2_rotary_encoder_ui.h"
  #endif
#endif
#ifdef USERMOD_AUTO_SAVE
#include "../usermods/usermod_v2_auto_save/usermod_v2_auto_save.h"
#endif

#ifdef USERMOD_DHT
#include "../usermods/DHT/usermod_dht.h"
#endif

#ifdef USERMOD_VL53L0X_GESTURES
#include <Wire.h> //it's needed here to correctly resolve dependencies
#include "../usermods/VL53L0X_gestures/usermod_vl53l0x_gestures.h"
#endif

#ifdef USERMOD_ANIMATED_STAIRCASE
#include "../usermods/Animated_Staircase/Animated_Staircase.h"
#endif

#ifdef USERMOD_MULTI_RELAY
#include "../usermods/multi_relay/usermod_multi_relay.h"
#endif

#ifdef USERMOD_RTC
#include "../usermods/RTC/usermod_rtc.h"
#endif

#ifdef USERMOD_ELEKSTUBE_IPS
#include "../usermods/EleksTube_IPS/usermod_elekstube_ips.h"
#endif

#ifdef USERMOD_ROTARY_ENCODER_BRIGHTNESS_COLOR
#include "../usermods/usermod_rotary_brightness_color/usermod_rotary_brightness_color.h"
#endif

#ifdef RGB_ROTARY_ENCODER
#include "../usermods/rgb-rotary-encoder/rgb-rotary-encoder.h"
#endif

#ifdef USERMOD_SEVEN_SEGMENT
#include "../usermods/seven_segment_display/usermod_v2_seven_segment_display.h"
#endif

#ifdef USERMOD_SSDR
#include "../usermods/seven_segment_display_reloaded/usermod_seven_segment_reloaded.h"
#endif

#ifdef USERMOD_CRONIXIE
#include "../usermods/Cronixie/usermod_cronixie.h"
#endif

#ifdef QUINLED_AN_PENTA
#include "../usermods/quinled-an-penta/quinled-an-penta.h"
#endif

#ifdef USERMOD_WIZLIGHTS
#include "../usermods/wizlights/wizlights.h"
#endif

#ifdef USERMOD_WORDCLOCK
#include "../usermods/usermod_v2_word_clock/usermod_v2_word_clock.h"
#endif

#ifdef USERMOD_MY9291
#include "../usermods/MY9291/usermode_MY9291.h"
#endif

#ifdef USERMOD_SI7021_MQTT_HA
#include "../usermods/Si7021_MQTT_HA/usermod_si7021_mqtt_ha.h"
#endif

void registerUsermods()
{
/*
   * Add your usermod class name here
   * || || ||
   * \/ \/ \/
   */
  //usermods.add(new MyExampleUsermod());

  #ifdef USERMOD_BATTERY_STATUS_BASIC
  usermods.add(new UsermodBatteryBasic());
  #endif

  #ifdef USERMOD_DALLASTEMPERATURE
  usermods.add(new UsermodTemperature());
  #endif

  #ifdef USERMOD_SN_PHOTORESISTOR
  usermods.add(new Usermod_SN_Photoresistor());
  #endif

  #ifdef USERMOD_PWM_FAN
  usermods.add(new PWMFanUsermod());
  #endif

  #ifdef USERMOD_BUZZER
  usermods.add(new BuzzerUsermod());
  #endif

  #ifdef USERMOD_BME280
  usermods.add(new UsermodBME280());
  #endif
  #ifdef USERMOD_SENSORSTOMQTT
  usermods.add(new UserMod_SensorsToMQTT());
  #endif
  #ifdef USERMOD_PIRSWITCH
  usermods.add(new PIRsensorSwitch());
  #endif

  #ifdef USERMOD_MODE_SORT
  usermods.add(new ModeSortUsermod());
  #endif
  #ifdef USERMOD_FOUR_LINE_DISPLAY
  usermods.add(new FourLineDisplayUsermod());
  #endif
  #ifdef USERMOD_ROTARY_ENCODER_UI
  usermods.add(new RotaryEncoderUIUsermod()); // can use USERMOD_FOUR_LINE_DISPLAY
  #endif
  #ifdef USERMOD_AUTO_SAVE
  usermods.add(new AutoSaveUsermod());  // can use USERMOD_FOUR_LINE_DISPLAY
  #endif

  #ifdef USERMOD_DHT
  usermods.add(new UsermodDHT());
  #endif

  #ifdef USERMOD_VL53L0X_GESTURES
  usermods.add(new UsermodVL53L0XGestures());
  #endif

  #ifdef USERMOD_ANIMATED_STAIRCASE
  usermods.add(new Animated_Staircase());
  #endif

  #ifdef USERMOD_MULTI_RELAY
  usermods.add(new MultiRelay());
  #endif

  #ifdef USERMOD_RTC
  usermods.add(new RTCUsermod());
  #endif

  #ifdef USERMOD_ELEKSTUBE_IPS
  usermods.add(new ElekstubeIPSUsermod());
  #endif

  #ifdef USERMOD_ROTARY_ENCODER_BRIGHTNESS_COLOR
  usermods.add(new RotaryEncoderBrightnessColor());
  #endif

  #ifdef RGB_ROTARY_ENCODER
  usermods.add(new RgbRotaryEncoderUsermod());
  #endif

  #ifdef USERMOD_SEVEN_SEGMENT
  usermods.add(new SevenSegmentDisplay());
  #endif

  #ifdef USERMOD_SSDR
  usermods.add(new UsermodSSDR());
  #endif

  #ifdef USERMOD_CRONIXIE
  usermods.add(new UsermodCronixie());
  #endif

  #ifdef QUINLED_AN_PENTA
  usermods.add(new QuinLEDAnPentaUsermod());
  #endif

  #ifdef USERMOD_WIZLIGHTS
  usermods.add(new WizLightsUsermod());
  #endif
  
  #ifdef USERMOD_WORDCLOCK
  usermods.add(new WordClockUsermod());
  #endif

  #ifdef USERMOD_MY9291
  usermods.add(new MY9291Usermod());
  #endif
  
  #ifdef USERMOD_SI7021_MQTT_HA
  usermods.add(new Si7021_MQTT_HA());
  #endif

  usermods.add(new StairwayWipeUsermod());

}

2: this usermode will not be listed in the usermos web interface
3: to use it you will need to send commands through api:
Example:
in my case IP address is 192.168.0.20
activate going up: http://192.168.0.20/win&U0=1
activate going down: http://192.168.0.20/win&U0=2
change wipe turn off time in seconds(15 in this case): http://192.168.0.20/win&U1=15

Everything sounds obvious but I went into this trap and hope to save others.

I will try to combine “Animated Staircase” with this one so it can run local and don’t need wifi connection with other sensors in order to work.
For me it will be a hard work as I’m a noobie and any help in this regard will be apreciatted.
If i have a solution I will post it

3 Likes

@DonEugraf Did it exactly the same way, but it shows me an error in the following line:
I added in void registerUsermods() the following line:
usermods.add(new StairwayWipeUsermod());

And at the top the following line:
#include “stairway-wipe-usermod-v2.h”

And I of course added the stairway-wipe-usermod-v2.h under the wled00 folder.

Following Aircoookies description:
2. Register the usermod by adding #include “usermod_filename.h” in the top and registerUsermod(new MyUsermodClass()) in the bottom of usermods_list.cpp

It should be named registerUsermod instead of usermods.add, so I’m a little bit confused. Can someone please help me out?

Thanks

1 Like

Hey guys, i’m trying to compile this also but having the same errors! Did anyone solve it? Ill download the wemos BIN but i want to upload it to an esp32. Ill try anyway :slight_smile:

@DonEugraf This worked great! Thanks for the analysis.

Hi there,

Tried to do it via many different ways (all from the above as well) without any luck. With the latest adjustments from @DonEugraf I get the following error codes:

*** [.pio/build/esp32dev/src/usermods_list.cpp.o] Error 1

wled00/usermods_list.cpp: In function 'void registerUsermods()':
wled00/usermods_list.cpp:259:40: error: invalid new-expression of abstract class type 'StairwayWipeUsermod'
   usermods.add(new StairwayWipeUsermod());
                                        ^
In file included from wled00/usermods_list.cpp:14:0:
wled00/../usermods/stairway_wipe_basic/stairway-wipe-usermod-v2.h:14:7: note:   because the following virtual functions are pure within 'StairwayWipeUsermod':
 class StairwayWipeUsermod : public Usermod {
       ^
In file included from wled00/wled.h:177:0,
                 from wled00/usermods_list.cpp:1:
wled00/fcn_declare.h:283:18: note:      virtual void Usermod::setup()
     virtual void setup() = 0; // pure virtual, has to be overriden
                  ^
Retrieved `.pio/build/esp32dev/libcd3/NeoPixelBus (Deanius97 conflicted copy 2024-01-22)/internal/methods/NeoPixelAvr.c.o' from cache
Retrieved `.pio/build/esp32dev/libce0/WiFi/ETH.cpp.o' from cache
Retrieved `.pio/build/esp32dev/libce0/WiFi/WiFi.cpp.o' from cache
Retrieved `.pio/build/esp32dev/libce0/WiFi/WiFiAP.cpp.o' from cache
Retrieved `.pio/build/esp32dev/libce0/WiFi/WiFiClient.cpp.o' from cache
Retrieved `.pio/build/esp32dev/libce0/WiFi/WiFiGeneric.cpp.o' from cache
Retrieved `.pio/build/esp32dev/libce0/WiFi/WiFiMulti.cpp.o' from cache
Retrieved `.pio/build/esp32dev/libce0/WiFi/WiFiSTA.cpp.o' from cache
Retrieved `.pio/build/esp32dev/libce0/WiFi/WiFiScan.cpp.o' from cache
*** [.pio/build/esp32dev/src/usermods_list.cpp.o] Error 1
Retrieved `.pio/build/esp32dev/libce0/WiFi/WiFiServer.cpp.o' from cache
=========================================== [FAILED] Took 3.03 seconds ===========================================

Environment    Status    Duration
-------------  --------  ------------
esp32dev       FAILED    00:00:03.027
===================================== 1 failed, 0 succeeded in 00:00:03.027 =====================================

Any idea how to get this usermod working?

Big thanks in advance!