Closed sle118 closed 4 years ago
@daduke , speaking with Philippe, I think it will be better if we had a general config page with a section for each important section of configuration. Basically, a tab that takes various key nvs parameters and expose them in a simple way. Some of the key elements to include
The GUI should do some basic checking (e.g. display needs the i2c config if I2C interface specified for display, SPI if SPI interface specified, etc). Then it should send only a subset of nvs values in a similar way to the nvs editor. There should be 2 buttons:
These 2 buttons should also ideally be there in the audio/squeezelite config tab.
Another nvs to add: set_GPIO
it's a mix bag that should probably blend in the respective "functional sections" of the config.
here's from the current readme
The parameter "set_GPIO" is use to assign GPIO to various functions.
GPIO can be set to GND provide or Vcc at boot. This is convenient to power devices that consume less than 40mA from the side connector. Be careful because there is no conflict checks being made wrt which GPIO you're changing, so you might damage your board or create a conflict here.
The \<amp> parameter can use used to assign a GPIO that will be set to 1 when playback starts. It will be reset to 0 when squeezelite becomes idle. The idle timeout is set on the squeezelite command line through -C \<timeout>
If you have an audio jack that supports insertion (use :0 or :1 to set the level when inserted), you can specify which GPIO it's connected to. Using the parameter jack_mutes_amp allows to mute the amp when headset (e.g.) is inserted.
You can set the Green and Red status led as well with their respective active state (:0 or :1)
The \<ir> parameter set the GPIO associated to an IR receiver. No need to add pullup or capacitor
Syntax is:
<gpio>=Vcc|GND|amp|ir|jack[:0|1]|green[:0|1]|red[:0|1]|spkfault[:0|1][,<repeated sequence for next GPIO>]
You can define the defaults for jack, spkfault leds at compile time but nvs parameter takes precedence except for SqueezeAMP where these are forced at runtime.
I have started the implementation, leveraging the framework I had already implemented; the framework allows existing command lines to expose a UI transparently.
At this point, I am starting to learn towards defaulting all the SPI, I2C and I2S GPIO'S instead of providing an empty slate, which can be daunting for some users. The flexibility will remain, but things like display configuration would be simplified a lot of the only parameters to figure out are SPI vs I2C and driver name.
The UI could then be used to show how to plug these external devices (external DAC, screen, buttons, rotary...).
Comments are welcomed.
Some progress to report here
I'm going to go ahead and close this. Recent changes were made to address this and the UI, although far from ideal, it's now exposing more configuration options in a better way than the NVS
I think it's time to align the GPIO config page to make it match with how the system has evolved. I'll build a backend endpoint to retrieve/update them in a central place. @daduke could then update the front-end if he has bandwidth.