Activate usermods in platform-override

Hi, i am trying to activate the temperatur mod, according to the platform_override.ini:

; Options
; -------
; USERMOD_DALLASTEMPERATURE                      - define this to have this user mod included wled00\usermods_list.cpp
; USERMOD_DALLASTEMPERATURE_CELSIUS              - define this to report temperatures in degrees celsius, otherwise fahrenheit will be reported
; USERMOD_DALLASTEMPERATURE_MEASUREMENT_INTERVAL - the number of milliseconds between measurements, defaults to 60 seconds
; USERMOD_DALLASTEMPERATURE_FIRST_MEASUREMENT_AT - the number of milliseconds after boot to take first measurement, defaults to 20 seconds
;
[env:d1_mini_usermod_dallas_temperature_C]
extends = env:d1_mini
build_flags = ${common.build_flags_esp8266} -D USERMOD_DALLASTEMPERATURE -D USERMOD_DALLASTEMPERATURE_CELSIUS
lib_deps = ${env.lib_deps}
    milesburton/DallasTemperature@^3.9.0
    OneWire@~2.3.5

what do i need to do ? I am new to platformIO and even to C - how do i "define this to have this user mod included " ? If i comment it out, it just yields to error messages that the header is missing

Thanks,
Tom

extends = env:d1_mini
build_flags = ${common.build_flags_esp8266}
  -D USERMOD_DALLASTEMPERATURE
lib_deps = ${env.lib_deps}
    OneWire@~2.3.6

but this yields to

Error: Invalid 'platformio_override.ini' (project configuration file): 'File contains no section headers.
file: 'platformio_override.ini', line: 1
'extends = env:d1_mini\n''

you have to add env header

[env:d1_mini_usermod_dallas_temperature_C]

don’t understand. Where do i need to put this header ? It’s in the platform_override.ini already

I just checked this env and it working fine

[env:ESP8266_dallas_sensor]
extends = env:d1_mini
build_flags = ${common.build_flags_esp8266}
  -D USERMOD_DALLASTEMPERATURE
  -UWLED_USE_MY_CONFIG
upload_speed = 460800
lib_deps = ${esp8266.lib_deps}
  OneWire@~2.3.6

I am trying with esp32_eth. I still don’t understand which files needs to be modified. Platformio_override.ini? Or other files?

The problem is you post first that you using d1 mini board which is ESP8266 and now you mentioning that you want to use ESP32 ethernet board. Can you describe what is your goal?

No, i didn’t post that - i only showed the platform_override.ini as i downloaded it from git. I do not know what i need to change after i put it in the platformio root.

I have a eth01 board so i used “default_envs = esp32_eth” in platformio.ini

I have no idea what i need to do with the override file. Probably:

; Options
; -------
; USERMOD_DALLASTEMPERATURE                      - define this to have this user mod included wled00\usermods_list.cpp
; USERMOD_DALLASTEMPERATURE_CELSIUS              - define this to report temperatures in degrees celsius, otherwise fahrenheit will be reported
; USERMOD_DALLASTEMPERATURE_MEASUREMENT_INTERVAL - the number of milliseconds between measurements, defaults to 60 seconds
; USERMOD_DALLASTEMPERATURE_FIRST_MEASUREMENT_AT - the number of milliseconds after boot to take first measurement, defaults to 20 seconds
;
[env:esp32_eth_usermod_dallas_temperature_C]
extends = env:esp32_eth
build_flags = ${common.build_flags_esp32} -D USERMOD_DALLASTEMPERATURE -D USERMOD_DALLASTEMPERATURE_CELSIUS
lib_deps = ${env.lib_deps}
    milesburton/DallasTemperature@^3.9.0
    OneWire@~2.3.5

but the usermod is still not included

[env:esp32_ethernet_dallas]
board = esp32dev
board_build.partitions = tools/WLED_ESP32_4MB_1MB_FS.csv
platform = espressif32@3.4
upload_speed = 460800
build_flags = ${common.build_flags_esp32}
  -D USERMOD_DALLASTEMPERATURE
;  -D TEMPERATURE_PIN=36
  -D WLED_RELEASE_NAME=ESP32_Ethernet
  -D WLED_ENABLE_ETHERNET
  -UWLED_USE_MY_CONFIG
lib_deps = ${esp32.lib_deps}
  OneWire@~2.3.5

just to make it sure: I put that in the OVERRIDE file, is that right ? Anyway it does not inlcude the temperature usermod - is missing in the binary.

Until now i only get it if i omit all that #ifdef in the usermod_list.cpp around temperature. So it looks to me that the defines are still not set.

If you not change any code and just add that env to your PlatformIO override file everything should work fine. I have compiled thousands time and everything is working fine.