Compare commits

...

17 Commits

Author SHA1 Message Date
philippe44
d31697e7ef force pad_select for gpio use in dac_controlset - release 2023-11-09 13:47:08 -08:00
philippe44
e830b4db73 Merge branch 'master-v4.3' of https://github.com/sle118/squeezelite-esp32 into master-v4.3 2023-11-09 13:42:11 -08:00
philippe44
8fe21327b8 Update README.md 2023-11-08 16:54:54 -08:00
philippe44
3f487366ee Update README.md 2023-11-08 16:51:47 -08:00
philippe44
b875585aec Merge branch 'master-v4.3' of https://github.com/sle118/squeezelite-esp32 into master-v4.3 2023-11-08 16:37:53 -08:00
philippe44
b46fccfc83 execute dac_controlset even w/o i2c (for gpio) - release 2023-11-08 16:37:49 -08:00
philippe44
655c17fb29 Update README.md 2023-11-08 11:36:29 -08:00
philippe44
b8bda0435a Update README.md 2023-11-08 11:34:17 -08:00
github-actions
dc5cb31efb Update prebuilt objects [skip actions] 2023-11-08 06:18:54 +00:00
philippe44
44ccbb49a6 ledvu update 2023-11-07 22:15:54 -08:00
philippe44
6589387cd3 Merge pull request #351 from wizmo2/ledvu-update-clean
Ledvu update (clean)
2023-11-07 22:08:42 -08:00
github-actions
0d3f6a8870 Update prebuilt objects [skip actions] 2023-11-06 01:24:27 +00:00
Wizmo2
dad8efff8b Merge branch 'ledvu-update-clean' of https://github.com/wizmo2/squeezelite-esp32 into ledvu-update-clean 2023-11-05 14:30:23 -05:00
Wizmo2
e8c6169e09 formating changes 2023-11-05 14:27:45 -05:00
Wizmo2
fc8d15f58d formating changes 2023-11-04 23:07:25 -04:00
Wizmo2
f9d7e15d4b add suspend service 2023-11-04 22:56:37 -04:00
Wizmo2
667b90fafc ledvu-update-clean 2023-10-30 19:24:23 -04:00
33 changed files with 184 additions and 67 deletions

View File

@@ -1,3 +1,16 @@
2023-11-09
- force gpio_pad_select_gpio in dac_controlset in case somebody uses UART gpio's (or other pre-programmed)
2023-11-08
- execute dac_controlset even whne there is no i2s (for gpio)
2023-11-07
- led-vu gain + misc fixes
- bump plugin version to 0.600
2023-11-03
- don't reboot when external decoder is connected even with a LMS server
2023-10-28 2023-10-28
- fix recovery size (remove bootstrap) - fix recovery size (remove bootstrap)
- improve NVS initialization structure - improve NVS initialization structure

View File

@@ -189,13 +189,19 @@ if "model" is not set or is not recognized, then default "I2S" is used. The opti
So far, TAS57xx, TAS5713, AC101, WM8978 and ES8388 are recognized models where the proper init sequence/volume/power controls are sent. For other codecs that might require an I2C commands, please use the parameter "dac_controlset" that allows definition of simple commands to be sent over i2c for init, power, speaker and headset on and off using a JSON syntax: So far, TAS57xx, TAS5713, AC101, WM8978 and ES8388 are recognized models where the proper init sequence/volume/power controls are sent. For other codecs that might require an I2C commands, please use the parameter "dac_controlset" that allows definition of simple commands to be sent over i2c for init, power, speaker and headset on and off using a JSON syntax:
```json ```json
{ <command>: [ {"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"}, ... {{"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"} ], { <command>: [ <item1>, <item2>, ... <item3> ],
<command>: [ {"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"}, ... {{"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"} ], <command>: [ <item1>, <item2>, ... <item3> ],
... } ... }
``` ```
Where `<command>` is one of init, poweron, poweroff, speakeron, speakeroff, headseton, headsetoff Where `<command>` is one of init, poweron, poweroff, speakeron, speakeroff, headseton, headsetoff (it **must** be an array even for a single item). Item is any of the following elements
```
{"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"}
{"gpio":<gpio>,"level":0|1}
{"delay":<ms>}
```
This is standard JSON notation, so if you are not familiar with it, Google is your best friend. Be aware that the '...' means you can have as many entries as you want, it's not part of the syntax. Every section is optional, but it does not make sense to set i2c in the 'dac_config' parameter and not setting anything here.
This is standard JSON notation, so if you are not familiar with it, Google is your best friend. Be aware that the '...' means you can have as many entries as you want, it's not part of the syntax. Every section is optional, but it does not make sense to set i2c in the 'dac_config' parameter and not setting anything here. The parameter 'mode' allows to *or* the register with the value or to *and* it. Don't set 'mode' if you simply want to write. The 'val parameter can be an array [v1, v2,...] to write a serie of bytes in a single i2c burst (in that case 'mode' is ignored). **Note that all values must be decimal**. You can use a validator like [this](https://jsonlint.com) to verify your syntax The `reg` key allow to write registers on i2c bus. The parameter `mode` allows to *or* the register with the value or to *and* it. Don't set `mode` if you simply want to write. The `val` parameter can be an array [v1, v2,...] to write a serie of bytes in a single i2c burst (in that case 'mode' is ignored). **Note that all values must be decimal**. You can use a validator like [this](https://jsonlint.com) to verify your syntax. The `gpio` key is simply to set a gpio as part of DAC action and `delay` allows a pause between elements.
The 'power' command is used when powering on/off the DAC after the idle period (see -C option of squeezelite) and the 'speaker/headset' commands are sent when switching between speakers and headsets (see headset jack detection). The 'power' command is used when powering on/off the DAC after the idle period (see -C option of squeezelite) and the 'speaker/headset' commands are sent when switching between speakers and headsets (see headset jack detection).
@@ -321,18 +327,18 @@ See [set_GPIO](#set-gpio) for how to set the green and red LEDs (including addre
NB: For named configuration, GPIO affected to green and red LED cannot be changed but brightness option applies NB: For named configuration, GPIO affected to green and red LED cannot be changed but brightness option applies
### LED Strip ### LED Strip
One LED strip with up to 255 addressable LEDs can be configured to offer enhanced visualizations. The LED strip can also be controlled remotely though the LMS server (using the CLI interface). Currently only WS2812B LEDs are supported. Set the LED Strip configuration (or NVS led_vu_config) to `WS2812,length=<n>,gpio=<gpio>, where <n> is the number of leds in the strip (1..255), and <gpio> is the data pin.` One LED strip with up to 255 addressable LEDs can be configured to offer enhanced visualizations. The VU Meter visualizer includes a battery status indicator (see Battery). Currently only WS2812B LEDs are supported. Set the LED Strip hardware configuration, or the NVS led_vu_config syntax is
The latest LMS plugin update is required to set the visualizer mode and brightness, in the ESP32 settings page for the player. The plugin also adds the following CLI command options
``` ```
<playerid> led_visual [<mode>] [brightness(1-255)] type=[WS2812],length=<n>,gpio=<dataPin>[,scale=<gain>]
Toggles or selects the visulaizer mode.
The visualizer brighness can be controled using the optional <brighness> tag.
<playerid> dmx <R,G,B|R,G,B,R,G,B ... R,G,B> [<offset>]
Sets the LED at position "offset" to any RGB color where "R"(red),"G"(green), and "B"(blue) are values from 0(off) to 255(max brightness).
Add additional RGB values to the delimited string to set multiple LEDs.
``` ```
where `<n>` is the number of LEDs in the strip (1..255). A `<scale>` gain value (percentage) can be added to enhance effect responses.
The latest LMS plugin update is required to set the visualizer mode and brightness in the ESP32 Settings page for the player, or a controllable display (see Extra/SqueezeESP32 menus). The plugin adds additional LMS CLI commands.
| Command | Notes |
| -------------------------------------------------- | ----------- |
| \<playerid\> led_visual \[\<mode\>\] \[\<brightness\>\] | Toggles or selects the visualizer "mode".<br />The visualizer brightness(0..255) can be controlled using the "brightness" tag. |
| \<playerid\> dmx \<R,G,B,R,G,B, ... R,G,B\> \[\<offset\>\] | Sets the LED color starting at position "offset"<br /> with "R"(red),"G"(green),and "B"(blue) color sequences.<br />Add additional RGB values to the delimited string to set multiple LEDs.<br /> |
### Rotary Encoder ### Rotary Encoder
One rotary encoder is supported, quadrature shift with press. Such encoders usually have 2 pins for encoders (A and B), and common C that must be set to ground and an optional SW pin for press. A, B and SW must be pulled up, so automatic pull-up is provided by ESP32, but you can add your own resistors. A bit of filtering on A and B (~470nF) helps for debouncing which is not made by software. One rotary encoder is supported, quadrature shift with press. Such encoders usually have 2 pins for encoders (A and B), and common C that must be set to ground and an optional SW pin for press. A, B and SW must be pulled up, so automatic pull-up is provided by ESP32, but you can add your own resistors. A bit of filtering on A and B (~470nF) helps for debouncing which is not made by software.

View File

@@ -293,11 +293,8 @@ bool led_strip_init(struct led_strip_t *led_strip)
static EXT_RAM_ATTR StackType_t xStack[LED_STRIP_TASK_SIZE] __attribute__ ((aligned (4))); static EXT_RAM_ATTR StackType_t xStack[LED_STRIP_TASK_SIZE] __attribute__ ((aligned (4)));
if ((led_strip == NULL) || if ((led_strip == NULL) ||
(led_strip->rmt_channel >= RMT_CHANNEL_MAX) ||
(led_strip->gpio > GPIO_NUM_33) ||
(led_strip->led_strip_working == NULL) || (led_strip->led_strip_working == NULL) ||
(led_strip->led_strip_showing == NULL) || (led_strip->led_strip_showing == NULL) ||
(led_strip->led_strip_length == 0) ||
(led_strip->access_semaphore == NULL)) { (led_strip->access_semaphore == NULL)) {
return false; return false;
} }

View File

@@ -24,6 +24,7 @@
#include "monitor.h" #include "monitor.h"
#include "led_strip.h" #include "led_strip.h"
#include "platform_config.h" #include "platform_config.h"
#include "services.h"
#include "led_vu.h" #include "led_vu.h"
static const char *TAG = "led_vu"; static const char *TAG = "led_vu";
@@ -55,6 +56,7 @@ static EXT_RAM_ATTR struct {
int vu_start_l; int vu_start_l;
int vu_start_r; int vu_start_r;
int vu_status; int vu_status;
int vu_scale;
} strip; } strip;
static int led_addr(int pos ) { static int led_addr(int pos ) {
@@ -70,31 +72,31 @@ static void battery_svc(float value, int cells) {
if (battery_handler_chain) battery_handler_chain(value, cells); if (battery_handler_chain) battery_handler_chain(value, cells);
} }
/****************************************************************************************
* Suspend.
*
*/
static void led_vu_sleep(void) {
led_vu_clear(led_display);
}
/**************************************************************************************** /****************************************************************************************
* Initialize the led vu strip if configured. * Initialize the led vu strip if configured.
* *
*/ */
void led_vu_init() void led_vu_init()
{ {
char* p;
char* config = config_alloc_get_str("led_vu_config", NULL, "N/A"); char* config = config_alloc_get_str("led_vu_config", NULL, "N/A");
// Initialize led VU strip PARSE_PARAM(config, "length",'=', strip.length);
char* drivername = strcasestr(config, "WS2812"); PARSE_PARAM(config, "gpio",'=', strip.gpio);
if ((p = strcasestr(config, "length")) != NULL) {
strip.length = atoi(strchr(p, '=') + 1);
} // else 0
if ((p = strcasestr(config, "gpio")) != NULL) {
strip.gpio = atoi(strchr(p, '=') + 1);
} else {
strip.gpio = LED_VU_DEFAULT_GPIO;
}
// check for valid configuration // check for valid configuration
if (!drivername || !strip.gpio) { if (!strip.gpio) {
ESP_LOGI(TAG, "led_vu configuration invalid"); ESP_LOGI(TAG, "led_vu configuration invalid");
goto done; goto done;
} }
strip.vu_scale = 100;
PARSE_PARAM(config, "scale",'=',strip.vu_scale);
battery_handler_chain = battery_handler_svc; battery_handler_chain = battery_handler_svc;
battery_handler_svc = battery_svc; battery_handler_svc = battery_svc;
@@ -114,7 +116,7 @@ void led_vu_init()
strip.vu_start_r = strip.vu_length + 1; strip.vu_start_r = strip.vu_length + 1;
strip.vu_status = strip.vu_length; strip.vu_status = strip.vu_length;
} }
ESP_LOGI(TAG, "vu meter using length:%d left:%d right:%d status:%d", strip.vu_length, strip.vu_start_l, strip.vu_start_r, strip.vu_status); ESP_LOGI(TAG, "vu meter using length:%d left:%d right:%d status:%d scale:%d", strip.vu_length, strip.vu_start_l, strip.vu_start_r, strip.vu_status, strip.vu_scale);
// create driver configuration // create driver configuration
led_strip_config.rgb_led_type = RGB_LED_TYPE_WS2812; led_strip_config.rgb_led_type = RGB_LED_TYPE_WS2812;
@@ -138,6 +140,8 @@ void led_vu_init()
// reserver max memory for remote management systems // reserver max memory for remote management systems
rmt_set_mem_block_num(led_strip_config.rmt_channel, 7); rmt_set_mem_block_num(led_strip_config.rmt_channel, 7);
services_sleep_setsuspend(led_vu_sleep);
led_vu_clear(led_display); led_vu_clear(led_display);
done: done:
@@ -157,6 +161,14 @@ uint16_t led_vu_string_length() {
return (uint16_t)strip.length; return (uint16_t)strip.length;
} }
/****************************************************************************************
* Returns a user defined scale (percent)
*/
uint16_t led_vu_scale() {
if (!led_display) return 0;
return (uint16_t)strip.vu_scale;
}
/**************************************************************************************** /****************************************************************************************
* Turns all LEDs off (Black) * Turns all LEDs off (Black)
*/ */

View File

@@ -21,6 +21,7 @@
extern struct led_strip_t* led_display; extern struct led_strip_t* led_display;
uint16_t led_vu_string_length(); uint16_t led_vu_string_length();
uint16_t led_vu_scale();
void led_vu_progress_bar(int pct, int bright); void led_vu_progress_bar(int pct, int bright);
void led_vu_display(int vu_l, int vu_r, int bright, bool comet); void led_vu_display(int vu_l, int vu_r, int bright, bool comet);
void led_vu_spin_dial(int gain, int rate, int speed, bool comet); void led_vu_spin_dial(int gain, int rate, int speed, bool comet);

View File

@@ -115,6 +115,7 @@ static struct {
struct arg_str *type; struct arg_str *type;
struct arg_int *length; struct arg_int *length;
struct arg_int *gpio; struct arg_int *gpio;
struct arg_int * scale;
struct arg_lit *clear; struct arg_lit *clear;
struct arg_end *end; struct arg_end *end;
} ledvu_args; } ledvu_args;
@@ -657,7 +658,7 @@ static int do_cspot_config(int argc, char **argv) {
#endif #endif
static int do_ledvu_cmd(int argc, char **argv) { static int do_ledvu_cmd(int argc, char **argv) {
ledvu_struct_t ledvu = {.type = "WS2812", .gpio = -1, .length = 0}; ledvu_struct_t ledvu = {.type = "WS2812", .gpio = -1, .length = 0, .scale = 100};
esp_err_t err = ESP_OK; esp_err_t err = ESP_OK;
int nerrors = arg_parse(argc, argv, (void **)&ledvu_args); int nerrors = arg_parse(argc, argv, (void **)&ledvu_args);
if (ledvu_args.clear->count) { if (ledvu_args.clear->count) {
@@ -685,6 +686,8 @@ static int do_ledvu_cmd(int argc, char **argv) {
} else { } else {
ledvu.length = ledvu_args.length->count > 0 ? ledvu_args.length->ival[0] : 0; ledvu.length = ledvu_args.length->count > 0 ? ledvu_args.length->ival[0] : 0;
} }
ledvu.scale = ledvu_args.scale->count>0?ledvu_args.scale->ival[0]:ledvu.scale;
if (!nerrors) { if (!nerrors) {
fprintf(f, "Storing ledvu parameters.\n"); fprintf(f, "Storing ledvu parameters.\n");
@@ -914,6 +917,7 @@ cJSON *ledvu_cb() {
} else { } else {
cJSON_AddStringToObject(values, "type", "WS2812"); cJSON_AddStringToObject(values, "type", "WS2812");
} }
cJSON_AddNumberToObject(values,"scale",ledvu->scale);
return values; return values;
} }
@@ -1314,6 +1318,7 @@ void register_ledvu_config(void) {
ledvu_args.type = arg_str1(NULL, "type", "<none>|WS2812", "Led type (supports one rgb strip to display built in effects and allow remote control through 'dmx' messaging)"); ledvu_args.type = arg_str1(NULL, "type", "<none>|WS2812", "Led type (supports one rgb strip to display built in effects and allow remote control through 'dmx' messaging)");
ledvu_args.length = arg_int1(NULL, "length", "<1..255>", "Strip length (1-255 supported)"); ledvu_args.length = arg_int1(NULL, "length", "<1..255>", "Strip length (1-255 supported)");
ledvu_args.gpio = arg_int1(NULL, "gpio", "gpio", "Data pin"); ledvu_args.gpio = arg_int1(NULL, "gpio", "gpio", "Data pin");
ledvu_args.scale = arg_int0(NULL,"scale","<n>","Gain scale (precent)");
ledvu_args.clear = arg_lit0(NULL, "clear", "Clear configuration"); ledvu_args.clear = arg_lit0(NULL, "clear", "Clear configuration");
ledvu_args.end = arg_end(4); ledvu_args.end = arg_end(4);

View File

@@ -329,7 +329,7 @@ esp_err_t config_ledvu_set(ledvu_struct_t * config){
esp_err_t err=ESP_OK; esp_err_t err=ESP_OK;
char * config_buffer=malloc_init_external(buffer_size); char * config_buffer=malloc_init_external(buffer_size);
if(config_buffer) { if(config_buffer) {
snprintf(config_buffer,buffer_size,"%s,length=%i,gpio=%i",config->type, config->length, config->gpio); snprintf(config_buffer,buffer_size,"%s,length=%i,gpio=%i,scale=%i",config->type, config->length, config->gpio, config->scale);
log_send_messaging(MESSAGING_INFO,"Updating ledvu configuration to %s",config_buffer); log_send_messaging(MESSAGING_INFO,"Updating ledvu configuration to %s",config_buffer);
err = config_set_value(NVS_TYPE_STR, "led_vu_config", config_buffer); err = config_set_value(NVS_TYPE_STR, "led_vu_config", config_buffer);
if(err!=ESP_OK){ if(err!=ESP_OK){
@@ -761,14 +761,13 @@ const rotary_struct_t * config_rotary_get() {
*/ */
const ledvu_struct_t * config_ledvu_get() { const ledvu_struct_t * config_ledvu_get() {
static ledvu_struct_t ledvu={ .type = "WS2812", .gpio = -1, .length = 0}; static ledvu_struct_t ledvu={ .type = "WS2812", .gpio = -1, .length = 0, .scale= 100 };
char *config = config_alloc_get_default(NVS_TYPE_STR, "led_vu_config", NULL, 0); char *config = config_alloc_get_default(NVS_TYPE_STR, "led_vu_config", NULL, 0);
if (config && *config) { if (config && *config) {
char *p; PARSE_PARAM_STR(config, "type", '=', ledvu.type, 15);
PARSE_PARAM(config, "gpio", '=', ledvu.gpio);
// ToDo: Add code for future support of alternate led types PARSE_PARAM(config, "length", '=', ledvu.length);
if ((p = strcasestr(config, "gpio")) != NULL) ledvu.gpio = atoi(strchr(p, '=') + 1); PARSE_PARAM(config, "scale", '=', ledvu.scale);
if ((p = strcasestr(config, "length")) != NULL) ledvu.length = atoi(strchr(p, '=') + 1);
free(config); free(config);
} }
return &ledvu; return &ledvu;

View File

@@ -89,6 +89,7 @@ typedef struct {
char type[16]; char type[16];
int length; int length;
int gpio; int gpio;
int scale;
} ledvu_struct_t; } ledvu_struct_t;
typedef struct { typedef struct {

View File

@@ -216,7 +216,7 @@ static EXT_RAM_ATTR struct {
static EXT_RAM_ATTR struct { static EXT_RAM_ATTR struct {
int mode; int mode;
int n, style, max; int n, style, max, gain;
u16_t config; u16_t config;
struct bar_s bars[MAX_BARS] ; struct bar_s bars[MAX_BARS] ;
} led_visu; } led_visu;
@@ -1089,10 +1089,10 @@ static void displayer_update(void) {
if (led_display && led_visu.mode) { if (led_display && led_visu.mode) {
// run built in visualizer effects // run built in visualizer effects
if (led_visu.mode == VISU_VUMETER) { if (led_visu.mode == VISU_VUMETER) {
vu_scale(led_visu.bars, led_visu.max, meters.levels); vu_scale(led_visu.bars, led_visu.gain, meters.levels);
led_vu_display(led_visu.bars[0].current, led_visu.bars[1].current, led_visu.max, led_visu.style); led_vu_display(led_visu.bars[0].current, led_visu.bars[1].current, led_visu.max, led_visu.style);
} else if (led_visu.mode == VISU_SPECTRUM) { } else if (led_visu.mode == VISU_SPECTRUM) {
spectrum_scale(led_visu.n, led_visu.bars, led_visu.max, meters.samples); spectrum_scale(led_visu.n, led_visu.bars, led_visu.gain, meters.samples);
uint8_t* p = (uint8_t*) led_data; uint8_t* p = (uint8_t*) led_data;
for (int i = 0; i < led_visu.n; i++) { for (int i = 0; i < led_visu.n; i++) {
*p = led_visu.bars[i].current; *p = led_visu.bars[i].current;
@@ -1100,7 +1100,7 @@ static void displayer_update(void) {
} }
led_vu_spectrum(led_data, led_visu.max, led_visu.n, led_visu.style); led_vu_spectrum(led_data, led_visu.max, led_visu.n, led_visu.style);
} else if (led_visu.mode == VISU_WAVEFORM) { } else if (led_visu.mode == VISU_WAVEFORM) {
spectrum_scale(led_visu.n, led_visu.bars, led_visu.max, meters.samples); spectrum_scale(led_visu.n, led_visu.bars, led_visu.gain, meters.samples);
led_vu_spin_dial( led_vu_spin_dial(
led_visu.bars[led_visu.n-2].current, led_visu.bars[led_visu.n-2].current,
led_visu.bars[(led_visu.n/2)+1].current * 50 / led_visu.max, led_visu.bars[(led_visu.n/2)+1].current * 50 / led_visu.max,
@@ -1277,8 +1277,8 @@ static void ledv_handler( u8_t *data, int len) {
led_visu.mode = pkt->which; led_visu.mode = pkt->which;
led_visu.style = pkt->style; led_visu.style = pkt->style;
led_visu.max = pkt->bright; led_visu.max = pkt->bright;
led_visu.gain = led_visu.max * led_vu_scale() / 100;
led_vu_clear();
if (led_visu.mode) { if (led_visu.mode) {
if (led_visu.mode == VISU_SPECTRUM) { if (led_visu.mode == VISU_SPECTRUM) {
led_visu.n = (led_visu.config < MAX_BARS) ? led_visu.config : MAX_BARS; led_visu.n = (led_visu.config < MAX_BARS) ? led_visu.config : MAX_BARS;
@@ -1293,8 +1293,10 @@ static void ledv_handler( u8_t *data, int len) {
// reset bars maximum // reset bars maximum
for (int i = led_visu.n; --i >= 0;) led_visu.bars[i].max = 0; for (int i = led_visu.n; --i >= 0;) led_visu.bars[i].max = 0;
LOG_INFO("LED Visualizer mode %u with bars:%u max:%u style:%d", led_visu.mode, led_visu.n, led_visu.max, led_visu.style); LOG_INFO("LED Visualizer mode %u with bars:%u max:%u style:%d gain:%u", led_visu.mode, led_visu.n, led_visu.max, led_visu.style, led_visu.gain);
} else { } else {
led_vu_clear();
LOG_INFO("Stopping led visualizer"); LOG_INFO("Stopping led visualizer");
} }

View File

@@ -61,7 +61,6 @@ static bool init(char *config, int i2c_port_num, i2s_config_t *i2s_config, bool
char *p; char *p;
i2c_addr = adac_init(config, i2c_port_num); i2c_addr = adac_init(config, i2c_port_num);
if (!i2c_addr) return true;
ESP_LOGI(TAG, "DAC on I2C @%d", i2c_addr); ESP_LOGI(TAG, "DAC on I2C @%d", i2c_addr);
@@ -137,6 +136,7 @@ bool i2c_json_execute(char *set) {
if ((action = cJSON_GetObjectItemCaseSensitive(item, "gpio")) != NULL) { if ((action = cJSON_GetObjectItemCaseSensitive(item, "gpio")) != NULL) {
cJSON *level = cJSON_GetObjectItemCaseSensitive(item, "level"); cJSON *level = cJSON_GetObjectItemCaseSensitive(item, "level");
ESP_LOGI(TAG, "set GPIO %d at %d", action->valueint, level->valueint); ESP_LOGI(TAG, "set GPIO %d at %d", action->valueint, level->valueint);
if (action->valueint < GPIO_NUM_MAX) gpio_pad_select_gpio(action->valueint);
gpio_set_direction_x(action->valueint, GPIO_MODE_OUTPUT); gpio_set_direction_x(action->valueint, GPIO_MODE_OUTPUT);
gpio_set_level_x(action->valueint, level->valueint); gpio_set_level_x(action->valueint, level->valueint);
continue; continue;

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@@ -69,6 +69,10 @@ declare function getStatus(): {};
declare function getStatus(): {}; declare function getStatus(): {};
declare function getStatus(): {}; declare function getStatus(): {};
declare function getStatus(): {}; declare function getStatus(): {};
declare function getStatus(): {};
declare function getStatus(): {};
declare function getRadioButton(entry: any): string;
declare function getRadioButton(entry: any): string;
declare function getRadioButton(entry: any): string; declare function getRadioButton(entry: any): string;
declare function getRadioButton(entry: any): string; declare function getRadioButton(entry: any): string;
declare function getRadioButton(entry: any): string; declare function getRadioButton(entry: any): string;
@@ -211,6 +215,8 @@ declare function pushStatus(): void;
declare function pushStatus(): void; declare function pushStatus(): void;
declare function pushStatus(): void; declare function pushStatus(): void;
declare function pushStatus(): void; declare function pushStatus(): void;
declare function pushStatus(): void;
declare function pushStatus(): void;
declare let sd: {}; declare let sd: {};
declare let rf: boolean; declare let rf: boolean;
declare function refreshStatus(): void; declare function refreshStatus(): void;

View File

@@ -1,5 +1,5 @@
target_add_binary_data( __idf_wifi-manager webapp/dist/css/index.4bbe29a78a667faa2b6f.css.gz BINARY) target_add_binary_data( __idf_wifi-manager webapp/dist/css/index.4bbe29a78a667faa2b6f.css.gz BINARY)
target_add_binary_data( __idf_wifi-manager webapp/dist/favicon-32x32.png BINARY) target_add_binary_data( __idf_wifi-manager webapp/dist/favicon-32x32.png BINARY)
target_add_binary_data( __idf_wifi-manager webapp/dist/index.html.gz BINARY) target_add_binary_data( __idf_wifi-manager webapp/dist/index.html.gz BINARY)
target_add_binary_data( __idf_wifi-manager webapp/dist/js/index.cead70.bundle.js.gz BINARY) target_add_binary_data( __idf_wifi-manager webapp/dist/js/index.0ba488.bundle.js.gz BINARY)
target_add_binary_data( __idf_wifi-manager webapp/dist/js/node_vendors.cead70.bundle.js.gz BINARY) target_add_binary_data( __idf_wifi-manager webapp/dist/js/node_vendors.0ba488.bundle.js.gz BINARY)

View File

@@ -6,29 +6,29 @@ extern const uint8_t _favicon_32x32_png_start[] asm("_binary_favicon_32x32_png_s
extern const uint8_t _favicon_32x32_png_end[] asm("_binary_favicon_32x32_png_end"); extern const uint8_t _favicon_32x32_png_end[] asm("_binary_favicon_32x32_png_end");
extern const uint8_t _index_html_gz_start[] asm("_binary_index_html_gz_start"); extern const uint8_t _index_html_gz_start[] asm("_binary_index_html_gz_start");
extern const uint8_t _index_html_gz_end[] asm("_binary_index_html_gz_end"); extern const uint8_t _index_html_gz_end[] asm("_binary_index_html_gz_end");
extern const uint8_t _index_cead70_bundle_js_gz_start[] asm("_binary_index_cead70_bundle_js_gz_start"); extern const uint8_t _index_0ba488_bundle_js_gz_start[] asm("_binary_index_0ba488_bundle_js_gz_start");
extern const uint8_t _index_cead70_bundle_js_gz_end[] asm("_binary_index_cead70_bundle_js_gz_end"); extern const uint8_t _index_0ba488_bundle_js_gz_end[] asm("_binary_index_0ba488_bundle_js_gz_end");
extern const uint8_t _node_vendors_cead70_bundle_js_gz_start[] asm("_binary_node_vendors_cead70_bundle_js_gz_start"); extern const uint8_t _node_vendors_0ba488_bundle_js_gz_start[] asm("_binary_node_vendors_0ba488_bundle_js_gz_start");
extern const uint8_t _node_vendors_cead70_bundle_js_gz_end[] asm("_binary_node_vendors_cead70_bundle_js_gz_end"); extern const uint8_t _node_vendors_0ba488_bundle_js_gz_end[] asm("_binary_node_vendors_0ba488_bundle_js_gz_end");
const char * resource_lookups[] = { const char * resource_lookups[] = {
"/css/index.4bbe29a78a667faa2b6f.css.gz", "/css/index.4bbe29a78a667faa2b6f.css.gz",
"/favicon-32x32.png", "/favicon-32x32.png",
"/index.html.gz", "/index.html.gz",
"/js/index.cead70.bundle.js.gz", "/js/index.0ba488.bundle.js.gz",
"/js/node_vendors.cead70.bundle.js.gz", "/js/node_vendors.0ba488.bundle.js.gz",
"" ""
}; };
const uint8_t * resource_map_start[] = { const uint8_t * resource_map_start[] = {
_index_4bbe29a78a667faa2b6f_css_gz_start, _index_4bbe29a78a667faa2b6f_css_gz_start,
_favicon_32x32_png_start, _favicon_32x32_png_start,
_index_html_gz_start, _index_html_gz_start,
_index_cead70_bundle_js_gz_start, _index_0ba488_bundle_js_gz_start,
_node_vendors_cead70_bundle_js_gz_start _node_vendors_0ba488_bundle_js_gz_start
}; };
const uint8_t * resource_map_end[] = { const uint8_t * resource_map_end[] = {
_index_4bbe29a78a667faa2b6f_css_gz_end, _index_4bbe29a78a667faa2b6f_css_gz_end,
_favicon_32x32_png_end, _favicon_32x32_png_end,
_index_html_gz_end, _index_html_gz_end,
_index_cead70_bundle_js_gz_end, _index_0ba488_bundle_js_gz_end,
_node_vendors_cead70_bundle_js_gz_end _node_vendors_0ba488_bundle_js_gz_end
}; };

View File

@@ -1,6 +1,6 @@
/*********************************** /***********************************
webpack_headers webpack_headers
dist/css/index.4bbe29a78a667faa2b6f.css.gz,dist/favicon-32x32.png,dist/index.html.gz,dist/js/index.cead70.bundle.js.gz,dist/js/node_vendors.cead70.bundle.js.gz dist/css/index.4bbe29a78a667faa2b6f.css.gz,dist/favicon-32x32.png,dist/index.html.gz,dist/js/index.0ba488.bundle.js.gz,dist/js/node_vendors.0ba488.bundle.js.gz
***********************************/ ***********************************/
#pragma once #pragma once
#include <inttypes.h> #include <inttypes.h>

Binary file not shown.

View File

@@ -64,6 +64,9 @@ sub initPlugin {
Slim::Control::Request::subscribe( sub { onNotification(@_) }, [ ['newmetadata'] ] ); Slim::Control::Request::subscribe( sub { onNotification(@_) }, [ ['newmetadata'] ] );
Slim::Control::Request::subscribe( sub { onNotification(@_) }, [ ['playlist'], ['open', 'newsong'] ]); Slim::Control::Request::subscribe( sub { onNotification(@_) }, [ ['playlist'], ['open', 'newsong'] ]);
Slim::Control::Request::subscribe( \&onStopClear, [ ['playlist'], ['stop', 'clear'] ]); Slim::Control::Request::subscribe( \&onStopClear, [ ['playlist'], ['stop', 'clear'] ]);
# Add menu item to extras
Slim::Buttons::Home::addSubMenu('PLUGINS', 'PLUGIN_SQUEEZEESP32', { 'useMode' => 'squeezeesp32_mode', });
} }
sub onStopClear { sub onStopClear {

View File

@@ -174,6 +174,20 @@ sub setLEDVisu {
} }
updateLED($client); updateLED($client);
# display name
my $modes = ledVisualizerModes;
my $desc = $modes->[$visu]{'desc'};
my $name = '';
for (my $j = 0; $j < scalar @$desc; $j++) {
$name .= ' ' if ($j > 0);
$name .= $client->string(@{$desc}[$j]) || @{$desc}[$j];
}
$client->showBriefly( {
'line1' => $client->string('PLUGIN_SQUEEZEESP32_LED_VISUALIZER'),
'line2' => $name,
});
} }
sub onNotification { sub onNotification {
@@ -186,4 +200,62 @@ sub onNotification {
} }
} }
sub setMainMode {
my $client = shift;
my $method = shift;
if ($method eq 'pop') {
Slim::Buttons::Common::popMode($client);
$client->update();
return;
}
Slim::Buttons::Common::pushModeLeft($client, 'INPUT.Choice', {
'listRef' => [
{
name => string('PLUGIN_SQUEEZEESP32_LED_VISUALIZER'),
onPlay => sub { Slim::Control::Request::executeRequest($client, ['led_visual']); },
},
{
name => string('PLUGIN_SQUEEZEESP32_LED_BRIGHTNESS'),
onPlay => sub { Slim::Buttons::Common::pushModeLeft($client, 'squeezeesp32_ledvu_bright'); },
},
],
'header' => string('PLUGIN_SQUEEZEESP32'),
'headerAddCount' => 1,
'overlayRef' => sub { return (undef, shift->symbols('rightarrow')) },
});
}
sub setLedvuBrightMode {
my $client = shift;
my $method = shift;
if ($method eq 'pop') {
Slim::Buttons::Common::popMode($client);
$client->update();
return;
}
my $bright = $prefs->client($client)->get('led_brightness');
Slim::Control::Request::executeRequest($client, ['led_visual',1,$bright]);
Slim::Buttons::Common::pushMode($client, 'INPUT.Bar', {
'header' => 'PLUGIN_SQUEEZEESP32_LED_BRIGHTNESS',
'stringHeader' => 1,
'headerValue' => 'unscaled',
'min' => 1,
'max' => 255,
'increment' => 1,
'onChange' => sub {
my ($client, $value) = @_;
$bright = $bright + $value;
if ($bright > 0 && $bright <= 255) {
$prefs->client($client)->set('led_brightness', $bright);
updateLED($client);
}
},
'valueRef' => $bright,
});
}
1; 1;

View File

@@ -10,6 +10,6 @@
<name>PLUGIN_SQUEEZEESP32</name> <name>PLUGIN_SQUEEZEESP32</name>
<description>PLUGIN_SQUEEZEESP32_DESC</description> <description>PLUGIN_SQUEEZEESP32_DESC</description>
<module>Plugins::SqueezeESP32::Plugin</module> <module>Plugins::SqueezeESP32::Plugin</module>
<version>0.501</version> <version>0.600</version>
<creator>Philippe</creator> <creator>Philippe</creator>
</extensions> </extensions>

View File

@@ -1,10 +1,10 @@
<?xml version='1.0' standalone='yes'?> <?xml version='1.0' standalone='yes'?>
<extensions> <extensions>
<plugins> <plugins>
<plugin version="0.501" name="SqueezeESP32" minTarget="7.9" maxTarget="*"> <plugin version="0.600" name="SqueezeESP32" minTarget="7.9" maxTarget="*">
<link>https://github.com/sle118/squeezelite-esp32</link> <link>https://github.com/sle118/squeezelite-esp32</link>
<creator>Philippe</creator> <creator>Philippe</creator>
<sha>842ee0f7b8ccaf2e6df4a741565068f9e4c7a27e</sha> <sha>335b585e22eddbddacce00f34001d8bf2ee0f54f</sha>
<email>philippe_44@outlook.com</email> <email>philippe_44@outlook.com</email>
<desc lang="EN">SqueezeESP32 additional player id (100/101)</desc> <desc lang="EN">SqueezeESP32 additional player id (100/101)</desc>
<url>http://raw.githubusercontent.com/sle118/squeezelite-esp32/master-v4.3/plugin/SqueezeESP32.zip</url> <url>http://raw.githubusercontent.com/sle118/squeezelite-esp32/master-v4.3/plugin/SqueezeESP32.zip</url>

Binary file not shown.

Binary file not shown.

BIN
server_certs/r2m01.cer.37 Normal file

Binary file not shown.

BIN
server_certs/r2m01.cer.38 Normal file

Binary file not shown.