Closed Drizzt321 closed 2 years ago
There are some preconditions
GPIO3
not used for any other purpose (not as LED pin, not as button input, not for I2C, etc).If these are met, sending "v" over USB serial should give you the WLED version number as a response.
Can you please check?
@softhack007 Hm, I'm using the atuline official (pre-release) build, not sure what the build flags are.
As for GPIO, not sure, I'll have to check when I get home next week. However the main WLED trunk 0.13.1 (ESP-32) build from https://github.com/Aircoookie/WLED/releases/tag/v0.13.1 the serial works just fine. So maybe this branch has a different Serial pin configuration by default checked in or something?
@softhack007 So LED Output is set to GPIO2, Button 0 GPIO is set to GPIO0, the mic is I2C (don't see any setting to change the I2C pins), so doesn't look like GPIO3 is used for anything. Unless there's something in the code between the mic input I2C that tells it to use GPIO3?
As per the diagrams and documentation at https://www.tindie.com/products/stanleyprojects/ledbox-v2/, Serial TX is pin 35 (GPIO18) and Serial RX is pin 34 (GPIO5), and I2S for the mic are GPIO 14/15/32.
So after looking a little more, the layout for the Serial TX/RX pins are actually different physical pins on the real esp32-wroom-32 pinout, which are pins 41 & 42, GPIO 1 & 3 (UART0), so it's all correct pins. Still no idea why there's an issue with the Sound Reactive branch, vs vanilla WLED.
There is 1 TPM2 bugfix in the main codebase (https://github.com/Aircoookie/WLED/commit/d1f76042e1994ca25a0dc8e344571aa0aa6733fe), which is not in the SR branch, but I have a hard time seeing that as something that would prevent a response for the v
command at least, over serial. Maybe it could?
EDIT: Something interesting I've found, if on boot I spam v
into the serial terminal, I get a response for a second or two, and then I stop getting a response. Could it be that the SR code takes over the main loop and doesn't let the Serial get checked to see if there's been any input? That'd stop it from responding to serial input, if it never sees any.
Turns out that there was a little, innocent-looking line in the SR initialization code: https://github.com/atuline/WLED/blob/5a6b5c66aa73e480f545cba0d74023a6df098413/wled00/usermod.cpp#L59
Together with these lines that set a default for LED_BUILTIN https://github.com/atuline/WLED/blob/5a6b5c66aa73e480f545cba0d74023a6df098413/wled00/audio_reactive.h#L51-L53
Unfortunately Serial RX is on GPIO3 on most ESP32 boards. So RX was configured as output, making it impossible for WLED to read from serial.
What a nasty little bug. Thanks for helping me to track this down š .
Problem is solved in dev
branch.
@softhack007 thanks so much for sticking with me and putting up with my annoying "but it should work!" and so on, glad we got it figured out and tracked down! In the meantime I'll use the .bin you got me with the fix.
@Drizzt321 Thank you, too. Also for insisting that it's not like it should be š
What happened?
When I try to use the serial interface to get data/control WLED, I get output when it boots up (see below), but when I try and send commands (e.g.
v
orl
orL
) I get no reply at all. When I use mainline 0.13.1 from https://github.com/Aircoookie/WLED/releases works fine.To Reproduce Bug
Try and use serial interface, and send
v
which should return the version (e.g.WLED 2203150
), but with the 0.13.1 pre-release there's no response at all.Expected Behavior
Serial interface works as per https://kno.wled.ge/interfaces/serial/
Install Method
Binary from WLED.me
What version of WLED?
soundReactive_WLED_0.13.1_ESP32.bin
Which microcontroller/board are you seeing the problem on?
ESP32
Relevant log/trace output
No response
Anything else?
No response
Code of Conduct