This commit is contained in:
e2002
2025-09-15 17:01:48 +03:00
parent fe6af54f94
commit 9a3bb03f82
15 changed files with 33 additions and 81 deletions

View File

@@ -235,6 +235,16 @@ Work is in progress...
---
## Version history
#### v0.9.720
- PR #211 https://github.com/e2002/yoradio/pull/211
- fix packets lost in HLS-TS
- fix stuttering if datatransfer is chunked
- split processWebStream/processWebFile
- fixed the error of connecting to the next access points from the list if the first one is unavailable
- fixed playback control errors from Home Assistant
- the DEF_SPI_FREQ parameter, intended for setting the user speed SPI of displays, has been removed from the settings (they work fine anyway)
- fixed an error connecting to the MQTT server during initial boot in SDCARD mode
#### v0.9.711
- fixed compilation error for LCD displays #210

View File

@@ -3147,7 +3147,7 @@ void Audio::processWebStream() {
if(InBuff.bufferFilled() > maxFrameSize) {f_tmr_1s = false; cnt_slow = 0; loopCnt = 0;}
if(f_tmr_1s){
cnt_slow ++;
if(cnt_slow > 50){cnt_slow = 0; AUDIO_INFO("slow stream, dropouts are possible");}
if(cnt_slow > 50){cnt_slow = 0; f_tmr_1s = false; AUDIO_INFO("slow stream, dropouts are possible");}
}
// if the buffer can't filled for several seconds try a new connection - - - - - - - - - - - - - - - - - - - - - - -
if(f_stream && !availableBytes){

View File

@@ -5,13 +5,13 @@
#include "mqtt.h"
#include "WiFi.h"
#include "player.h"
#include "commandhandler.h"
AsyncMqttClient mqttClient;
TimerHandle_t mqttReconnectTimer;
char topic[100], status[BUFLEN*2];
void connectToMqtt() {
//config.waitConnection();
mqttClient.connect();
}
@@ -82,20 +82,7 @@ void onMqttMessage(char* topic, char* payload, AsyncMqttClientMessageProperties
char buf[len+1];
strncpy(buf, payload, len);
buf[len]='\0';
if (strcmp(buf, "prev") == 0) { player.sendCommand({PR_PREV, 0}); return; }
if (strcmp(buf, "next") == 0) { player.sendCommand({PR_NEXT, 0}); return; }
if (strcmp(buf, "toggle") == 0) { player.sendCommand({PR_TOGGLE, 0}); return; }
if (strcmp(buf, "stop") == 0) { player.sendCommand({PR_STOP, 0}); return; }
if (strcmp(buf, "start") == 0 || strcmp(buf, "play") == 0) { player.sendCommand({PR_PLAY, config.lastStation()}); return; }
if (strcmp(buf, "boot") == 0 || strcmp(buf, "reboot") == 0) { ESP.restart(); return; }
if (strcmp(buf, "volm") == 0) {
player.stepVol(false);
return;
}
if (strcmp(buf, "volp") == 0) {
player.stepVol(true);
return;
}
if(cmd.exec(buf, "")) return;
if (strcmp(buf, "turnoff") == 0) {
uint8_t sst = config.store.smartstart;
config.setDspOn(0);

View File

@@ -58,25 +58,16 @@ 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;
WiFi.mode(WIFI_STA);
/*
char buf[MDNS_LENGTH];
WiFi.config(INADDR_NONE, INADDR_NONE, INADDR_NONE, INADDR_NONE);
if(strlen(config.store.mdnsname)>0){
WiFi.setHostname(config.store.mdnsname);
}else{
snprintf(buf, MDNS_LENGTH, "yoradio-%x", config.getChipId());
WiFi.setHostname(buf);
}
*/
//WiFi.mode(WIFI_STA);
while (true) {
if(!silent){
Serial.printf("##[BOOT]#\tAttempt to connect to %s\n", config.ssids[ls].ssid);
Serial.print("##[BOOT]#\t");
display.putRequest(BOOTSTRING, ls);
}
WiFi.disconnect(true, true); //disconnect & erase internal credentials https://github.com/e2002/yoradio/pull/164/commits/89d8b4450dde99cd7930b84bb14d81dab920b879
delay(100);
//WiFi.disconnect(true, true); //disconnect & erase internal credentials https://github.com/e2002/yoradio/pull/164/commits/89d8b4450dde99cd7930b84bb14d81dab920b879
//delay(100);
WiFi.mode(WIFI_STA);
WiFi.begin(config.ssids[ls].ssid, config.ssids[ls].password);
while (WiFi.status() != WL_CONNECTED) {
if(!silent) Serial.print(".");
@@ -88,6 +79,7 @@ bool MyNetwork::wifiBegin(bool silent){
ls++;
if (ls > config.ssidsCount - 1) ls = 0;
if(!silent) Serial.println();
WiFi.mode(WIFI_OFF);
break;
}
}
@@ -112,6 +104,9 @@ void searchWiFi(void * pvParameters){
telnet.begin(true);
network.setWifiParams();
display.putRequest(NEWIP, 0);
#ifdef MQTT_ROOT_TOPIC
mqttInit();
#endif
}
vTaskDelete( NULL );
}
@@ -134,6 +129,9 @@ void MyNetwork::begin() {
Serial.println(".");
status = CONNECTED;
setWifiParams();
#ifdef MQTT_ROOT_TOPIC
mqttInit();
#endif
}else{
status = SDREADY;
xTaskCreatePinnedToCore(searchWiFi, "searchWiFi", 1024 * 4, NULL, 0, NULL, SEARCH_WIFI_CORE_ID);

View File

@@ -2,7 +2,7 @@
#define options_h
#pragma once
#define YOVERSION "0.9.711"
#define YOVERSION "0.9.720"
/*******************************************************
DO NOT EDIT THIS FILE.

View File

@@ -3,10 +3,6 @@
#include "dspcore.h"
#include "../core/config.h"
#ifndef DEF_SPI_FREQ
#define DEF_SPI_FREQ 24000000 /* set it to 0 for system default */
#endif
#if DSP_HSPI
DspCore::DspCore(): Adafruit_GC9106Ex(&SPI2, TFT_DC, TFT_CS, TFT_RST) {}
#else
@@ -14,7 +10,7 @@ DspCore::DspCore(): Adafruit_GC9106Ex(TFT_CS, TFT_DC, TFT_RST) {}
#endif
void DspCore::initDisplay() {
begin(DEF_SPI_FREQ);
begin();
cp437(true);
invert();
flip();

View File

@@ -3,10 +3,6 @@
#include "dspcore.h"
#include "../core/config.h"
#ifndef DEF_SPI_FREQ
#define DEF_SPI_FREQ 40000000UL /* set it to 0 for system default */
#endif
#if DSP_HSPI
DspCore::DspCore(): Adafruit_GC9A01A(&SPI2, TFT_CS, TFT_DC, TFT_RST) {}
#else
@@ -15,7 +11,6 @@ DspCore::DspCore(): Adafruit_GC9A01A(TFT_CS, TFT_DC, TFT_RST) {}
void DspCore::initDisplay() {
begin();
if(DEF_SPI_FREQ > 0) setSPISpeed(DEF_SPI_FREQ);
invert();
cp437(true);
flip();

View File

@@ -3,10 +3,6 @@
#include "dspcore.h"
#include "../core/config.h"
#ifndef DEF_SPI_FREQ
#define DEF_SPI_FREQ 40000000UL /* set it to 0 for system default */
#endif
#if DSP_HSPI
DspCore::DspCore(): ILI9486_SPI(&SPI2, TFT_CS, TFT_DC, TFT_RST) {}
#else
@@ -16,7 +12,6 @@
void DspCore::initDisplay() {
setSpiKludge(false);
init();
//if(DEF_SPI_FREQ > 0) setSPISpeed(DEF_SPI_FREQ);
cp437(true);
setTextWrap(false);
setTextSize(1);

View File

@@ -7,15 +7,11 @@
#define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32 or scan it https://create.arduino.cc/projecthub/abdularbi17/how-to-scan-i2c-address-in-arduino-eaadda
#endif
#ifndef DEF_SPI_FREQ
#define DEF_SPI_FREQ 8000000UL /* set it to 0 for system default */
#endif
#if DSP_MODEL==DSP_SSD1305
#if DSP_HSPI
DspCore::DspCore(): Adafruit_SSD1305(128, 64, &SPI2, TFT_DC, TFT_RST, TFT_CS, DEF_SPI_FREQ) {}
DspCore::DspCore(): Adafruit_SSD1305(128, 64, &SPI2, TFT_DC, TFT_RST, TFT_CS) {}
#else
DspCore::DspCore(): Adafruit_SSD1305(128, 64, &SPI, TFT_DC, TFT_RST, TFT_CS, DEF_SPI_FREQ) {}
DspCore::DspCore(): Adafruit_SSD1305(128, 64, &SPI, TFT_DC, TFT_RST, TFT_CS) {}
#endif
#else
#include <Wire.h>

View File

@@ -3,17 +3,14 @@
#include "dspcore.h"
#include "../core/config.h"
#ifndef DEF_SPI_FREQ
#define DEF_SPI_FREQ 16000000UL /* set it to 0 for system default */
#endif
#ifndef SSD1322_GRAYSCALE
#define SSD1322_GRAYSCALE false
#endif
#if DSP_HSPI
DspCore::DspCore(): Jamis_SSD1322(256, 64, &SPI2, TFT_DC, TFT_RST, TFT_CS, DEF_SPI_FREQ) {}
DspCore::DspCore(): Jamis_SSD1322(256, 64, &SPI2, TFT_DC, TFT_RST, TFT_CS) {}
#else
DspCore::DspCore(): Jamis_SSD1322(256, 64, &SPI, TFT_DC, TFT_RST, TFT_CS, DEF_SPI_FREQ) {}
DspCore::DspCore(): Jamis_SSD1322(256, 64, &SPI, TFT_DC, TFT_RST, TFT_CS) {}
#endif
void DspCore::initDisplay() {

View File

@@ -3,10 +3,6 @@
#include "dspcore.h"
#include "../core/config.h"
#ifndef DEF_SPI_FREQ
#define DEF_SPI_FREQ 0 //26000000UL /* set it to 0 for system default */
#endif
#if DSP_HSPI
DspCore::DspCore(): Adafruit_ST7735(&SPI2, TFT_CS, TFT_DC, TFT_RST) {}
#else
@@ -15,7 +11,6 @@ DspCore::DspCore(): Adafruit_ST7735(&SPI, TFT_CS, TFT_DC, TFT_RST) {}
void DspCore::initDisplay() {
initR(DTYPE);
if(DEF_SPI_FREQ > 0) setSPISpeed(DEF_SPI_FREQ);
cp437(true);
invert();
flip();

View File

@@ -3,10 +3,6 @@
#include "dspcore.h"
#include "../core/config.h"
#ifndef DEF_SPI_FREQ
#define DEF_SPI_FREQ 40000000UL /* set it to 0 for system default */
#endif
#if DSP_HSPI
DspCore::DspCore(): Adafruit_ST7789(&SPI2, TFT_CS, TFT_DC, TFT_RST) {}
#else
@@ -21,7 +17,6 @@ void DspCore::initDisplay() {
}else{
init(240,(DSP_MODEL==DSP_ST7789)?320:240);
}
if(DEF_SPI_FREQ > 0) setSPISpeed(DEF_SPI_FREQ);
invert();
cp437(true);
flip();

View File

@@ -3,10 +3,6 @@
#include "dspcore.h"
#include "../core/config.h"
#ifndef DEF_SPI_FREQ
#define DEF_SPI_FREQ 40000000UL /* set it to 0 for system default */
#endif
#if DSP_HSPI
DspCore::DspCore(): Adafruit_ST7796S_kbv(&SPI2, TFT_DC, TFT_CS, TFT_RST) {}
#else
@@ -15,7 +11,6 @@ DspCore::DspCore(): Adafruit_ST7796S_kbv(TFT_CS, TFT_DC, TFT_RST) {}
void DspCore::initDisplay() {
begin();
if(DEF_SPI_FREQ > 0) setSPISpeed(DEF_SPI_FREQ);
invert();
cp437(true);
flip();

View File

@@ -3,14 +3,10 @@
#include "dspcore.h"
#include "../core/config.h"
#ifndef DEF_SPI_FREQ
#define DEF_SPI_FREQ 8000000UL
#endif
#if DSP_HSPI
DspCore::DspCore(): ST7920(&SPI2, TFT_CS, DEF_SPI_FREQ) {}
DspCore::DspCore(): ST7920(&SPI2, TFT_CS) {}
#else
DspCore::DspCore(): ST7920(&SPI, TFT_CS, DEF_SPI_FREQ) {}
DspCore::DspCore(): ST7920(&SPI, TFT_CS) {}
#endif
void DspCore::initDisplay() {

View File

@@ -8,7 +8,7 @@
#include "core/network.h"
#include "core/netserver.h"
#include "core/controls.h"
#include "core/mqtt.h"
//#include "core/mqtt.h"
#include "core/optionschecker.h"
#include "core/timekeeper.h"
#ifdef USE_NEXTION
@@ -94,9 +94,6 @@ void setup() {
initControls();
display.putRequest(DSP_START);
while(!display.ready()) delay(10);
#ifdef MQTT_ROOT_TOPIC
mqttInit();
#endif
#if USE_OTA
setupOTA();
#endif