fix issues wifi fallback
This commit is contained in:
@@ -16,7 +16,9 @@ lib_deps =
|
|||||||
#bblanchon/ArduinoJson@^6.18.5
|
#bblanchon/ArduinoJson@^6.18.5
|
||||||
bblanchon/ArduinoJson@^6.20.0
|
bblanchon/ArduinoJson@^6.20.0
|
||||||
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
|
||||||
|
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
lib_ldf_mode = deep+
|
lib_ldf_mode = deep+
|
||||||
extra_scripts = ./littlefsbuilder.py
|
extra_scripts = ./littlefsbuilder.py
|
||||||
@@ -24,5 +26,5 @@ build_flags =
|
|||||||
-DHARDWARE=2
|
-DHARDWARE=2
|
||||||
-DCORE_DEBUG_LEVEL=3
|
-DCORE_DEBUG_LEVEL=3
|
||||||
-DNDEF_DEBUG=1
|
-DNDEF_DEBUG=1
|
||||||
upload_protocol = espota
|
upload_protocol = esptool #espota
|
||||||
upload_port = muziekdoos.local
|
#upload_port = muziekdoos.local
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ void playSong(String filename)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_e("no filenae specified");
|
log_e("no filename specified");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,9 +9,9 @@
|
|||||||
|
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
|
|
||||||
#define AUDIOGAIN 0.5
|
#define AUDIOGAIN 0.7
|
||||||
#define AUDIONSONGS 3
|
//#define AUDIONSONGS 3
|
||||||
#define AUDIOREPEATS 3
|
//#define AUDIOREPEATS 3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,10 @@ bool OtaProcess_class::initialize(void)
|
|||||||
m_ssid = WiFi.SSID(i);
|
m_ssid = WiFi.SSID(i);
|
||||||
m_psk = tmppsk;
|
m_psk = tmppsk;
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
m_ssid = SECRET_SSID;
|
||||||
|
m_psk = SECRET_PASS;
|
||||||
|
}
|
||||||
log_i("[%d] %s %s (%d) [%s]", i, WiFi.SSID(i), (WiFi.encryptionType(i) == WIFI_AUTH_OPEN) ? " " : "*", WiFi.RSSI(i), (tmppsk != "")? "OK": "Not congigured");
|
log_i("[%d] %s %s (%d) [%s]", i, WiFi.SSID(i), (WiFi.encryptionType(i) == WIFI_AUTH_OPEN) ? " " : "*", WiFi.RSSI(i), (tmppsk != "")? "OK": "Not congigured");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,7 +116,7 @@ bool OtaProcess_class::initialize(void)
|
|||||||
.onEnd([]()
|
.onEnd([]()
|
||||||
{ log_i("End"); ota.m_otaState = otaDone; })
|
{ log_i("End"); ota.m_otaState = otaDone; })
|
||||||
.onProgress([](unsigned int progress, unsigned int total)
|
.onProgress([](unsigned int progress, unsigned int total)
|
||||||
{ log_i("Progress: %u%%\r", (progress / (total / 100))); ota.m_otaState = otaBusy; })
|
{ log_i("Progress: %u%%\r", (progress / (total / 100))); ota.m_otaState = otaBusy; PowerKeepAlive();})
|
||||||
.onError([](ota_error_t error)
|
.onError([](ota_error_t error)
|
||||||
{
|
{
|
||||||
log_e("Error[%u]: ", error);
|
log_e("Error[%u]: ", error);
|
||||||
@@ -130,7 +134,7 @@ bool OtaProcess_class::initialize(void)
|
|||||||
{
|
{
|
||||||
log_i("Otastate = initialize(start)");
|
log_i("Otastate = initialize(start)");
|
||||||
ArduinoOTA.begin();
|
ArduinoOTA.begin();
|
||||||
log_i("Ota ready, IPaddress:%s", WiFi.localIP());
|
log_i("Ota ready, IPaddress:%s", WiFi.localIP().toString());
|
||||||
m_otaState = otaInitDone;
|
m_otaState = otaInitDone;
|
||||||
setLedBlink(true);
|
setLedBlink(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ PN532_SPI pn532spi(SPI, NFC_SS, NFC_SCK, NFC_MISO, NFC_MOSI);
|
|||||||
NfcAdapter nfc = NfcAdapter(pn532spi);
|
NfcAdapter nfc = NfcAdapter(pn532spi);
|
||||||
|
|
||||||
uint32_t lastRFID = 0;
|
uint32_t lastRFID = 0;
|
||||||
|
uint32_t lastRFIDlog = 0;
|
||||||
|
|
||||||
String lastUid = "";
|
String lastUid = "";
|
||||||
|
|
||||||
@@ -23,10 +24,15 @@ void initRfid()
|
|||||||
void handleRfid()
|
void handleRfid()
|
||||||
{
|
{
|
||||||
uint32_t timeNow = millis();
|
uint32_t timeNow = millis();
|
||||||
if (lastRFID - timeNow > RFIDINTERVAL && RfidScanActive)
|
if (timeNow - lastRFID > RFIDINTERVAL && RfidScanActive)
|
||||||
|
{
|
||||||
|
if(timeNow - lastRFIDlog > RFIDLOGINTERVAL)
|
||||||
{
|
{
|
||||||
log_i("scanning");
|
log_i("scanning");
|
||||||
if (nfc.tagPresent(100))
|
lastRFIDlog = timeNow;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nfc.tagPresent(80))
|
||||||
{
|
{
|
||||||
NfcTag tag = nfc.read();
|
NfcTag tag = nfc.read();
|
||||||
lastUid = tag.getUidString();
|
lastUid = tag.getUidString();
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#define NDEF_SUPPORT_MIFARE_CLASSIC
|
#define NDEF_SUPPORT_MIFARE_CLASSIC
|
||||||
#define RFIDINTERVAL 800
|
#define RFIDINTERVAL 800
|
||||||
|
#define RFIDLOGINTERVAL 5000
|
||||||
|
|
||||||
void initRfid(void);
|
void initRfid(void);
|
||||||
void handleRfid(void);
|
void handleRfid(void);
|
||||||
|
|||||||
@@ -151,11 +151,10 @@ void handleHallSensor(void)
|
|||||||
{
|
{
|
||||||
uint32_t timeNow = millis();
|
uint32_t timeNow = millis();
|
||||||
|
|
||||||
if(getAudioState())
|
// if(!getAudioState())
|
||||||
{
|
// {
|
||||||
//if music is playing skip batt check
|
|
||||||
return;
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
if (timeNow - lastADS < ADSINTERVAL)
|
if (timeNow - lastADS < ADSINTERVAL)
|
||||||
{
|
{
|
||||||
@@ -170,7 +169,7 @@ void handleHallSensor(void)
|
|||||||
{
|
{
|
||||||
if(hall_is_Idle)
|
if(hall_is_Idle)
|
||||||
{
|
{
|
||||||
log_i("hall state changed (&i)", angle);
|
log_i("hall state changed to active(%i)", angle);
|
||||||
}
|
}
|
||||||
hall_is_Idle = false;
|
hall_is_Idle = false;
|
||||||
}
|
}
|
||||||
@@ -178,7 +177,7 @@ void handleHallSensor(void)
|
|||||||
{
|
{
|
||||||
if(!hall_is_Idle)
|
if(!hall_is_Idle)
|
||||||
{
|
{
|
||||||
log_i("hall state changed (&i)", angle);
|
log_i("hall state changed to idle (%i)", angle);
|
||||||
}
|
}
|
||||||
hall_is_Idle = true;
|
hall_is_Idle = true;
|
||||||
|
|
||||||
|
|||||||
@@ -1,85 +0,0 @@
|
|||||||
{
|
|
||||||
"cod": "200",
|
|
||||||
"message": 0,
|
|
||||||
"list": [
|
|
||||||
{
|
|
||||||
"dt": 1581498000,
|
|
||||||
"main": {
|
|
||||||
"temp": 3.23,
|
|
||||||
"feels_like": -3.63,
|
|
||||||
"temp_min": 3.23,
|
|
||||||
"temp_max": 4.62,
|
|
||||||
"pressure": 1014,
|
|
||||||
"sea_level": 1014,
|
|
||||||
"grnd_level": 1010,
|
|
||||||
"humidity": 58,
|
|
||||||
"temp_kf": -1.39
|
|
||||||
},
|
|
||||||
"weather": [
|
|
||||||
{
|
|
||||||
"id": 800,
|
|
||||||
"main": "Clear",
|
|
||||||
"description": "clear sky",
|
|
||||||
"icon": "01d"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"clouds": {
|
|
||||||
"all": 0
|
|
||||||
},
|
|
||||||
"wind": {
|
|
||||||
"speed": 6.19,
|
|
||||||
"deg": 266
|
|
||||||
},
|
|
||||||
"sys": {
|
|
||||||
"pod": "d"
|
|
||||||
},
|
|
||||||
"dt_txt": "2020-02-12 09:00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"dt": 1581508800,
|
|
||||||
"main": {
|
|
||||||
"temp": 6.09,
|
|
||||||
"feels_like": -1.07,
|
|
||||||
"temp_min": 6.09,
|
|
||||||
"temp_max": 7.13,
|
|
||||||
"pressure": 1015,
|
|
||||||
"sea_level": 1015,
|
|
||||||
"grnd_level": 1011,
|
|
||||||
"humidity": 48,
|
|
||||||
"temp_kf": -1.04
|
|
||||||
},
|
|
||||||
"weather": [
|
|
||||||
{
|
|
||||||
"id": 800,
|
|
||||||
"main": "Clear",
|
|
||||||
"description": "clear sky",
|
|
||||||
"icon": "01d"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"clouds": {
|
|
||||||
"all": 9
|
|
||||||
},
|
|
||||||
"wind": {
|
|
||||||
"speed": 6.64,
|
|
||||||
"deg": 268
|
|
||||||
},
|
|
||||||
"sys": {
|
|
||||||
"pod": "d"
|
|
||||||
},
|
|
||||||
"dt_txt": "2020-02-12 12:00:00"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"city": {
|
|
||||||
"id": 2643743,
|
|
||||||
"name": "London",
|
|
||||||
"coord": {
|
|
||||||
"lat": 51.5085,
|
|
||||||
"lon": -0.1257
|
|
||||||
},
|
|
||||||
"country": "GB",
|
|
||||||
"population": 1000000,
|
|
||||||
"timezone": 0,
|
|
||||||
"sunrise": 1581492085,
|
|
||||||
"sunset": 1581527294
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user