v0.9.313b

This commit is contained in:
e2002
2024-11-16 19:10:46 +03:00
parent afe9d57f2b
commit 778dd1e847
15 changed files with 59 additions and 38 deletions

View File

@@ -145,6 +145,7 @@ Rotation of the display:
- <span style="color: red; font-weight: bold; font-size: 22px;text-decoration: underline;">Arduino IDE version 2.x.x is not supported. Use Arduino IDE 1.8.19</span> - <span style="color: red; font-weight: bold; font-size: 22px;text-decoration: underline;">Arduino IDE version 2.x.x is not supported. Use Arduino IDE 1.8.19</span>
- <span style="color: red; font-weight: bold; font-size: 22px;text-decoration: underline;">ESP32 core version 2.0.0 or higher is [required](https://github.com/espressif/arduino-esp32)!</span> - <span style="color: red; font-weight: bold; font-size: 22px;text-decoration: underline;">ESP32 core version 2.0.0 or higher is [required](https://github.com/espressif/arduino-esp32)!</span>
- <span style="color: red; font-weight: bold; font-size: 22px;text-decoration: underline;">ESP32 core version 3.x.x or higher is not supported (yet)!</span>
1. Generate a myoptions.h file for your hardware configuration using [this tool](https://e2002.github.io/docs/myoptions-generator.html). 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. 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) 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 ## 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) #### v0.9.300 (homeassistant component)
- HA component >> bug fixes in the component for newer versions of Home Assistant - HA component >> bug fixes in the component for newer versions of Home Assistant

View File

@@ -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 /* 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_CS 5 /* SPI CS pin */
//#define TFT_RST 15 /* SPI RST pin. set to -1 and connect to Esp EN 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 */ //#define TFT_DC 4 /* SPI DC/RS pin */

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

View File

@@ -31,9 +31,9 @@ const char jun[] PROGMEM = "june";
const char jul[] PROGMEM = "july"; const char jul[] PROGMEM = "july";
const char aug[] PROGMEM = "august"; const char aug[] PROGMEM = "august";
const char sep[] PROGMEM = "september"; const char sep[] PROGMEM = "september";
const char oct[] PROGMEM = "october"; const char octt[] PROGMEM = "october";
const char nov[] PROGMEM = "november"; const char nov[] PROGMEM = "november";
const char dec[] PROGMEM = "december"; const char decc[] PROGMEM = "december";
const char wn_N[] PROGMEM = "NORTH"; const char wn_N[] PROGMEM = "NORTH";
const char wn_NNE[] PROGMEM = "NNE"; 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 dow[] PROGMEM = { sun, mon, tue, wed, thu, fri, sat };
const char* const dowf[] PROGMEM = { sunf, monf, tuef, wedf, thuf, frif, satf }; 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 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]"; const char const_PlReady[] PROGMEM = "[ready]";

View File

@@ -31,9 +31,9 @@ const char jun[] PROGMEM = "июня";
const char jul[] PROGMEM = "июля"; const char jul[] PROGMEM = "июля";
const char aug[] PROGMEM = "августа"; const char aug[] PROGMEM = "августа";
const char sep[] PROGMEM = "сентября"; const char sep[] PROGMEM = "сентября";
const char oct[] PROGMEM = "октября"; const char octt[] PROGMEM = "октября";
const char nov[] PROGMEM = "ноября"; const char nov[] PROGMEM = "ноября";
const char dec[] PROGMEM = "декабря"; const char decc[] PROGMEM = "декабря";
const char wn_N[] PROGMEM = "СЕВ"; const char wn_N[] PROGMEM = "СЕВ";
const char wn_NNE[] 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 dow[] PROGMEM = { sun, mon, tue, wed, thu, fri, sat };
const char* const dowf[] PROGMEM = { sunf, monf, tuef, wedf, thuf, frif, satf }; 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 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 = "[готов]"; const char const_PlReady[] PROGMEM = "[готов]";

View File

@@ -829,7 +829,11 @@ void AsyncWebSocketClient::binary(AsyncWebSocketMessageBuffer * buffer)
IPAddress AsyncWebSocketClient::remoteIP() { IPAddress AsyncWebSocketClient::remoteIP() {
if(!_client) { if(!_client) {
#if ESP_IDF_VERSION_MAJOR < 5
return IPAddress(0U); return IPAddress(0U);
#else
return IPAddress(0ul);
#endif
} }
return _client->remoteIP(); return _client->remoteIP();
} }

View File

@@ -71,9 +71,15 @@ static bool getMD5(uint8_t * data, uint16_t len, char * output){//33 bytes or mo
memset(_buf, 0x00, 16); memset(_buf, 0x00, 16);
#ifdef ESP32 #ifdef ESP32
mbedtls_md5_init(&_ctx); mbedtls_md5_init(&_ctx);
#if ESP_IDF_VERSION_MAJOR < 5
mbedtls_md5_starts_ret(&_ctx); mbedtls_md5_starts_ret(&_ctx);
mbedtls_md5_update_ret(&_ctx, data, len); mbedtls_md5_update_ret(&_ctx, data, len);
mbedtls_md5_finish_ret(&_ctx, _buf); mbedtls_md5_finish_ret(&_ctx, _buf);
#else
mbedtls_md5_starts(&_ctx);
mbedtls_md5_update(&_ctx, data, len);
mbedtls_md5_finish(&_ctx, _buf);
#endif
#else #else
MD5Init(&_ctx); MD5Init(&_ctx);
MD5Update(&_ctx, data, len); MD5Update(&_ctx, data, len);

View File

@@ -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) #if(ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 4)
m_pin_config.mck_io_num = MCK; m_pin_config.mck_io_num = MCK;
#endif #endif
const esp_err_t result = i2s_set_pin((i2s_port_t) m_i2s_num, &m_pin_config); const esp_err_t result = i2s_set_pin((i2s_port_t) m_i2s_num, &m_pin_config);
return (result == ESP_OK); return (result == ESP_OK);
} }

View File

@@ -213,7 +213,7 @@ void irBlink() {
} }
} }
void irNum(byte num) { void irNumber(uint8_t num) {
uint16_t s; uint16_t s;
if (display.numOfNextStation == 0 && num == 0) return; if (display.numOfNextStation == 0 && num == 0) return;
display.putRequest(NEWMODE, NUMBERS); display.putRequest(NEWMODE, NUMBERS);
@@ -292,43 +292,43 @@ void irLoop() {
break; break;
} }
case IR_0: { case IR_0: {
irNum(0); irNumber(0);
break; break;
} }
case IR_1: { case IR_1: {
irNum(1); irNumber(1);
break; break;
} }
case IR_2: { case IR_2: {
irNum(2); irNumber(2);
break; break;
} }
case IR_3: { case IR_3: {
irNum(3); irNumber(3);
break; break;
} }
case IR_4: { case IR_4: {
irNum(4); irNumber(4);
break; break;
} }
case IR_5: { case IR_5: {
irNum(5); irNumber(5);
break; break;
} }
case IR_6: { case IR_6: {
irNum(6); irNumber(6);
break; break;
} }
case IR_7: { case IR_7: {
irNum(7); irNumber(7);
break; break;
} }
case IR_8: { case IR_8: {
irNum(8); irNumber(8);
break; break;
} }
case IR_9: { case IR_9: {
irNum(9); irNumber(9);
break; break;
} }
case IR_AST: { case IR_AST: {

View File

@@ -25,7 +25,7 @@ void encoder1Loop();
void encoder2Loop(); void encoder2Loop();
void irLoop(); void irLoop();
//void touchLoop(); //void touchLoop();
void irNum(byte num); void irNumber(uint8_t num);
void irBlink(); void irBlink();
void controlsEvent(bool toRight, int8_t volDelta = 0); void controlsEvent(bool toRight, int8_t volDelta = 0);

View File

@@ -11,7 +11,7 @@
#define WIFI_ATTEMPTS 16 #define WIFI_ATTEMPTS 16
#endif #endif
Network network; MyNetwork network;
TaskHandle_t syncTaskHandle; TaskHandle_t syncTaskHandle;
//TaskHandle_t reconnectTaskHandle; //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; network.beginReconnect = false;
player.lockOutput = false; player.lockOutput = false;
delay(100); delay(100);
@@ -90,7 +90,7 @@ void Network::WiFiReconnected(WiFiEvent_t event, WiFiEventInfo_t info){
#endif #endif
} }
void Network::WiFiLostConnection(WiFiEvent_t event, WiFiEventInfo_t info){ void MyNetwork::WiFiLostConnection(WiFiEvent_t event, WiFiEventInfo_t info){
if(!network.beginReconnect){ if(!network.beginReconnect){
Serial.printf("Lost connection, reconnecting to %s...\n", config.ssids[config.store.lastSSID-1].ssid); Serial.printf("Lost connection, reconnecting to %s...\n", config.ssids[config.store.lastSSID-1].ssid);
if(config.getMode()==PM_SDCARD) { if(config.getMode()==PM_SDCARD) {
@@ -106,7 +106,7 @@ void Network::WiFiLostConnection(WiFiEvent_t event, WiFiEventInfo_t info){
WiFi.reconnect(); 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 ls = (config.store.lastSSID == 0 || config.store.lastSSID > config.ssidsCount) ? 0 : config.store.lastSSID - 1;
uint8_t startedls = ls; uint8_t startedls = ls;
uint8_t errcnt = 0; uint8_t errcnt = 0;
@@ -158,7 +158,7 @@ void searchWiFi(void * pvParameters){
#define DBGAP false #define DBGAP false
void Network::begin() { void MyNetwork::begin() {
BOOTLOG("network.begin"); BOOTLOG("network.begin");
config.initNetwork(); config.initNetwork();
ctimer.detach(); ctimer.detach();
@@ -193,7 +193,7 @@ void Network::begin() {
if (network_on_connect) network_on_connect(); if (network_on_connect) network_on_connect();
} }
void Network::setWifiParams(){ void MyNetwork::setWifiParams(){
WiFi.setSleep(false); WiFi.setSleep(false);
WiFi.onEvent(WiFiReconnected, WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_GOT_IP); WiFi.onEvent(WiFiReconnected, WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_GOT_IP);
WiFi.onEvent(WiFiLostConnection, WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_DISCONNECTED); 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) { if (withTelnetOutput) {
char timeStringBuff[50]; char timeStringBuff[50];
strftime(timeStringBuff, sizeof(timeStringBuff), "%Y-%m-%dT%H:%M:%S", &timeinfo); strftime(timeStringBuff, sizeof(timeStringBuff), "%Y-%m-%dT%H:%M:%S", &timeinfo);
@@ -226,7 +226,7 @@ void rebootTime() {
ESP.restart(); ESP.restart();
} }
void Network::raiseSoftAP() { void MyNetwork::raiseSoftAP() {
WiFi.mode(WIFI_AP); WiFi.mode(WIFI_AP);
WiFi.softAP(apSsid, apPassword); WiFi.softAP(apSsid, apPassword);
Serial.println("##[BOOT]#"); Serial.println("##[BOOT]#");
@@ -240,7 +240,7 @@ void Network::raiseSoftAP() {
rtimer.once(config.store.softapdelay*60, rebootTime); rtimer.once(config.store.softapdelay*60, rebootTime);
} }
void Network::requestWeatherSync(){ void MyNetwork::requestWeatherSync(){
display.putRequest(NEWWEATHER); display.putRequest(NEWWEATHER);
} }

View File

@@ -13,7 +13,7 @@
enum n_Status_e { CONNECTED, SOFT_AP, FAILED, SDREADY }; enum n_Status_e { CONNECTED, SOFT_AP, FAILED, SDREADY };
class Network { class MyNetwork {
public: public:
n_Status_e status; n_Status_e status;
struct tm timeinfo; struct tm timeinfo;
@@ -24,7 +24,7 @@ class Network {
char *weatherBuf; char *weatherBuf;
bool trueWeather; bool trueWeather;
public: public:
Network() {}; MyNetwork() {};
void begin(); void begin();
void requestTimeSync(bool withTelnetOutput=false, uint8_t clientId=0); void requestTimeSync(bool withTelnetOutput=false, uint8_t clientId=0);
void requestWeatherSync(); void requestWeatherSync();
@@ -37,7 +37,7 @@ class Network {
static void WiFiReconnected(WiFiEvent_t event, WiFiEventInfo_t info); static void WiFiReconnected(WiFiEvent_t event, WiFiEventInfo_t info);
}; };
extern Network network; extern MyNetwork network;
extern __attribute__((weak)) void network_on_connect(); extern __attribute__((weak)) void network_on_connect();

View File

@@ -1,7 +1,7 @@
#ifndef options_h #ifndef options_h
#define options_h #define options_h
#define YOVERSION "0.9.300" #define YOVERSION "0.9.313b"
/******************************************************* /*******************************************************
DO NOT EDIT THIS FILE. DO NOT EDIT THIS FILE.
@@ -258,10 +258,11 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti
#endif #endif
/* ESP DEVBOARD */ /* ESP DEVBOARD */
#ifndef LED_BUILTIN #ifndef ARDUINO_ESP32S3_DEV
#ifndef LED_BUILTIN
#define LED_BUILTIN 255 #define LED_BUILTIN 255
#endif
#endif #endif
/* Other settings. You can overwrite them in the myoptions.h file */ /* Other settings. You can overwrite them in the myoptions.h file */
#ifndef MUTE_PIN #ifndef MUTE_PIN
#define MUTE_PIN 255 // 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 #define L10N_LANGUAGE EN
#endif #endif
#ifndef VSPI
#define VSPI 3
#endif
#ifndef HSPI
#define HSPI 1
#endif
#endif #endif

View File

@@ -13,8 +13,8 @@
# error YOU MUST CHOOSE BETWEEN I2S DAC AND VS1053 BY DISABLING THE SECOND MODULE IN THE myoptions.h # error YOU MUST CHOOSE BETWEEN I2S DAC AND VS1053 BY DISABLING THE SECOND MODULE IN THE myoptions.h
#endif #endif
#ifndef ARDUINO_ESP32_DEV #if !(defined(ARDUINO_ESP32_DEV) || defined(ARDUINO_ESP32S3_DEV))
# error ONLY MODULES "ESP32 Dev Module" AND "ESP32 Wrover Module" ARE SUPPORTED. PLEASE SELECT ONE OF THEM IN THE MENU >> TOOLS >> BOARD # 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
#endif #endif