sle118 / squeezelite-esp32

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

Location to enter the Readme's button mapping. #432

Closed Domigome closed 1 month ago

Domigome commented 1 month ago

To help us resolve your issue as quickly as possible, please follow these guidelines when submitting an issue. Providing all the necessary information will save both your time and ours.

Describe the bug

I was trying this wonderful project and run into this doubt, not very sure where to paste the button mapping provided in the Readme. I have flash the device with the web installer, set the Wi-Fi, choose the board type pre-set (ES8388 set 1) in the configuration, enter the GPIO in the NSV configuration, but so far I fail to find the button mapping.

Any lead? (this issue also asked about it, but not clear answer given https://github.com/sle118/squeezelite-esp32/issues/308)

Preliminary Information

  1. Firmware Version: latest from web installer.
  2. Plugin Version: latest from web installer.

Hardware Details

Please describe your hardware setup:

Issue Description

  1. Observed Behavior: Readme mentions to enter the button mapping but not clear UI option refers to this. '''[{"gpio":5,"normal":{"pressed":"ACTRLS_TOGGLE"}},{"gpio":18,"pull":true,"shifter_gpio":5,"normal":{"pressed":"ACTRLS_VOLUP"}, "shifted":{"pressed":"ACTRLS_NEXT"}}, {"gpio":23,"pull":true,"shifter_gpio":5,"normal":{"pressed":"ACTRLS_VOLDOWN"},"shifted":{"pressed":"ACTRLS_PREV"}}] '''
  2. Expected Behavior: To see some hardware or config > Button Mapping section.
Domigome commented 1 month ago

Found out the solution, there is not a field for that (which I highly recommend to have one by default), you need to create it and then point to it:

  1. Connect to your squeezelite-esp32 web interface.
  2. Go to NVS Editor tab (if it is not shown, go to 'Credit' tab and enable it in Extras/Overrides section)
  3. Scroll all the way down until you see the field to create a new key.
  4. Enter button_mapping(or your preferred key name) as name in 'new key' field.
  5. Enter the button mapping configuration, for my case ESP32 audio kit v2.2 A417 ES8388 variant 1 I recommend this one: [{"gpio":5,"normal":{"pressed":"ACTRLS_TOGGLE"}},{"gpio":18,"pull":true,"normal":{"pressed":"ACTRLS_VOLUP"}},{"gpio":23,"pull":true,"normal":{"pressed":"ACTRLS_VOLDOWN"}},{"gpio":19,"pull":true,"normal":{"pressed":"ACTRLS_NEXT"}},{"gpio":13,"pull":true,"normal":{"pressed":"ACTRLS_PREV"}},{"gpio":36,"pull":true,"normal":{"pressed":"ACTRLS_NONE"}}]
  6. scroll up and find a key named "actrls_config", in its value field enter button_mapping (or your key name if you did choose another one.)
  7. Scroll to the end of the page and click 'Commit', then click 'Reboot'.

Done!

This will use the ESP32 Audio Kit v2.2 keys like follows:

I think it would be nice to write this on the Readme plus having some default settings or key-values on place.