Kleine Verbesserungen.
This commit is contained in:
parent
fa208858d9
commit
dcca828197
@ -13,7 +13,7 @@ default_envs = esp32
|
|||||||
|
|
||||||
[extra]
|
[extra]
|
||||||
lib_deps =
|
lib_deps =
|
||||||
63 ; MFRC522
|
63 @ 1.4.5 ; MFRC522
|
||||||
https://github.com/me-no-dev/ESPAsyncWebServer.git
|
https://github.com/me-no-dev/ESPAsyncWebServer.git
|
||||||
ArduinoJSON
|
ArduinoJSON
|
||||||
6691 ; TinyXML
|
6691 ; TinyXML
|
||||||
@ -22,10 +22,10 @@ lib_deps =
|
|||||||
platform = espressif32
|
platform = espressif32
|
||||||
board = esp-wrover-kit
|
board = esp-wrover-kit
|
||||||
framework = arduino
|
framework = arduino
|
||||||
upload_speed = 512000
|
upload_speed = 115200
|
||||||
build_flags=!./build_version.sh
|
build_flags=!./build_version.sh
|
||||||
lib_deps = ${extra.lib_deps}
|
lib_deps = ${extra.lib_deps}
|
||||||
upload_port = /dev/cu.SLAB_USBtoUART
|
;upload_port = 10.10.2.108 ; /dev/cu.SLAB_USBtoUART
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
board_build.embed_txtfiles = src/index.html
|
board_build.embed_txtfiles = src/index.html
|
||||||
;board_build.partitions = partitions.csv
|
;board_build.partitions = partitions.csv
|
||||||
|
21
src/main.cpp
21
src/main.cpp
@ -1,4 +1,5 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
#include <ArduinoOTA.h>
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
#include <SD.h>
|
#include <SD.h>
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
@ -55,7 +56,8 @@ void wifi_connect() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (wifi.run() == WL_CONNECTED) {
|
if (wifi.run() == WL_CONNECTED) {
|
||||||
DEBUG("Connected to WiFi \"%s\".\n", WiFi.SSID().c_str());
|
INFO("Connected to WiFi \"%s\".\n", WiFi.SSID().c_str());
|
||||||
|
INFO("Local IP address: %s\n", WiFi.localIP().toString().c_str());
|
||||||
} else {
|
} else {
|
||||||
DEBUG("No WiFi connection!\n");
|
DEBUG("No WiFi connection!\n");
|
||||||
}
|
}
|
||||||
@ -77,13 +79,13 @@ void setup() {
|
|||||||
prefs.begin("esmp3");
|
prefs.begin("esmp3");
|
||||||
debug_enabled = prefs.getBool("debug_enabled", true);
|
debug_enabled = prefs.getBool("debug_enabled", true);
|
||||||
trace_enabled = prefs.getBool("trace_enabled", false);
|
trace_enabled = prefs.getBool("trace_enabled", false);
|
||||||
|
delay(1000);
|
||||||
|
PIN_SPEAKER_L_SETUP();delay(1000);
|
||||||
|
PIN_SPEAKER_R_SETUP();delay(1000);
|
||||||
|
PIN_SPEAKER_L(LOW);delay(1000);
|
||||||
|
PIN_SPEAKER_R(LOW);delay(1000);
|
||||||
|
|
||||||
PIN_SPEAKER_L_SETUP();
|
DEBUG("Setting up SPI...\n");delay(1000);
|
||||||
PIN_SPEAKER_R_SETUP();
|
|
||||||
PIN_SPEAKER_L(LOW);
|
|
||||||
PIN_SPEAKER_R(LOW);
|
|
||||||
|
|
||||||
DEBUG("Setting up SPI...\n");
|
|
||||||
SPI.begin();
|
SPI.begin();
|
||||||
SPI.setHwCs(false);
|
SPI.setHwCs(false);
|
||||||
SPIMaster::init();
|
SPIMaster::init();
|
||||||
@ -92,7 +94,7 @@ void setup() {
|
|||||||
|
|
||||||
DEBUG("Setting up SD card...\n");
|
DEBUG("Setting up SD card...\n");
|
||||||
spi->select_sd();
|
spi->select_sd();
|
||||||
if (SD.begin(42, SPI, 25000000)) {
|
if (SD.begin(14, SPI, 25000000)) {
|
||||||
INFO("SD card initialized.\n");
|
INFO("SD card initialized.\n");
|
||||||
} else {
|
} else {
|
||||||
ERROR("Could not initialize SD card.\n");
|
ERROR("Could not initialize SD card.\n");
|
||||||
@ -109,6 +111,8 @@ void setup() {
|
|||||||
|
|
||||||
wifi_connect();
|
wifi_connect();
|
||||||
|
|
||||||
|
ArduinoOTA.begin();
|
||||||
|
|
||||||
MDNS.begin("esmp3");
|
MDNS.begin("esmp3");
|
||||||
|
|
||||||
DEBUG("Setting up HTTP server...\n");
|
DEBUG("Setting up HTTP server...\n");
|
||||||
@ -141,4 +145,5 @@ void loop() {
|
|||||||
if (more_data_needed) return;
|
if (more_data_needed) return;
|
||||||
|
|
||||||
controller->loop();
|
controller->loop();
|
||||||
|
ArduinoOTA.handle();
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <ArduinoJson.h>
|
#include <ArduinoJson.h>
|
||||||
#include <TinyXML.h>
|
#include <TinyXML.h>
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
Playlist::Playlist(String path) {
|
Playlist::Playlist(String path) {
|
||||||
_path = path;
|
_path = path;
|
||||||
|
@ -13,6 +13,7 @@ void PlaylistManager::scan_files() {
|
|||||||
File root = SD.open("/");
|
File root = SD.open("/");
|
||||||
File entry;
|
File entry;
|
||||||
while (entry = root.openNextFile()) {
|
while (entry = root.openNextFile()) {
|
||||||
|
Serial.println(entry.name());
|
||||||
String foldername = entry.name();
|
String foldername = entry.name();
|
||||||
if (foldername.startsWith("/.")) continue;
|
if (foldername.startsWith("/.")) continue;
|
||||||
foldername.remove(foldername.length());
|
foldername.remove(foldername.length());
|
||||||
|
Loading…
Reference in New Issue
Block a user