How to use user Mods?

So I’ve downloaded Visual Studio plus and I’ve managed to compile it.

I’m using the beta as the board I’m using is the wt32-eth01 ethernet…

So after searching for hours and watching various videos. I’m confused and lost.

So is there a good video that shows you how to enable user mods?

Could someone talk me through this…

I’m using a ethernet board… wt32-eth01

I want to compile with settings for 4 led output pins, relay a temp input.

I want to enable the temp user mod as well…

Help!

Most usermods include instructions how to enable them. Usually in source or readme file.
For the most oftenused usermods there are #defines or -D USERMOD_xxxxxx build environment settings.
@Quindor did a nice video on self compiling WLED couple of years ago (intermittech).

I watched @Quindor video. But the npch file no longer seems to exist where he configured things.

Also with Ethernet boards within wled you can select which you have.

I can’t find where in the compile it pulls this from… Can you add different boards into that new drop down menu?

There seems to be a version 2 user mod…

Lots of things seem to have changed since @Quindor video… Apart from keep pressing build :slight_smile:

I found the easiest way for me was to have a look in platform.ini at the various [env: …] sections. Adding another section with the usermods I wanted and then updating the default_envs line achieved what i was after.

Indeed I am pressing WLED development further and a lot has changed since that December. :smiley:

If you want to join Discord, I have posted a few of my development build environment for anyone interested.

Could you give me an example or tell me what I’m doing wrong.

I want to enable user mod “Enclosure_with_OLED_temp_ESP07” I think this is a version 1?

So simply modified the usermod and copy/past/replace - wont compile.

So tried a version 2… went to user mods list… uncommented a line…

#ifdef USERMOD_SEVEN_SEGMENT

#include …/usermods/seven_segment_display/usermod_v2_seven_segment_display.h

#endif

Then wont compile and i get this errors… (board is eth)

Could someone please write a step by step? I cant be the only one who doesn’t get it.

For most used usermods a simple -D USERMOD_xxxxx in platformio.ini (or override) build_flags will suffice, for others you need to check readme.md or contact usermod creator.

Thanks @blazoncek

I rolled back to version as well and I had more success. Could you confirm I’m doing this correctly and that this is the correct place to assign a pin? I also notice that I can LED=1… How do I enter P14 and pin 15 and pin 2?

[env:esp32_eth]
board = esp32-poe
platform = ${esp32.platform}
upload_speed = 921600
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32_Ethernet -D RLYPIN=-1 -D WLED_USE_ETHERNET -D BTNPIN=-1 -USERMOD_DALLASTEMPERATURE_CELSIUS -D TEMPERATURE_PIN=-4

lib_deps = ${esp32.lib_deps}

board_build.partitions = ${esp32.default_partitions}

I do not know what you want to achieve, but defining -D TEMPERATURE_PIN=-4 is counterproductive.

I want to define which pin is used for the temp sensor…

you can do that at runtime

Runtime?

Doesn’t need to be locked in during compilation. You can change the pin setting from the GUI Config section once WLED is up and running.

That’s great… I was over thinking it.

I’ll give it go :slight_smile:

I have being playing with this stuff for the first time today on a try to make my TTGO-T-Dusplay to work with the already built usermod and I just found a way to force the Visual Studio to compile using the usermod.cpp for that specific project.

The instructions of the Readme.md must be followed, however there is a missing part which is that you shall replace the usermod.cpp from the folder wled00 for the usermod.cpp on the usermod library. That’s the trick to make a usermod to work when declaring it as a #defines doesn’t work.

That is only needed for v1 usermods.
If possible avoid using v1 usermods since they are deprecated and may be removed in future versions.

Thank you for advise. For the purpose I had it worked which was to have the IP address and module name on the old display of my TTGO T-Display ESP32.

How can I know which version 1 or 2 are the usermods? Not found anything about that on the mod files.

Ss