sle118 / squeezelite-esp32

ESP32 Music streaming based on Squeezelite, with support for multi-room sync, AirPlay, Bluetooth, Hardware buttons, display and more
1.27k stars 115 forks source link

[Question] Led strip behavior #449

Open nschurando opened 1 month ago

nschurando commented 1 month ago

Hi,

It appears unclear to me what the expected behavior of the led strip should be. I tied a WS2812B strip to GPIO27 which shows up as yellow when in recovery mode, suggesting the wiring is correct. Looking at the documentation I expected to the led strip to indicate the battery status when no music is playing, and eventually act as a vu meter when music is playing. But, appart when in recovery mode, the led strip stays off. Is this normal behavior?

I should add that I believe I have correctly configured the battery measurement, as looking into the /status.json page, the Voltage value matches the one of my one-cell battery.

I am running the I2S-4MFlash-1681 version flashed with the online installer. I am using a custom board, with LMS disabled (as I am relying on Bluetooth and Spotify instead). My nvs config is as follows:

{
  "a2dp_ctmt": "1000",
  "a2dp_ctrld": "500",
  "a2dp_dev_name": "Radio",
  "a2dp_sink_name": "SMSL BT4.2",
  "a2dp_spin": "0000",
  "actrls_config": "",
  "airplay_name": "Radio",
  "airplay_port": "5000",
  "ap_channel": "1",
  "ap_ip_address": "192.168.4.1",
  "ap_ip_gateway": "192.168.4.1",
  "ap_ip_netmask": "255.255.255.0",
  "ap_pwd": "squeezelite",
  "ap_ssid": "Radio",
  "autoexec": "1",
  "autoexec1": "squeezelite -o I2S -b 500:2000 -d all=info -C 30 -W -n \"Radio\" -s -disable",
  "bat_config": "channel=5,scale=4.4,cells=1,atten=0",
  "bt_name": "Radio",
  "bt_sink_pin": "1234",
  "bt_sink_volume": "127",
  "bypass_wm": "0",
  "cspot_config": "{\"deviceName\":\"Radio\",\"bitrate\":160,\"zeroConf\":0,\"volume\":52850}",
  "dac_config": "model=I2S,bck=5,ws=25,do=26,mute=19:0",
  "dac_controlset": "",
  "dhcp_tmout": "8",
  "display_config": "",
  "enable_airplay": "1",
  "enable_bt_sink": "1",
  "enable_cspot": "1",
  "equalizer": "",
  "eth_config": "",
  "ethtmout": "8",
  "gpio_exp_config": "",
  "host_name": "Radio",
  "i2c_config": "",
  "jack_mutes_amp": "n",
  "led_brightness": "",
  "led_vu_config": "type=WS2812,length=8,gpio=27,scale=100",
  "lms_ctrls_raw": "n",
  "loudness": "0",
  "metadata_config": "",
  "model_config": "",
  "ota_erase_blk": "249856",
  "ota_prio": "6",
  "ota_stack": "10240",
  "pollmin": "15",
  "pollmx": "600",
  "rel_api": "https://api.github.com/repos/sle118/squeezelite-esp32/releases",
  "release_url": "https://github.com/sle118/squeezelite-esp32/releases",
  "rotary_config": "",
  "set_GPIO": "",
  "sleep_config": "",
  "spdif_config": "",
  "spi_config": "",
  "stats": "n",
  "target": "",
  "telnet_block": "500",
  "telnet_buffer": "40000",
  "telnet_enable": ""
}

Thank you in advance,

Regards,

Nicolas

wizmo2 commented 1 month ago

You will need to select a led_vu display mode with LMS (or extras menu). This requires the latest SqueezeESP addon. Battery status currently only works in VU Meter Modes.

Operation outside of LMS may not work

nschurando commented 1 month ago

Thanks for getting back to me. If I understand correctly, the led_vu requires LMS. Would it be acceptable if I proposed a PR that offers basic support of a led strip to display battery level even with LMS disabled?

wizmo2 commented 1 month ago

Have a look at the set_GPIO LED output. I have not used it, but I think it was developed for the MUSE to display battery status with a single LED.

nschurando commented 1 month ago

Thank you, I'll take a look.