Merge pull request #198 from lora-aprs/peterus-patch-1

ntp sync ota upload
This commit is contained in:
Peter Buchegger 2022-06-06 23:58:37 +02:00 committed by GitHub
commit 2560fef5ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions

View file

@ -17,7 +17,7 @@ class NTPClient {
unsigned int _port = NTP_DEFAULT_LOCAL_PORT;
long _timeOffset = 0;
unsigned long _updateInterval = 60000; // In ms
unsigned long _updateInterval = 3600000; // In ms
unsigned long _currentEpoc = 0; // In s
unsigned long _lastUpdate = 0; // In ms

View file

@ -18,14 +18,11 @@ bool OTATask::setup(System &system) {
} else { // U_SPIFFS
type = "filesystem";
}
system.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_INFO, getName(), "Start updating %s", type.c_str());
system.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_INFO, getName(), "Start updating %s. please wait, this prozess is taking some time!", type.c_str());
})
.onEnd([&]() {
system.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_INFO, getName(), "OTA End");
})
.onProgress([&](unsigned int progress, unsigned int total) {
system.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_INFO, getName(), "Progress: %f", (progress / (total / 100)));
})
.onError([&](ota_error_t error) {
String error_str;
if (error == OTA_AUTH_ERROR) {