Compare commits
4 Commits
f17f9ddf7c
...
startup-so
| Author | SHA1 | Date | |
|---|---|---|---|
| b82f9f90a8 | |||
| 1d7b8fb492 | |||
| 3a88dcfc07 | |||
| 89af60bd22 |
4
.gitmodules
vendored
4
.gitmodules
vendored
@@ -2,9 +2,6 @@
|
|||||||
path = FW/leo_muziekdoos_esp32/lib/ESP8266Audio
|
path = FW/leo_muziekdoos_esp32/lib/ESP8266Audio
|
||||||
url = http://git.oldemans.nl/libs/ESP8266Audio.git
|
url = http://git.oldemans.nl/libs/ESP8266Audio.git
|
||||||
branch = master
|
branch = master
|
||||||
[submodule "FW/leo_muziekdoos_esp32/lib/littleFS_esp32"]
|
|
||||||
path = FW/leo_muziekdoos_esp32/lib/littleFS_esp32
|
|
||||||
url = http://git.oldemans.nl/libs/LittleFS_esp32
|
|
||||||
[submodule "FW/leo_muziekdoos_esp32/lib/JCButton"]
|
[submodule "FW/leo_muziekdoos_esp32/lib/JCButton"]
|
||||||
path = FW/leo_muziekdoos_esp32/lib/JCButton
|
path = FW/leo_muziekdoos_esp32/lib/JCButton
|
||||||
url = http://git.oldemans.nl/libs/JCButton.git
|
url = http://git.oldemans.nl/libs/JCButton.git
|
||||||
@@ -12,6 +9,7 @@
|
|||||||
[submodule "FW/leo_muziekdoos_esp32/lib/NDEF"]
|
[submodule "FW/leo_muziekdoos_esp32/lib/NDEF"]
|
||||||
path = FW/leo_muziekdoos_esp32/lib/NDEF
|
path = FW/leo_muziekdoos_esp32/lib/NDEF
|
||||||
url = http://git.oldemans.nl/libs/rfid.NDEF.git
|
url = http://git.oldemans.nl/libs/rfid.NDEF.git
|
||||||
|
branch = master
|
||||||
[submodule "FW/leo_muziekdoos_esp32/lib/PN532"]
|
[submodule "FW/leo_muziekdoos_esp32/lib/PN532"]
|
||||||
path = FW/leo_muziekdoos_esp32/lib/PN532
|
path = FW/leo_muziekdoos_esp32/lib/PN532
|
||||||
url = http://git.oldemans.nl/libs/rfid.PN532.git
|
url = http://git.oldemans.nl/libs/rfid.PN532.git
|
||||||
|
|||||||
BIN
FW/leo_muziekdoos_esp32/data/ping.mp3
Normal file
BIN
FW/leo_muziekdoos_esp32/data/ping.mp3
Normal file
Binary file not shown.
@@ -28,5 +28,6 @@
|
|||||||
"GameTimeout": 20000,
|
"GameTimeout": 20000,
|
||||||
"PowerTimeout": 30,
|
"PowerTimeout": 30,
|
||||||
"PowerOTADelay": 4000,
|
"PowerOTADelay": 4000,
|
||||||
"Brightness": 2
|
"Brightness": 2,
|
||||||
|
"ping": "/ping.mp3"
|
||||||
}
|
}
|
||||||
Submodule FW/leo_muziekdoos_esp32/lib/littleFS_esp32 deleted from c28cf47f61
@@ -22,12 +22,14 @@ lib_deps =
|
|||||||
fastled/FastLED@^3.5.0
|
fastled/FastLED@^3.5.0
|
||||||
#robtillaart/AS5600 @ ^0.3.4
|
#robtillaart/AS5600 @ ^0.3.4
|
||||||
robtillaart/AS5600 @ ^0.3.6
|
robtillaart/AS5600 @ ^0.3.6
|
||||||
|
LITTLEFS
|
||||||
build_src_filter = ${env.build_src_filter}
|
build_src_filter = ${env.build_src_filter}
|
||||||
lib_ldf_mode = deep+
|
lib_ldf_mode = deep+
|
||||||
build_flags =
|
build_flags =
|
||||||
-DHARDWARE=2
|
-DHARDWARE=2
|
||||||
-DCORE_DEBUG_LEVEL=3
|
-DCORE_DEBUG_LEVEL=3
|
||||||
-DNDEF_DEBUG=1
|
-DNDEF_DEBUG=1
|
||||||
|
-fexceptions
|
||||||
extra_scripts = ./littlefsbuilder.py
|
extra_scripts = ./littlefsbuilder.py
|
||||||
board_build.filesystem = littlefs
|
board_build.filesystem = littlefs
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "FS.h"
|
#include "FS.h"
|
||||||
#include "LITTLEFS.h"
|
#include <LittleFS.h>
|
||||||
#include "ArduinoJson.h"
|
#include "ArduinoJson.h"
|
||||||
|
|
||||||
const char *tagConfigfile = "/settings.json";
|
const char *tagConfigfile = "/settings.json";
|
||||||
@@ -77,7 +77,23 @@ float getFloatParam(String param, int def)
|
|||||||
}
|
}
|
||||||
if(!settingsDoc.containsKey(param))
|
if(!settingsDoc.containsKey(param))
|
||||||
{
|
{
|
||||||
log_e("param(%s)",param);
|
log_e("param(%s) not availavle",param);
|
||||||
|
return def;
|
||||||
|
}
|
||||||
|
return settingsDoc[param];
|
||||||
|
}
|
||||||
|
|
||||||
|
String getStringParam(String param, String def)
|
||||||
|
{
|
||||||
|
log_i("Get String param %s",param );
|
||||||
|
if( param == "")
|
||||||
|
{
|
||||||
|
log_e("No param(%s) given",param);
|
||||||
|
return def;
|
||||||
|
}
|
||||||
|
if(!settingsDoc.containsKey(param))
|
||||||
|
{
|
||||||
|
log_e("param(%s) not availavle",param);
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
return settingsDoc[param];
|
return settingsDoc[param];
|
||||||
@@ -86,7 +102,7 @@ float getFloatParam(String param, int def)
|
|||||||
void loadConfig(const char *fname)
|
void loadConfig(const char *fname)
|
||||||
{
|
{
|
||||||
log_i("config: load");
|
log_i("config: load");
|
||||||
File file = LITTLEFS.open(fname);
|
File file = LittleFS.open(fname);
|
||||||
|
|
||||||
DeserializationError error = deserializeJson(settingsDoc, file);
|
DeserializationError error = deserializeJson(settingsDoc, file);
|
||||||
if (error)
|
if (error)
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ bool getUIDvalid(String uid);
|
|||||||
String GetWifiPassword(String ssid);
|
String GetWifiPassword(String ssid);
|
||||||
int GetIntparam(String param, int def = -1);
|
int GetIntparam(String param, int def = -1);
|
||||||
float getFloatParam( String param, int def = -1);
|
float getFloatParam( String param, int def = -1);
|
||||||
|
String getStringParam(String param, String def = "error");
|
||||||
|
|
||||||
void initConfig(void);
|
void initConfig(void);
|
||||||
void handleConfig(void);
|
void handleConfig(void);
|
||||||
@@ -47,6 +47,10 @@ void loop()
|
|||||||
handleHallSensor();
|
handleHallSensor();
|
||||||
handleGame();
|
handleGame();
|
||||||
}
|
}
|
||||||
|
else if(getPowerState() == POWERSTATES::poweringOn2)
|
||||||
|
{
|
||||||
|
handleAudio();
|
||||||
|
}
|
||||||
else if (getPowerState() == POWERSTATES::overTheAir2)
|
else if (getPowerState() == POWERSTATES::overTheAir2)
|
||||||
{
|
{
|
||||||
handleOta();
|
handleOta();
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#include "ArduinoOTA.h"
|
#include "ArduinoOTA.h"
|
||||||
#include "JC_Button.h"
|
#include "JC_Button.h"
|
||||||
#include "LITTLEFS.h"
|
#include "LittleFS.h"
|
||||||
|
|
||||||
#define WIFICONNECTINTERVAL 1000
|
#define WIFICONNECTINTERVAL 1000
|
||||||
|
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ void handlePowerState(void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_i("Release for poweron, hold for %d to OTA", (POWERBUTTONOTADELAY - buttonPower.getPressedFor()));
|
log_i("Release for poweron, hold for %d to OTA", (POWERBUTTONOTADELAY - buttonPower.getPressedFor()));
|
||||||
|
playSong(getStringParam("ping"));
|
||||||
}
|
}
|
||||||
if (buttonPower.pressedFor(POWERBUTTONOTADELAY))
|
if (buttonPower.pressedFor(POWERBUTTONOTADELAY))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#define ESP_V2
|
#define ESP_V2
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#include <LITTLEFS.h>
|
#include <LittleFS.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_LITTLEFS_FOR_IDF_3_2
|
#ifndef CONFIG_LITTLEFS_FOR_IDF_3_2
|
||||||
@@ -92,12 +92,12 @@ void readFile(fs::FS &fs, const char *path)
|
|||||||
|
|
||||||
void initStorage()
|
void initStorage()
|
||||||
{
|
{
|
||||||
if (!LITTLEFS.begin(FORMAT_LITTLEFS_IF_FAILED))
|
if (!LittleFS.begin(FORMAT_LITTLEFS_IF_FAILED))
|
||||||
{
|
{
|
||||||
log_e("LITTLEFS Mount Failed");
|
log_e("LittleFS Mount Failed");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
listDir(LITTLEFS, "/", 0);
|
listDir(LittleFS, "/", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleStorage()
|
void handleStorage()
|
||||||
|
|||||||
Reference in New Issue
Block a user