diff --git a/html/website.html b/html/website.html index ca3c453..f17f410 100644 --- a/html/website.html +++ b/html/website.html @@ -132,15 +132,12 @@
- - -
- Bitte eine gültige IPv4-Adresse eingeben, z.B. 192.168.2.89. -
+ + - + - +
@@ -152,9 +149,9 @@
- + - +
@@ -172,9 +169,9 @@
- + - +
@@ -250,15 +247,15 @@ $("#rfidIdMod").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500); } if (socketMsg.status != null) { - if (socketMsg.status == 'ok') { - $("#" + lastIdclicked).find('.messages').html(okBox); - } else { - $("#" + lastIdclicked).find('.messages').html(errorBox); - } + if (socketMsg.status == 'ok') { + $("#" + lastIdclicked).find('.messages').html(okBox); + } else { + $("#" + lastIdclicked).find('.messages').html(errorBox); + } } if (socketMsg.pong != null) { - if (socketMsg.pong == 'pong') { - pong(); - } + if (socketMsg.pong == 'pong') { + pong(); + } } }; diff --git a/html/website_EN.html b/html/website_EN.html index 1e14e81..71d6a9e 100644 --- a/html/website_EN.html +++ b/html/website_EN.html @@ -132,15 +132,12 @@
- - -
- Please enter a valid IPv4-address, e.g. 192.168.2.89. -
+ + - + - +
@@ -152,9 +149,9 @@
- + - +
@@ -172,9 +169,9 @@
- + - +
@@ -250,15 +247,15 @@ $("#rfidIdMod").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500); } if (socketMsg.status != null) { - if (socketMsg.status == 'ok') { - $("#" + lastIdclicked).find('.messages').html(okBox); - } else { - $("#" + lastIdclicked).find('.messages').html(errorBox); - } + if (socketMsg.status == 'ok') { + $("#" + lastIdclicked).find('.messages').html(okBox); + } else { + $("#" + lastIdclicked).find('.messages').html(errorBox); + } } if (socketMsg.pong != null) { - if (socketMsg.pong == 'pong') { - pong(); - } + if (socketMsg.pong == 'pong') { + pong(); + } } }; diff --git a/platformio.ini b/platformio.ini index bb897b8..d665438 100644 --- a/platformio.ini +++ b/platformio.ini @@ -29,6 +29,7 @@ lib_deps = ESP Async WebServer https://github.com/me-no-dev/AsyncTCP https://github.com/bblanchon/ArduinoJson.git +; https://github.com/Yveaux/AC101.git ; https://github.com/pschatzmann/ESP32-A2DP.git ; Don't forget to run this script if you changed the html-files provided in any way diff --git a/src/main.cpp b/src/main.cpp index 7bb5181..8042827 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,7 +6,7 @@ #define LANGUAGE 1 // 1 = deutsch; 2 = english //#define SINGLE_SPI_ENABLE // If only one SPI-instance should be used instead of two -//#define SD_NOT_MANDATORY_ENABLE // Only for debugging-purposes: Tonuino will also start without mounted SD-card anyway (will only try once to mount it) +//#define SD_NOT_MANDATORY_ENABLE // Only for debugging-purposes: Tonuino will also start without mounted SD-card anyway (will only try once to mount it ) //#define BLUETOOTH_ENABLE // Doesn't work currently (so don't enable) as there's not enough DRAM available #include @@ -151,10 +151,10 @@ char *logBuf = (char*) calloc(serialLoglength, sizeof(char)); // Buffer for all #define DIMM_LEDS_NIGHTMODE 120 // Changes LED-brightness // Repeat-Modes -#define NO_REPEAT 0 -#define TRACK 1 -#define PLAYLIST 2 -#define TRACK_N_PLAYLIST 3 +#define NO_REPEAT 0 // No repeat +#define TRACK 1 // Repeat current track (infinite loop) +#define PLAYLIST 2 // Repeat whole playlist (infinite loop) +#define TRACK_N_PLAYLIST 3 // Repeat both (infinite loop) typedef struct { // Bit field uint8_t playMode: 4; // playMode @@ -199,15 +199,17 @@ bool enableMqtt = true; #define RFID_SCAN_INTERVAL 300 // in ms uint8_t const cardIdSize = 4; // RFID // Volume -uint8_t maxVolume = 21; // Maximum volume that can be adjusted +uint8_t maxVolume = 21; // Maximum volume that can be adjusted (default; can be changed later via GUI) uint8_t minVolume = 0; // Lowest volume that can be adjusted -uint8_t initVolume = 3; // 0...21 (If not found in NVS, this one will be taken) +uint8_t initVolume = 3; // 0...21 (If not found in NVS, this one will be taken) (default; can be changed later via GUI) // Sleep uint8_t maxInactivityTime = 10; // Time in minutes, after uC is put to deep sleep because of inactivity uint8_t sleepTimer = 30; // Sleep timer in minutes that can be optionally used (and modified later via MQTT or RFID) // FTP -char *ftpUser = strndup((char*) "esp32", 10); // FTP-user -char *ftpPassword = strndup((char*) "esp32", 15); // FTP-password +uint8_t ftpUserLength = 10; // Length will be published n-1 as maxlength to GUI +uint8_t ftpPasswordLength = 15; // Length will be published n-1 as maxlength to GUI +char *ftpUser = strndup((char*) "esp32", ftpUserLength); // FTP-user (default; can be changed later via GUI) +char *ftpPassword = strndup((char*) "esp32", ftpPasswordLength); // FTP-password (default; can be changed later via GUI) // Button-configuration (change according your needs) uint8_t buttonDebounceInterval = 50; // Interval in ms to software-debounce buttons @@ -255,9 +257,15 @@ bool accessPointStarted = false; // MQTT-configuration -char *mqtt_server = strndup((char*) "192.168.2.43", 16); // IP-address of MQTT-server (if not found in NVS this one will be taken) -char *mqttUser = strndup((char*) "mqtt-user", 16); // MQTT-user -char *mqttPassword = strndup((char*) "mqtt-password", 16); // MQTT-password*/ +// Please note: all lengths will be published n-1 as maxlength to GUI +uint8_t mqttServerLength = 32; +uint8_t mqttUserLength = 16; +uint8_t mqttPasswordLength = 16; + +// Please note: all of them are defaults that can be changed later via GUI +char *mqtt_server = strndup((char*) "192.168.2.43", mqttServerLength); // IP-address of MQTT-server (if not found in NVS this one will be taken) +char *mqttUser = strndup((char*) "mqtt-user", mqttUserLength); // MQTT-user +char *mqttPassword = strndup((char*) "mqtt-password", mqttPasswordLength); // MQTT-password*/ #ifdef MQTT_ENABLE #define DEVICE_HOSTNAME "ESP32-Tonuino" // Name that that is used for MQTT @@ -1540,7 +1548,7 @@ void rfidScanner(void *parameter) { for (uint8_t i=0; i\ - \ - \ -
\ - Bitte eine gültige IPv4-Adresse eingeben, z.B. 192.168.2.89.\ -
\ + \ + \ \ - \ + \ \ - \ + \
\ \ \ @@ -152,9 +149,9 @@ static const char mgtWebsite[] PROGMEM = "\ \
\ \ - \ + \ \ - \ + \
\ \ \ @@ -172,9 +169,9 @@ static const char mgtWebsite[] PROGMEM = "\ \
\ \ - \ + \ \ - \ + \
\
\ \ @@ -250,15 +247,15 @@ static const char mgtWebsite[] PROGMEM = "\ $(\"#rfidIdMod\").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500);\ \ } if (socketMsg.status != null) {\ - if (socketMsg.status == 'ok') {\ - $(\"#\" + lastIdclicked).find('.messages').html(okBox);\ - } else {\ - $(\"#\" + lastIdclicked).find('.messages').html(errorBox);\ - }\ + if (socketMsg.status == 'ok') {\ + $(\"#\" + lastIdclicked).find('.messages').html(okBox);\ + } else {\ + $(\"#\" + lastIdclicked).find('.messages').html(errorBox);\ + }\ } if (socketMsg.pong != null) {\ - if (socketMsg.pong == 'pong') {\ - pong();\ - }\ + if (socketMsg.pong == 'pong') {\ + pong();\ + }\ }\ };\ \ diff --git a/src/websiteMgmt_EN.h b/src/websiteMgmt_EN.h index 938575c..60ee72d 100644 --- a/src/websiteMgmt_EN.h +++ b/src/websiteMgmt_EN.h @@ -132,15 +132,12 @@ static const char mgtWebsite[] PROGMEM = "\ \
\
\ - \ - \ -
\ - Please enter a valid IPv4-address, e.g. 192.168.2.89.\ -
\ + \ + \ \ - \ + \ \ - \ + \
\ \ \ @@ -152,9 +149,9 @@ static const char mgtWebsite[] PROGMEM = "\ \
\ \ - \ + \ \ - \ + \
\ \ \ @@ -172,9 +169,9 @@ static const char mgtWebsite[] PROGMEM = "\ \
\ \ - \ + \ \ - \ + \
\
\ \ @@ -250,15 +247,15 @@ static const char mgtWebsite[] PROGMEM = "\ $(\"#rfidIdMod\").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500);\ \ } if (socketMsg.status != null) {\ - if (socketMsg.status == 'ok') {\ - $(\"#\" + lastIdclicked).find('.messages').html(okBox);\ - } else {\ - $(\"#\" + lastIdclicked).find('.messages').html(errorBox);\ - }\ + if (socketMsg.status == 'ok') {\ + $(\"#\" + lastIdclicked).find('.messages').html(okBox);\ + } else {\ + $(\"#\" + lastIdclicked).find('.messages').html(errorBox);\ + }\ } if (socketMsg.pong != null) {\ - if (socketMsg.pong == 'pong') {\ - pong();\ - }\ + if (socketMsg.pong == 'pong') {\ + pong();\ + }\ }\ };\ \