From 990af6cd94a44cf030edfa484c53d3af82f0e82d Mon Sep 17 00:00:00 2001 From: Pirata Date: Fri, 31 May 2024 18:01:35 -0300 Subject: [PATCH 1/2] Comments --- README.md | 1 - src/main.cpp | 22 +++++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 171dd748d..c8f9c074d 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,6 @@ For more information on each function supported by Bruce, [read our wiki here](h ## RFID - [x] Read and Write -- [ ] Replay ? ## Others - [x] TV-B-Gone diff --git a/src/main.cpp b/src/main.cpp index 562ffa2a6..d4b3265a0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -204,8 +204,8 @@ void loop() { options.push_back({"Raw Sniffer", [=]() { sniffer_setup(); }}); options.push_back({"DPWO-ESP32", [=]() { dpwo_setup(); }}); options.push_back({"Evil Portal", [=]() { startEvilPortal(); }}); - options.push_back({"Scan Hosts", [=]() { local_scan_setup(); }}); - options.push_back({"Wireguard", [=]() { wg_setup(); }}); + options.push_back({"Scan Hosts", [=]() { local_scan_setup(); }}); + options.push_back({"Wireguard", [=]() { wg_setup(); }}); options.push_back({"Main Menu", [=]() { backToMenu(); }}); delay(200); loopOptions(options,false,true,"WiFi"); @@ -225,8 +225,8 @@ void loop() { break; case 2: // RF options = { - {"Scan/copy", [=]() { displayRedStripe("Scan/Copy"); }}, - {"Replay", [=]() { displayRedStripe("Replay"); }}, + //{"Scan/copy", [=]() { displayRedStripe("Scan/Copy"); }}, + //{"Replay", [=]() { displayRedStripe("Replay"); }}, {"Spectrum", [=]() { rf_spectrum(); }}, //@IncursioHack {"Main Menu", [=]() { backToMenu(); }}, }; @@ -236,9 +236,9 @@ void loop() { break; case 3: // RFID options = { - {"Scan/copy", [=]() { rfid_setup(); }}, //@IncursioHack + {"Copy/Write", [=]() { rfid_setup(); }}, //@IncursioHack //{"Replay", [=]() { displayRedStripe("Replay"); }}, - {"Main Menu", [=]() { backToMenu(); }}, + {"Main Menu", [=]() { backToMenu(); }}, }; delay(200); loopOptions(options,false,true,"RFID"); @@ -246,9 +246,9 @@ void loop() { case 4: //Other options = { {"TV-B-Gone", [=]() { StartTvBGone(); }}, - {"Custom IR", [=]() { otherIRcodes(); }}, + {"Custom IR", [=]() { otherIRcodes(); }}, {"SD Card", [=]() { loopSD(SD); }}, - {"LittleFS", [=]() { loopSD(LittleFS); }}, + {"LittleFS", [=]() { loopSD(LittleFS); }}, {"WebUI", [=]() { loopOptionsWebUi(); }}, {"Megalodon", [=]() { shark_setup(); }}, }; @@ -256,8 +256,8 @@ void loop() { options.push_back({"BadUSB", [=]() { usb_setup(); }}); options.push_back({"LED Control", [=]() { ledrgb_setup(); }}); //IncursioHack options.push_back({"LED FLash", [=]() { ledrgb_flash(); }}); // IncursioHack - #endif options.push_back({"Openhaystack", [=]() { openhaystack_setup(); }}); + #endif options.push_back({"Main Menu", [=]() { backToMenu(); }}); delay(200); loopOptions(options,false,true,"Others"); @@ -265,10 +265,10 @@ void loop() { case 5: //Config options = { {"Brightness", [=]() { setBrightnessMenu(); }}, //settings.h - {"Clock", [=]() { setClock(); }}, + //{"Clock", [=]() { setClock(); }}, {"Orientation", [=]() { gsetRotation(true); }}, //settings.h - {"Main Menu", [=]() { backToMenu(); }}, {"Restart", [=]() { ESP.restart(); }}, + {"Main Menu", [=]() { backToMenu(); }}, }; delay(200); loopOptions(options,false,true,"Config"); From b92b5a89ae1747cb51e4796b92157919a541d03c Mon Sep 17 00:00:00 2001 From: Pirata Date: Sat, 1 Jun 2024 15:47:45 -0300 Subject: [PATCH 2/2] Clock ## Clock Added clock after connect to Wifi or manually set in options.. it doesn't save in the hardware RTC.. will be added in the next updates. --- .vscode/settings.json | 47 +++++++++++- platformio.ini | 106 +------------------------- src/display.cpp | 2 +- src/globals.cpp | 5 ++ src/globals.h | 12 ++- src/main.cpp | 17 ++++- src/settings.cpp | 173 +++++++++++++++++++++++++++++++++--------- src/settings.h | 3 +- src/wg.cpp | 1 - src/wg.h | 1 + src/wifi_common.cpp | 22 +++++- src/wifi_common.h | 3 +- 12 files changed, 242 insertions(+), 150 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index d30ca8f6a..cedeea77c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,6 +2,51 @@ "idf.portWin": "COM4", "files.associations": { "iosfwd": "cpp", - "iostream": "cpp" + "iostream": "cpp", + "array": "cpp", + "atomic": "cpp", + "*.tcc": "cpp", + "cctype": "cpp", + "clocale": "cpp", + "cmath": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdint": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "deque": "cpp", + "unordered_map": "cpp", + "vector": "cpp", + "exception": "cpp", + "algorithm": "cpp", + "functional": "cpp", + "iterator": "cpp", + "map": "cpp", + "memory": "cpp", + "memory_resource": "cpp", + "numeric": "cpp", + "optional": "cpp", + "random": "cpp", + "set": "cpp", + "string": "cpp", + "string_view": "cpp", + "system_error": "cpp", + "tuple": "cpp", + "type_traits": "cpp", + "utility": "cpp", + "fstream": "cpp", + "initializer_list": "cpp", + "istream": "cpp", + "limits": "cpp", + "new": "cpp", + "ostream": "cpp", + "sstream": "cpp", + "stdexcept": "cpp", + "streambuf": "cpp", + "cinttypes": "cpp", + "typeinfo": "cpp" } } \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index d2fecd74c..6d847ba0f 100644 --- a/platformio.ini +++ b/platformio.ini @@ -13,11 +13,10 @@ default_envs = m5stack-cplus1_1 m5stack-cplus2 m5stack-cardputer - ;m5stack-c [common] build_flags = - -DBRUCE_VERSION='"1.0b"' + -DBRUCE_VERSION='"1.0"' -DMAXFILES=256 -DEEPROMSIZE=64 -DLH=8 @@ -31,6 +30,7 @@ lib_deps = https://github.com/bmorcelli/ESPping/ NTPClient Timezone + ESP32Time [env:m5stack-cplus2] @@ -225,105 +225,3 @@ build_flags = lib_deps = ${common.lib_deps} xylopyrographer/LiteLED@^1.2.0 - -[env:m5stack-c] -platform = espressif32 -board = m5stick-c -framework = arduino -board_build.partitions = custom_4Mb.csv -build_flags = - ${common.build_flags} - -DSTICK_C=1 - -DSTICK_C_PLUS=1 - - -DROTATION=3 - -DHAS_BTN=1 - -DSEL_BTN=37 - -DUP_BTN=0 - -DDW_BTN=39 - -DBTN_ALIAS='"M5"' - - -DWIDTH=160 - -DHEIGHT=80 - -DMAX_MENU_SIZE=5 - -DTFT_WIDTH=80 - -DTFT_HEIGHT=160 - - -DLED=10 - -DLED_ON=LOW - -DLED_OFF=HIGH - - - -DFP=1 - -DFM=1 - -DFG=2 - - -DSDCARD_SPI_BUS=HSPI - -DSDCARD_CS=14 - -DSDCARD_SCK=0 - -DSDCARD_MISO=36 - -DSDCARD_MOSI=26 - - -DGROVE_SDA=32 - -DGROVE_SCL=33 -lib_deps = - ${common.lib_deps} - -[env:m5stack-c-test] -platform = espressif32 -board = m5stack-stamps3 -framework = arduino -board_build.partitions = custom_8Mb.csv -build_flags = - ${common.build_flags} - -DSTICK_C=1 - -DCARDPUTER=1 - -DROTATION=1 - -DHAS_BTN=1 - -DMAX_SPIFFS=0x100000 - -DMAX_APP=0x4F0000 - -DBTN_ALIAS='"G0"' - -DBTN_PIN=0 - -DHAS_SCREEN=1 - - -DWIDTH=160 - -DHEIGHT=80 - -DFP=1 - -DFM=1 - -DFG=3 - -DBAT_PIN=10 - -DLED=21 - -DLED_ON=HIGH - -DLED_OFF=LOW - -DBACKLIGHT=38 - -DMINBRIGHT=160 - -DMAX_MENU_SIZE=5 - -DUSER_SETUP_LOADED=1 - -DST7789_2_DRIVER=1 - -DTFT_RGB_ORDER=1 - -DTFT_WIDTH=135 - -DTFT_HEIGHT=240 - -DTFT_BACKLIGHT_ON=1 - -DTFT_BL=38 - -DTFT_RST=33 - -DTFT_DC=34 - -DTFT_MOSI=35 - -DTFT_SCLK=36 - -DTFT_CS=37 - -DTOUCH_CS=-1 - -DLOAD_GFXFF=1 - -DSMOOTH_FONT=1 - -DSPI_FREQUENCY=20000000 - -DSPI_READ_FREQUENCY=20000000 - -DSPI_TOUCH_FREQUENCY=2500000 - - -DSDCARD_SPI_BUS=FSPI - -DSDCARD_CS=12 - -DSDCARD_SCK=40 - -DSDCARD_MISO=39 - -DSDCARD_MOSI=14 - - -DGROVE_SDA=32 - -DGROVE_SCL=33 -lib_deps = - ${common.lib_deps} diff --git a/src/display.cpp b/src/display.cpp index 5c9384289..476b244d3 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -230,7 +230,7 @@ void drawMainBorder() { tft.fillScreen(BGCOLOR); setTftDisplay(12, 12, FGCOLOR, 1, BGCOLOR); - if(wifiConnected) {tft.print("timeStr");} else {tft.print("BRUCE 1.0b");} + // if(wifiConnected) {tft.print(timeStr);} else {tft.print("BRUCE 1.0b");} int i=0; if(wifiConnected) { drawWifiSmall(WIDTH - 90, 7); i++;} //Draw Wifi Symbol beside battery diff --git a/src/globals.cpp b/src/globals.cpp index 1a0ee4ae7..c6cc99b8b 100644 --- a/src/globals.cpp +++ b/src/globals.cpp @@ -24,3 +24,8 @@ while(1) { void backToMenu() { returnToMenu=true; } + +void updateTimeStr(struct tm timeInfo) { + // Atualiza timeStr com a hora e minuto + snprintf(timeStr, sizeof(timeStr), "%02d:%02d", timeInfo.tm_hour, timeInfo.tm_min); +} \ No newline at end of file diff --git a/src/globals.h b/src/globals.h index 65ef5c733..90c9de5a0 100644 --- a/src/globals.h +++ b/src/globals.h @@ -10,7 +10,9 @@ #include //#include #include - +#include +#include +#include #if defined (STICK_C_PLUS) || defined (STICK_C) #include @@ -29,6 +31,13 @@ extern TFT_eSprite draw; extern char timeStr[10]; +extern bool clock_set; +extern time_t localTime; +extern struct tm* timeInfo; +extern ESP32Time rtc; +extern NTPClient timeClient; +extern Timezone myTZ; + extern int prog_handler; // 0 - Flash, 1 - LittleFS, 2 - Download extern bool sdcardMounted; // informa se o cartão está montado ou não, sem precisar chamar a função setupSdCard @@ -55,3 +64,4 @@ extern bool returnToMenu; // variável para verificação e quebrar os loops void backToMenu(); +void updateTimeStr(struct tm timeInfo); diff --git a/src/main.cpp b/src/main.cpp index d4b3265a0..e56bbb233 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,6 +15,10 @@ bool wifiConnected; bool BLEConnected; bool returnToMenu; char timeStr[10]; +time_t localTime; +struct tm* timeInfo; +ESP32Time rtc; +bool clock_set = false; String ssid; String pwd; @@ -202,7 +206,7 @@ void loop() { options.push_back({"TelNET", [=]() { telnet_setup(); }}); options.push_back({"SSH", [=]() { ssh_setup(); }}); options.push_back({"Raw Sniffer", [=]() { sniffer_setup(); }}); - options.push_back({"DPWO-ESP32", [=]() { dpwo_setup(); }}); + options.push_back({"DPWO", [=]() { dpwo_setup(); }}); options.push_back({"Evil Portal", [=]() { startEvilPortal(); }}); options.push_back({"Scan Hosts", [=]() { local_scan_setup(); }}); options.push_back({"Wireguard", [=]() { wg_setup(); }}); @@ -265,7 +269,7 @@ void loop() { case 5: //Config options = { {"Brightness", [=]() { setBrightnessMenu(); }}, //settings.h - //{"Clock", [=]() { setClock(); }}, + {"Clock", [=]() { setClock(); }}, {"Orientation", [=]() { gsetRotation(true); }}, //settings.h {"Restart", [=]() { ESP.restart(); }}, {"Main Menu", [=]() { backToMenu(); }}, @@ -277,6 +281,15 @@ void loop() { } redraw=true; } + if(clock_set) { + updateTimeStr(rtc.getTimeStruct()); + setTftDisplay(12, 12, FGCOLOR, 1, BGCOLOR); + tft.print(timeStr); + } + else{ + setTftDisplay(12, 12, FGCOLOR, 1, BGCOLOR); + tft.print("BRUCE " + String(BRUCE_VERSION)); + } } } diff --git a/src/settings.cpp b/src/settings.cpp index 71f0fd030..26d2c2e22 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -3,9 +3,6 @@ #include "display.h" // calling loopOptions(options, true); #include "wifi_common.h" #include "mykeyboard.h" -#include -#include -#include @@ -121,48 +118,156 @@ NTPClient timeClient(ntpUDP, ntpServer, selectedTimezone, daylightOffset_sec); void setClock() { - - if(!wifiConnected) wifiConnectMenu(); - + bool auto_mode=true; options = { - {"Brasilia", [=]() { timeClient.setTimeOffset(-3 * 3600); }}, - {"Pernambuco", [=]() { timeClient.setTimeOffset(-2 * 3600); }}, - {"New York", [=]() { timeClient.setTimeOffset(-4 * 3600); }}, - {"Lisbon", [=]() { timeClient.setTimeOffset(1 * 3600); }}, - {"Hong Kong", [=]() { timeClient.setTimeOffset(8 * 3600); }}, - {"Sydney", [=]() { timeClient.setTimeOffset(10 * 3600); }}, - {"Tokyo", [=]() { timeClient.setTimeOffset(9 * 3600); }}, - {"Moscow", [=]() { timeClient.setTimeOffset(3 * 3600); }}, - {"Amsterdan", [=]() { timeClient.setTimeOffset(2 * 3600); }}, + {"NTP adjust", [&]() { auto_mode=true; }}, + {"Manually set", [&]() { auto_mode=false; }}, }; - delay(200); loopOptions(options); delay(200); - timeClient.begin(); + if (auto_mode) { + if(!wifiConnected) wifiConnectMenu(); + int tmz; + + options = { + {"Brasilia", [&]() { timeClient.setTimeOffset(-3 * 3600); tmz=0; }}, + {"Pernambuco",[&]() { timeClient.setTimeOffset(-2 * 3600); tmz=1; }}, + {"New York", [&]() { timeClient.setTimeOffset(-4 * 3600); tmz=2; }}, + {"Lisbon", [&]() { timeClient.setTimeOffset(1 * 3600); tmz=3; }}, + {"Hong Kong", [&]() { timeClient.setTimeOffset(8 * 3600); tmz=4; }}, + {"Sydney", [&]() { timeClient.setTimeOffset(10 * 3600); tmz=5; }}, + {"Tokyo", [&]() { timeClient.setTimeOffset(9 * 3600); tmz=6; }}, + {"Moscow", [&]() { timeClient.setTimeOffset(3 * 3600); tmz=7; }}, + {"Amsterdan", [&]() { timeClient.setTimeOffset(2 * 3600); tmz=8; }}, + }; + delay(200); + loopOptions(options); + EEPROM.begin(EEPROMSIZE); // open eeprom + EEPROM.write(8, tmz); // set the byte + EEPROM.commit(); // Store data to EEPROM + EEPROM.end(); // Free EEPROM memory + + delay(200); + timeClient.begin(); + timeClient.update(); + localTime = myTZ.toLocal(timeClient.getEpochTime()); + rtc.setTime(timeClient.getEpochTime()); + } + else { + int hr, mn, am; + options = { + {"00", [&]() { hr=0; }}, + {"01", [&]() { hr=1; }}, + {"02", [&]() { hr=2; }}, + {"03", [&]() { hr=3; }}, + {"04", [&]() { hr=4; }}, + {"05", [&]() { hr=5; }}, + {"06", [&]() { hr=6; }}, + {"07", [&]() { hr=7; }}, + {"08", [&]() { hr=8; }}, + {"09", [&]() { hr=9; }}, + {"10", [&]() { hr=10; }}, + {"11", [&]() { hr=11; }}, + }; + delay(200); + loopOptions(options,false,true,"Set Hour"); + delay(200); + options = { + {"00", [&]() { mn=0; }}, + {"01", [&]() { mn=1; }}, + {"02", [&]() { mn=2; }}, + {"03", [&]() { mn=3; }}, + {"04", [&]() { mn=4; }}, + {"05", [&]() { mn=5; }}, + {"06", [&]() { mn=6; }}, + {"07", [&]() { mn=7; }}, + {"08", [&]() { mn=8; }}, + {"09", [&]() { mn=9; }}, + {"10", [&]() { mn=10; }}, + {"11", [&]() { mn=11; }}, + {"12", [&]() { mn=12; }}, + {"13", [&]() { mn=13; }}, + {"14", [&]() { mn=14; }}, + {"15", [&]() { mn=15; }}, + {"16", [&]() { mn=16; }}, + {"17", [&]() { mn=17; }}, + {"18", [&]() { mn=18; }}, + {"19", [&]() { mn=19; }}, + {"20", [&]() { mn=20; }}, + {"21", [&]() { mn=21; }}, + {"22", [&]() { mn=22; }}, + {"23", [&]() { mn=23; }}, + {"24", [&]() { mn=24; }}, + {"25", [&]() { mn=25; }}, + {"26", [&]() { mn=26; }}, + {"27", [&]() { mn=27; }}, + {"28", [&]() { mn=28; }}, + {"29", [&]() { mn=29; }}, + {"30", [&]() { mn=30; }}, + {"31", [&]() { mn=31; }}, + {"32", [&]() { mn=32; }}, + {"33", [&]() { mn=33; }}, + {"34", [&]() { mn=34; }}, + {"35", [&]() { mn=35; }}, + {"36", [&]() { mn=36; }}, + {"37", [&]() { mn=37; }}, + {"38", [&]() { mn=38; }}, + {"39", [&]() { mn=39; }}, + {"40", [&]() { mn=40; }}, + {"41", [&]() { mn=41; }}, + {"42", [&]() { mn=42; }}, + {"43", [&]() { mn=43; }}, + {"44", [&]() { mn=44; }}, + {"45", [&]() { mn=45; }}, + {"46", [&]() { mn=46; }}, + {"47", [&]() { mn=47; }}, + {"48", [&]() { mn=48; }}, + {"49", [&]() { mn=49; }}, + {"50", [&]() { mn=50; }}, + {"51", [&]() { mn=51; }}, + {"52", [&]() { mn=52; }}, + {"53", [&]() { mn=53; }}, + {"54", [&]() { mn=54; }}, + {"55", [&]() { mn=55; }}, + {"56", [&]() { mn=56; }}, + {"57", [&]() { mn=57; }}, + {"58", [&]() { mn=58; }}, + {"59", [&]() { mn=59; }}, + }; + delay(200); + loopOptions(options,false,true,"Set Minute"); + delay(200); + options = { + {"AM", [&]() { am=0; }}, + {"PM", [&]() { am=12; }}, + }; + delay(200); + loopOptions(options); + delay(200); + rtc.setTime(0,mn,hr+am,20,06,2024); // send me a gift, @Pirata! + } + clock_set=true; runClockLoop(); } void runClockLoop() { - - + int tmp=0; + tft.fillScreen(BGCOLOR); for (;;){ + if(millis()-tmp>1000) { + updateTimeStr(rtc.getTimeStruct()); - timeClient.update(); - time_t localTime = myTZ.toLocal(timeClient.getEpochTime()); - struct tm* timeInfo = localtime(&localTime); - - - snprintf(timeStr, sizeof(timeStr), "%02d:%02d", timeInfo->tm_hour, timeInfo->tm_min); + Serial.print("Current time: "); + Serial.println(timeStr); + tft.setTextColor(FGCOLOR,BGCOLOR); + tft.drawRect(45,40,150,45, FGCOLOR); + tft.setCursor(60, 50); + tft.setTextSize(4); + tft.println(timeStr); - Serial.print("Current time: "); - Serial.println(timeStr); - tft.fillScreen(BGCOLOR); - tft.drawRect(45,40,150,45, FGCOLOR); - tft.setCursor(60, 50); - tft.setTextSize(4); - tft.println(timeStr); + } // Checks para sair do loop #ifndef CARDPUTER @@ -180,9 +285,7 @@ void runClockLoop() { break; //goto Exit; } // apertar ESC no Cardputer - #endif - - delay(1000); + #endif } } diff --git a/src/settings.h b/src/settings.h index 8885218cb..1cf447c62 100644 --- a/src/settings.h +++ b/src/settings.h @@ -1,8 +1,7 @@ #include +#include -extern char timeStr[10]; - void setBrightness(int bright, bool save = true); void getBrightness(); diff --git a/src/wg.cpp b/src/wg.cpp index fb870bda2..7b0ef2160 100644 --- a/src/wg.cpp +++ b/src/wg.cpp @@ -1,4 +1,3 @@ -#include #include "wg.h" #include "globals.h" #include "display.h" diff --git a/src/wg.h b/src/wg.h index ce33cabf5..bbc0349d2 100644 --- a/src/wg.h +++ b/src/wg.h @@ -1,5 +1,6 @@ #include #include +#include extern bool isConnectedWireguard; diff --git a/src/wifi_common.cpp b/src/wifi_common.cpp index 16382fa4e..d419df4e0 100644 --- a/src/wifi_common.cpp +++ b/src/wifi_common.cpp @@ -10,9 +10,12 @@ ***************************************************************************************/ bool wifiConnect(String ssid, int encryptation, bool isAP) { if(!isAP) { - + int tmz; EEPROM.begin(EEPROMSIZE); - pwd = EEPROM.readString(10); //43 + tmz = EEPROM.read(8); // read timezone + if(tmz>8) tmz=0; + + pwd = EEPROM.readString(10); //password delay(200); if(encryptation>0) pwd = keyboard(pwd,63, "Network Password:"); @@ -44,6 +47,21 @@ bool wifiConnect(String ssid, int encryptation, bool isAP) { if(WiFi.status() == WL_CONNECTED) { wifiConnected=true; + timeClient.begin(); + timeClient.update(); + if(tmz==0) timeClient.setTimeOffset(-3 * 3600); + if(tmz==1) timeClient.setTimeOffset(-2 * 3600); + if(tmz==2) timeClient.setTimeOffset(-4 * 3600); + if(tmz==3) timeClient.setTimeOffset(1 * 3600); + if(tmz==4) timeClient.setTimeOffset(8 * 3600); + if(tmz==5) timeClient.setTimeOffset(10 * 3600); + if(tmz==6) timeClient.setTimeOffset(9 * 3600); + if(tmz==7) timeClient.setTimeOffset(3 * 3600); + if(tmz==8) timeClient.setTimeOffset(2 * 3600); + localTime = myTZ.toLocal(timeClient.getEpochTime()); + rtc.setTime(timeClient.getEpochTime()); + updateTimeStr(rtc.getTimeStruct()); + clock_set=true; return true; } diff --git a/src/wifi_common.h b/src/wifi_common.h index 80425fb5b..03d60074a 100644 --- a/src/wifi_common.h +++ b/src/wifi_common.h @@ -1,7 +1,8 @@ #include "display.h" #include #include - +#include +#include bool wifiConnect(String ssid, int encryptation, bool isAP = false);