diff --git a/README.md b/README.md index 2d6f27d..e477e05 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,7 @@ Rotation of the display: - Arduino IDE version 2.x.x is not supported. Use Arduino IDE 1.8.19 - ESP32 core version 2.0.0 or higher is [required](https://github.com/espressif/arduino-esp32)! +- ESP32 core version 3.x.x or higher is not supported (yet)! 1. Generate a myoptions.h file for your hardware configuration using [this tool](https://e2002.github.io/docs/myoptions-generator.html). 2. Put myoptions.h file next to yoRadio.ino. 3. Replace file Arduino/libraries/Adafruit_GFX_Library/glcdfont.c with file [yoRadio/fonts/glcdfont.c](yoRadio/fonts/glcdfont.c) @@ -229,6 +230,9 @@ Work is in progress... --- ## Version history +#### v0.9.313b +- added support for ESP32-S3 boards (ESP32 S3 Dev Module) (esp32 cores version 3.x.x is not supported yet) +- fixes in displaying sliders in the web interface #### v0.9.300 (homeassistant component) - HA component >> bug fixes in the component for newer versions of Home Assistant diff --git a/examples/myoptions.h b/examples/myoptions.h index 79e508b..3782b1a 100644 --- a/examples/myoptions.h +++ b/examples/myoptions.h @@ -27,7 +27,8 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti /******************************************/ /* VSPI PINS. SCL(SCK, CLK) must be connected to pin 18 - SDA(MOSI, DIN, SDI) must be connected to pin 23 */ + SDA(MOSI, DIN, SDI) must be connected to pin 23 + for ESP32-S3 see ESP32-S3 Pin Reference http://wiki.fluidnc.com/en/hardware/ESP32-S3_Pin_Reference*/ //#define TFT_CS 5 /* SPI CS pin */ //#define TFT_RST 15 /* SPI RST pin. set to -1 and connect to Esp EN pin */ //#define TFT_DC 4 /* SPI DC/RS pin */ diff --git a/images/board3.jpg b/images/board3.jpg index 02399c1..2fdc5dc 100644 Binary files a/images/board3.jpg and b/images/board3.jpg differ diff --git a/yoRadio/data/www/style.css.gz b/yoRadio/data/www/style.css.gz index 6808f8e..07d046f 100644 Binary files a/yoRadio/data/www/style.css.gz and b/yoRadio/data/www/style.css.gz differ diff --git a/yoRadio/locale/displayL10n_en.h b/yoRadio/locale/displayL10n_en.h index 69d2e54..bd3825e 100644 --- a/yoRadio/locale/displayL10n_en.h +++ b/yoRadio/locale/displayL10n_en.h @@ -31,9 +31,9 @@ const char jun[] PROGMEM = "june"; const char jul[] PROGMEM = "july"; const char aug[] PROGMEM = "august"; const char sep[] PROGMEM = "september"; -const char oct[] PROGMEM = "october"; +const char octt[] PROGMEM = "october"; const char nov[] PROGMEM = "november"; -const char dec[] PROGMEM = "december"; +const char decc[] PROGMEM = "december"; const char wn_N[] PROGMEM = "NORTH"; const char wn_NNE[] PROGMEM = "NNE"; @@ -54,7 +54,7 @@ const char wn_NNW[] PROGMEM = "NNW"; const char* const dow[] PROGMEM = { sun, mon, tue, wed, thu, fri, sat }; const char* const dowf[] PROGMEM = { sunf, monf, tuef, wedf, thuf, frif, satf }; -const char* const mnths[] PROGMEM = { jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec }; +const char* const mnths[] PROGMEM = { jan, feb, mar, apr, may, jun, jul, aug, sep, octt, nov, decc }; const char* const wind[] PROGMEM = { wn_N, wn_NNE, wn_NE, wn_ENE, wn_E, wn_ESE, wn_SE, wn_SSE, wn_S, wn_SSW, wn_SW, wn_WSW, wn_W, wn_WNW, wn_NW, wn_NNW, wn_N }; const char const_PlReady[] PROGMEM = "[ready]"; diff --git a/yoRadio/locale/displayL10n_ru.h b/yoRadio/locale/displayL10n_ru.h index d3515c0..5aa58e2 100644 --- a/yoRadio/locale/displayL10n_ru.h +++ b/yoRadio/locale/displayL10n_ru.h @@ -31,9 +31,9 @@ const char jun[] PROGMEM = "июня"; const char jul[] PROGMEM = "июля"; const char aug[] PROGMEM = "августа"; const char sep[] PROGMEM = "сентября"; -const char oct[] PROGMEM = "октября"; +const char octt[] PROGMEM = "октября"; const char nov[] PROGMEM = "ноября"; -const char dec[] PROGMEM = "декабря"; +const char decc[] PROGMEM = "декабря"; const char wn_N[] PROGMEM = "СЕВ"; const char wn_NNE[] PROGMEM = "ССВ"; @@ -54,7 +54,7 @@ const char wn_NNW[] PROGMEM = "ССЗ"; const char* const dow[] PROGMEM = { sun, mon, tue, wed, thu, fri, sat }; const char* const dowf[] PROGMEM = { sunf, monf, tuef, wedf, thuf, frif, satf }; -const char* const mnths[] PROGMEM = { jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec }; +const char* const mnths[] PROGMEM = { jan, feb, mar, apr, may, jun, jul, aug, sep, octt, nov, decc }; const char* const wind[] PROGMEM = { wn_N, wn_NNE, wn_NE, wn_ENE, wn_E, wn_ESE, wn_SE, wn_SSE, wn_S, wn_SSW, wn_SW, wn_WSW, wn_W, wn_WNW, wn_NW, wn_NNW, wn_N }; const char const_PlReady[] PROGMEM = "[готов]"; diff --git a/yoRadio/src/AsyncWebServer/AsyncWebSocket.cpp b/yoRadio/src/AsyncWebServer/AsyncWebSocket.cpp index f76f2fc..80c114a 100644 --- a/yoRadio/src/AsyncWebServer/AsyncWebSocket.cpp +++ b/yoRadio/src/AsyncWebServer/AsyncWebSocket.cpp @@ -829,7 +829,11 @@ void AsyncWebSocketClient::binary(AsyncWebSocketMessageBuffer * buffer) IPAddress AsyncWebSocketClient::remoteIP() { if(!_client) { +#if ESP_IDF_VERSION_MAJOR < 5 return IPAddress(0U); +#else + return IPAddress(0ul); +#endif } return _client->remoteIP(); } diff --git a/yoRadio/src/AsyncWebServer/WebAuthentication.cpp b/yoRadio/src/AsyncWebServer/WebAuthentication.cpp index 45246a1..38b20f3 100644 --- a/yoRadio/src/AsyncWebServer/WebAuthentication.cpp +++ b/yoRadio/src/AsyncWebServer/WebAuthentication.cpp @@ -71,9 +71,15 @@ static bool getMD5(uint8_t * data, uint16_t len, char * output){//33 bytes or mo memset(_buf, 0x00, 16); #ifdef ESP32 mbedtls_md5_init(&_ctx); +#if ESP_IDF_VERSION_MAJOR < 5 mbedtls_md5_starts_ret(&_ctx); mbedtls_md5_update_ret(&_ctx, data, len); mbedtls_md5_finish_ret(&_ctx, _buf); +#else + mbedtls_md5_starts(&_ctx); + mbedtls_md5_update(&_ctx, data, len); + mbedtls_md5_finish(&_ctx, _buf); +#endif #else MD5Init(&_ctx); MD5Update(&_ctx, data, len); diff --git a/yoRadio/src/audioI2S/Audio.cpp b/yoRadio/src/audioI2S/Audio.cpp index 6a78f06..a66b6aa 100644 --- a/yoRadio/src/audioI2S/Audio.cpp +++ b/yoRadio/src/audioI2S/Audio.cpp @@ -4390,7 +4390,6 @@ bool Audio::setPinout(uint8_t BCLK, uint8_t LRC, uint8_t DOUT, int8_t DIN, int8_ #if(ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 4) m_pin_config.mck_io_num = MCK; #endif - const esp_err_t result = i2s_set_pin((i2s_port_t) m_i2s_num, &m_pin_config); return (result == ESP_OK); } diff --git a/yoRadio/src/core/controls.cpp b/yoRadio/src/core/controls.cpp index 9ccb51b..73a270f 100644 --- a/yoRadio/src/core/controls.cpp +++ b/yoRadio/src/core/controls.cpp @@ -213,7 +213,7 @@ void irBlink() { } } -void irNum(byte num) { +void irNumber(uint8_t num) { uint16_t s; if (display.numOfNextStation == 0 && num == 0) return; display.putRequest(NEWMODE, NUMBERS); @@ -292,43 +292,43 @@ void irLoop() { break; } case IR_0: { - irNum(0); + irNumber(0); break; } case IR_1: { - irNum(1); + irNumber(1); break; } case IR_2: { - irNum(2); + irNumber(2); break; } case IR_3: { - irNum(3); + irNumber(3); break; } case IR_4: { - irNum(4); + irNumber(4); break; } case IR_5: { - irNum(5); + irNumber(5); break; } case IR_6: { - irNum(6); + irNumber(6); break; } case IR_7: { - irNum(7); + irNumber(7); break; } case IR_8: { - irNum(8); + irNumber(8); break; } case IR_9: { - irNum(9); + irNumber(9); break; } case IR_AST: { diff --git a/yoRadio/src/core/controls.h b/yoRadio/src/core/controls.h index b4b5022..f096ff6 100644 --- a/yoRadio/src/core/controls.h +++ b/yoRadio/src/core/controls.h @@ -25,7 +25,7 @@ void encoder1Loop(); void encoder2Loop(); void irLoop(); //void touchLoop(); -void irNum(byte num); +void irNumber(uint8_t num); void irBlink(); void controlsEvent(bool toRight, int8_t volDelta = 0); diff --git a/yoRadio/src/core/network.cpp b/yoRadio/src/core/network.cpp index 69f1bf3..93a8776 100644 --- a/yoRadio/src/core/network.cpp +++ b/yoRadio/src/core/network.cpp @@ -11,7 +11,7 @@ #define WIFI_ATTEMPTS 16 #endif -Network network; +MyNetwork network; TaskHandle_t syncTaskHandle; //TaskHandle_t reconnectTaskHandle; @@ -73,7 +73,7 @@ void ticks() { } } -void Network::WiFiReconnected(WiFiEvent_t event, WiFiEventInfo_t info){ +void MyNetwork::WiFiReconnected(WiFiEvent_t event, WiFiEventInfo_t info){ network.beginReconnect = false; player.lockOutput = false; delay(100); @@ -90,7 +90,7 @@ void Network::WiFiReconnected(WiFiEvent_t event, WiFiEventInfo_t info){ #endif } -void Network::WiFiLostConnection(WiFiEvent_t event, WiFiEventInfo_t info){ +void MyNetwork::WiFiLostConnection(WiFiEvent_t event, WiFiEventInfo_t info){ if(!network.beginReconnect){ Serial.printf("Lost connection, reconnecting to %s...\n", config.ssids[config.store.lastSSID-1].ssid); if(config.getMode()==PM_SDCARD) { @@ -106,7 +106,7 @@ void Network::WiFiLostConnection(WiFiEvent_t event, WiFiEventInfo_t info){ WiFi.reconnect(); } -bool Network::wifiBegin(bool silent){ +bool MyNetwork::wifiBegin(bool silent){ uint8_t ls = (config.store.lastSSID == 0 || config.store.lastSSID > config.ssidsCount) ? 0 : config.store.lastSSID - 1; uint8_t startedls = ls; uint8_t errcnt = 0; @@ -158,7 +158,7 @@ void searchWiFi(void * pvParameters){ #define DBGAP false -void Network::begin() { +void MyNetwork::begin() { BOOTLOG("network.begin"); config.initNetwork(); ctimer.detach(); @@ -193,7 +193,7 @@ void Network::begin() { if (network_on_connect) network_on_connect(); } -void Network::setWifiParams(){ +void MyNetwork::setWifiParams(){ WiFi.setSleep(false); WiFi.onEvent(WiFiReconnected, WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_GOT_IP); WiFi.onEvent(WiFiLostConnection, WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_DISCONNECTED); @@ -210,7 +210,7 @@ void Network::setWifiParams(){ } } -void Network::requestTimeSync(bool withTelnetOutput, uint8_t clientId) { +void MyNetwork::requestTimeSync(bool withTelnetOutput, uint8_t clientId) { if (withTelnetOutput) { char timeStringBuff[50]; strftime(timeStringBuff, sizeof(timeStringBuff), "%Y-%m-%dT%H:%M:%S", &timeinfo); @@ -226,7 +226,7 @@ void rebootTime() { ESP.restart(); } -void Network::raiseSoftAP() { +void MyNetwork::raiseSoftAP() { WiFi.mode(WIFI_AP); WiFi.softAP(apSsid, apPassword); Serial.println("##[BOOT]#"); @@ -240,7 +240,7 @@ void Network::raiseSoftAP() { rtimer.once(config.store.softapdelay*60, rebootTime); } -void Network::requestWeatherSync(){ +void MyNetwork::requestWeatherSync(){ display.putRequest(NEWWEATHER); } diff --git a/yoRadio/src/core/network.h b/yoRadio/src/core/network.h index 70f49ad..e125d24 100644 --- a/yoRadio/src/core/network.h +++ b/yoRadio/src/core/network.h @@ -13,7 +13,7 @@ enum n_Status_e { CONNECTED, SOFT_AP, FAILED, SDREADY }; -class Network { +class MyNetwork { public: n_Status_e status; struct tm timeinfo; @@ -24,7 +24,7 @@ class Network { char *weatherBuf; bool trueWeather; public: - Network() {}; + MyNetwork() {}; void begin(); void requestTimeSync(bool withTelnetOutput=false, uint8_t clientId=0); void requestWeatherSync(); @@ -37,7 +37,7 @@ class Network { static void WiFiReconnected(WiFiEvent_t event, WiFiEventInfo_t info); }; -extern Network network; +extern MyNetwork network; extern __attribute__((weak)) void network_on_connect(); diff --git a/yoRadio/src/core/options.h b/yoRadio/src/core/options.h index f3266eb..ec78708 100644 --- a/yoRadio/src/core/options.h +++ b/yoRadio/src/core/options.h @@ -1,7 +1,7 @@ #ifndef options_h #define options_h -#define YOVERSION "0.9.300" +#define YOVERSION "0.9.313b" /******************************************************* DO NOT EDIT THIS FILE. @@ -258,10 +258,11 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti #endif /* ESP DEVBOARD */ -#ifndef LED_BUILTIN - #define LED_BUILTIN 255 +#ifndef ARDUINO_ESP32S3_DEV + #ifndef LED_BUILTIN + #define LED_BUILTIN 255 + #endif #endif - /* Other settings. You can overwrite them in the myoptions.h file */ #ifndef MUTE_PIN #define MUTE_PIN 255 // MUTE Pin @@ -452,6 +453,12 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti #define L10N_LANGUAGE EN #endif +#ifndef VSPI + #define VSPI 3 +#endif +#ifndef HSPI + #define HSPI 1 +#endif #endif diff --git a/yoRadio/src/core/optionschecker.h b/yoRadio/src/core/optionschecker.h index 23e7562..1cd88b8 100644 --- a/yoRadio/src/core/optionschecker.h +++ b/yoRadio/src/core/optionschecker.h @@ -13,8 +13,8 @@ # error YOU MUST CHOOSE BETWEEN I2S DAC AND VS1053 BY DISABLING THE SECOND MODULE IN THE myoptions.h #endif -#ifndef ARDUINO_ESP32_DEV -# error ONLY MODULES "ESP32 Dev Module" AND "ESP32 Wrover Module" ARE SUPPORTED. PLEASE SELECT ONE OF THEM IN THE MENU >> TOOLS >> BOARD +#if !(defined(ARDUINO_ESP32_DEV) || defined(ARDUINO_ESP32S3_DEV)) +# error ONLY MODULES "ESP32 Dev Module", "ESP32 Wrover Module" AND "ESP32 S3 Dev Module" ARE SUPPORTED. PLEASE SELECT ONE OF THEM IN THE MENU >> TOOLS >> BOARD #endif #endif