Aircoookie / WLED

Control WS2812B and many more types of digital RGB LEDs with an ESP8266 or ESP32 over WiFi!
https://kno.wled.ge
MIT License
14.49k stars 3.1k forks source link

Audioreactive does not work on IO34 #3793

Closed ZOUDIO closed 5 months ago

ZOUDIO commented 5 months ago

What happened?

ADC reports no activity on IO34 when using the Audioreactive usermod. Empty sketch which prints the analogRead result says the analog signal is just fine. WLED reads the signal just fine if I move the signal to IO33.

To Reproduce Bug

Run audioreactive with the analog input on IO34 and viewing the info page of WLED will report 'ADC quiet'. Moving the same signal to IO33 makes it work.

Expected Behavior

IO34 is an ADC pin and should work

Install Method

Self-Compiled

What version of WLED?

v0.14.1

Which microcontroller/board are you seeing the problem on?

ESP32

Relevant log/trace output

No response

Anything else?

IO34 is an ADC pin and should work. Might have something to do with it being an input-only pin?

Code of Conduct

softhack007 commented 5 months ago

Hi,

I assume you want to use analog microphone, correct? which microphone exactly? Actually the audioreactive source code handles all ADC1 pins the same way - so its still a mistery to me why one specific pin works while another does not work. It could be that your board has a special purpose assigned to gpio34 - like battery voltage or differential ADC.

There is some help on connecting analog inputs here: https://github.com/atuline/WLED/wiki/Analog-Audio-Input-Options

ZOUDIO commented 5 months ago

I did some more experimentation and I also got it to work on IO34. It's quite difficult to replicate but I am quite sure something goes wrong when changing the pins using the GUI. Sometimes the audioreactive enable checkbox is not enabled on the settings page, and when I change the pin number it does not work anymore, even after reboot or power cycle. Directly after uploading new firmware it always works, regardless of the pin. I am afraid I do not have more time to look into this issue, maybe you are able to replicate it, but otherwise this can be closed as the issue for my usecase is already solved.