From d7d47d11272f5b5e329e1822ec3615696afa2025 Mon Sep 17 00:00:00 2001 From: Philippe G Date: Mon, 27 Dec 2021 14:49:12 -0800 Subject: [PATCH] unique UUID per CSPOT player --- components/spotify/cspot/include/ConstantParameters.h | 4 +++- components/spotify/cspot/src/ZeroconfAuthenticator.cpp | 3 +++ components/spotify/cspot_sink.c | 8 +++++++- components/wifi-manager/webapp/webpack/dist/index.html | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/components/spotify/cspot/include/ConstantParameters.h b/components/spotify/cspot/include/ConstantParameters.h index 4b4ccd62..13a7a8fb 100644 --- a/components/spotify/cspot/include/ConstantParameters.h +++ b/components/spotify/cspot/include/ConstantParameters.h @@ -3,8 +3,10 @@ #define MAX_VOLUME 65536 +// variable weakly set in ZeroconfAuthentificator.cpp +extern char deviceId[]; + // Hardcoded information sent to spotify servers -const char * const deviceId = "162137fd329622137a14901634264e6f332e2422"; const char * const informationString = "cspot"; const char * const brandName = "corn"; const char * const versionString = "cspot-1.0"; diff --git a/components/spotify/cspot/src/ZeroconfAuthenticator.cpp b/components/spotify/cspot/src/ZeroconfAuthenticator.cpp index 9e8458e9..78fdc9a3 100644 --- a/components/spotify/cspot/src/ZeroconfAuthenticator.cpp +++ b/components/spotify/cspot/src/ZeroconfAuthenticator.cpp @@ -7,6 +7,9 @@ #include "Logger.h" #include "ConfigJSON.h" +// provide weak deviceId (see ConstantParameters.h) +char deviceId[] __attribute__((weak)) = "162137fd329622137a14901634264e6f332e2422"; + ZeroconfAuthenticator::ZeroconfAuthenticator(authCallback callback, std::shared_ptr httpServer) { this->gotBlobCallback = callback; srand((unsigned int)time(NULL)); diff --git a/components/spotify/cspot_sink.c b/components/spotify/cspot_sink.c index d81379ff..0df72605 100644 --- a/components/spotify/cspot_sink.c +++ b/components/spotify/cspot_sink.c @@ -16,6 +16,8 @@ #include "cspot_private.h" #include "cspot_sink.h" +char EXT_RAM_ATTR deviceId[16]; + static EXT_RAM_ATTR struct cspot_cb_s { cspot_cmd_vcb_t cmd; cspot_data_cb_t data; @@ -147,11 +149,15 @@ static bool cmd_handler(cspot_event_t event, ...) { */ static void cspot_sink_start(nm_state_t state_id, int sub_state) { const char *hostname; + uint8_t mac[6]; cmd_handler_chain = cspot_cbs.cmd; network_get_hostname(&hostname); + + esp_netif_get_mac(network_get_active_interface(), mac); + for (int i = 0; i < 6; i++) sprintf(deviceId + 2*i, "%02x", mac[i]); - ESP_LOGI(TAG, "Starting Spotify (CSpot) servicename %s", hostname); + ESP_LOGI(TAG, "Starting Spotify (CSpot) servicename %s with id %s", hostname, deviceId); cspot = cspot_create(hostname, cmd_handler, cspot_cbs.data); } diff --git a/components/wifi-manager/webapp/webpack/dist/index.html b/components/wifi-manager/webapp/webpack/dist/index.html index f97166f3..10396c2e 100644 --- a/components/wifi-manager/webapp/webpack/dist/index.html +++ b/components/wifi-manager/webapp/webpack/dist/index.html @@ -1 +1 @@ -SqueezeESP32
Software Updates
VersionDate/TimePlatformBranchBit Depth
Local Firmware Upload
KeyValue
Usage Templates
Output
WiFi Status
JoinedNameSignalSecurity
Logs
TimestampMessage
Tasks
#Task NameCPUStateMin StackBase PriorityCur Priority
Credits

squeezelite-esp32
© 2020, philippe44, sle118, daduke
This software is released under the MIT License.

This app would not be possible without the following libraries:

  • squeezelite, © 2012-2019, Adrian Smith and Ralph Irving. Licensed under the GPL License.
  • esp32-wifi-manager, © 2017-2019, Tony Pottier. Licensed under the MIT License.
  • SpinKit, © 2015, Tobias Ahlin. Licensed under the MIT License.
  • jQuery, The jQuery Foundation. Licensed under the MIT License.
  • cJSON, © 2009-2017, Dave Gamble and cJSON contributors. Licensed under the MIT License.
  • esp32-rotary-encoder, © 2011-2019, David Antliff and Ben Buxton. Licensed under the GPL License.
  • tarablessd1306, © 2017-2018, Tara Keeling. Licensed under the MIT license.
Extras/Overrides
\ No newline at end of file +SqueezeESP32
Software Updates
VersionDate/TimePlatformBranchBit Depth
Local Firmware Upload
KeyValue
Usage Templates
Output
WiFi Status
JoinedNameSignalSecurity
Logs
TimestampMessage
Tasks
#Task NameCPUStateMin StackBase PriorityCur Priority
Credits

squeezelite-esp32
© 2020, philippe44, sle118, daduke
This software is released under the MIT License.

This app would not be possible without the following libraries:

  • squeezelite, © 2012-2019, Adrian Smith and Ralph Irving. Licensed under the GPL License.
  • esp32-wifi-manager, © 2017-2019, Tony Pottier. Licensed under the MIT License.
  • SpinKit, © 2015, Tobias Ahlin. Licensed under the MIT License.
  • jQuery, The jQuery Foundation. Licensed under the MIT License.
  • cJSON, © 2009-2017, Dave Gamble and cJSON contributors. Licensed under the MIT License.
  • esp32-rotary-encoder, © 2011-2019, David Antliff and Ben Buxton. Licensed under the GPL License.
  • tarablessd1306, © 2017-2018, Tara Keeling. Licensed under the MIT license.
  • CSpot, © 2020, feelfreelinux & alufers. Licensed under the GPL License.
Extras/Overrides
\ No newline at end of file