ESP32S2 mini & DS18B20

Hi to all.
I’m new to wled but know how to compile and stuff.

Lights work almost perfectly, sometimes need powercycle but otherwise perfect.
I had really bad flickering on esp8266 at colder weathers.

I have a problem with ESP32S2 and DS18B20, just can’t get it to work.
ESPHome worked just fine with same setup.

platformio_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:lolin_s2_mini_usermod_dallas_temperature_C]
extends = env:lolin_s2_mini
build_flags = ${common.build_flags} ${esp32s2.build_flags}
  -D WLED_RELEASE_NAME=LolinS2Mini_Temp
  -D USERMOD_DALLASTEMPERATURE
  -D USERMOD_DALLASTEMPERATURE_CELSIUS
  -D WLED_DISABLE_BLYNK
  -D WLED_DISABLE_ALEXA
  -D WLED_DISABLE_INFRARED
  -D WLED_DISABLE_HUESYNC
  -D WLED_ENABLE_ADALIGHT
  -D WLED_DISABLE_LOXONE
  ;-D WLED_WATCHDOG_TIMEOUT=5
  ; DEBUG reserves GPIO1
  ;-D WLED_DEBUG
  -D TEMPERATURE_PIN=17
  ;-D CONFIG_ASYNC_TCP_USE_WDT=1
lib_deps = ${env.lib_deps}
  makuna/NeoPixelBus @ 2.6.9
  https://github.com/pbolduc/AsyncTCP.git @ 1.2.0
  milesburton/DallasTemperature@^3.9.0
  ;milesburton/DallasTemperature
  ;paulstoffregen/OneWire@^2.3.7
  https://github.com/PaulStoffregen/OneWire.git
  ;OneWire@~2.3.5
  ;robtillaart/DS18B20@^0.1.12


17 is temperature pin
16 is led pin
No resistor as I did not need it with ESPHome.

Screenshots
In last screenshot I’ve added a line to usermod_temperature.h to publish sensor type in MQTT.
( json[F(“sensor_type”)] = sensorFound; )

Thank you all.

Wled non è supportato da quel esp32 s2 mini. Devi usare un altro esp 32.

Sorry I don’t speak Spanish but I kinda know what you say.
ESP32S2 is not supported, I should use another type ESP32?

As i said, WLED is working perfectly fine (occasional hickups with wifi connection but nothing major).
Usermod is not working right or there is some library issue or something else.
I compiled firmware myself.

as i told you esp32 s2 mini is not compatible with wled. I don’t know how you managed to install it on s2 mini. :grinning: however if you use an esp 32 it works great :v: bye

You can look my platformio_override.ini, lolin_s2_mini :slight_smile:

I made order for C3:s, hopefully I’ll get temp sensor to work with C3.
Just curious if it is just a library issue.

Unable to debug as lights are outside and I have no way to serial monitor atm.

Check the “.pio/libdeps” folder for your custom build environment.

Not sure if you’re having the same issue, but I was having problems compiling the Temperature usermod for a D1 mini, and after some poking around found it wasn’t copying all the libraries to my new build environment.
I just copied the libraries over from another build and everything compiles OK now. Hopefully that gets it going for you too.
I’m hoping to get it going on a lolin s2 next as well :grinning: :crossed_fingers:

Thank you.
I kinda gave up on this and just waited C3’s to arrive.

I’ll look into this.

Signed up to say this compiled for my S2 mini, using it happily with Sound Reactive:

[env:lolin_esp32s2_saola_soundreactive]
board = esp32-s2-saola-1
platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2.2/platform-tasmota-espressif32-2.0.2.zip
platform_packages =
framework = arduino
board_build.partitions = tools/WLED_ESP32_4MB_1MB_FS.csv
board_build.flash_mode = qio
upload_speed = 460800
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32s2.build_flags} 
  -D WLED_RELEASE_NAME=S2-SAOLA
  -D WLED_WATCHDOG_TIMEOUT=0
  -D LEDPIN=2
;  -D LEDPIN=4  
  -D DATA_PINS=2,4
  -D PIXEL_COUNTS=30,30
  -D BTNPIN=9
  -D RLYPIN=-1
  -D IRPIN=7
  -D AUDIOPIN=-1  # analog pin
  -D DMTYPE=1     # 0-analog/disabled, 1-I2S generic, 2-ES7243, 3-SPH0645, 4-I2S+mclk, 5-I2S PDM
  -D I2S_SDPIN=5
  -D I2S_WSPIN=3
  -D I2S_CKPIN=1
  -D STATUSLED=20 # RX/serial
#  ENABLE 
  -D USERMOD_AUDIOREACTIVE
  -D USERMOD_CUSTOMEFFECTS
  -D USERMOD_DALLASTEMPERATURE
  -D USERMOD_DALLASTEMPERATURE_CELSIUS
;  -D WLED_DEBUG  
# DISABLE  
  -D WLED_DISABLE_ALEXA  
  -D WLED_DISABLE_BLYNK 
  -D WLED_DISABLE_CRONIXIE  
  -D WLED_DISABLE_HUESYNC
  -D WLED_DISABLE_MQTT    
  -D WLED_DISABLE_LOXONE  
# RETAIN CONFIG  
  -UWLED_USE_MY_CONFIG
lib_deps = ${esp32s2.lib_deps}
  https://github.com/blazoncek/arduinoFFT.git  
# DALLAS TEMPERATURE
  milesburton/DallasTemperature@^3.9.0
  ;milesburton/DallasTemperature
  ;paulstoffregen/OneWire@^2.3.7
  https://github.com/PaulStoffregen/OneWire.git
  ;OneWire@~2.3.5
  ;robtillaart/DS18B20@^0.1.12

Next up is trying to get my C3 mini working…

3 Likes

Which kind of code you used to make functional the esp32 s2 with sound reactive? I’ve bought 10 of this board and I’ll happy to use with sound reactive. Thanks in advance!

S2 & C3 (both from Lolin and other manufacturers) are working with AC version of WLED and audioreactive usermod.

You may need to add build flag (or #define in my_config.h) -DLOLIN_WIFI_FIX for C3 v1.0.0 (S2 already includes this in build environment).

2 Likes