Browse Source

Put rf95 to sleep when starting update

master_sq9mdd
Łukasz Nidecki 12 months ago
parent
commit
45f827611c
  1. 3
      include/taskWebServer.h
  2. 2
      platformio.ini
  3. 1
      src/taskWebServer.cpp

3
include/taskWebServer.h

@ -3,11 +3,12 @@
#include <WebServer.h>
#include <ESPmDNS.h>
#include <Update.h>
#include <BG_RF95.h>
#ifndef TASK_WEBSERVER
#define TASK_WEBSERVER
extern BG_RF95 rf95;
#ifdef KISS_PROTOCOL
extern WiFiServer tncServer;
#endif

2
platformio.ini

@ -27,7 +27,7 @@ lib_deps =
Adafruit Unified Sensor
https://github.com/SQ9MDD/AXP202X_Library.git
SparkFun u-blox Arduino Library
build_flags =
build_flags =
-Wl,--gc-sections,--relax
-D 'KISS_PROTOCOL'
-D 'CALLSIGN="N0CALL-0"'

1
src/taskWebServer.cpp

@ -246,6 +246,7 @@ void handle_saveDeviceCfg(){
}, []() {
HTTPUpload& upload = server.upload();
if (upload.status == UPLOAD_FILE_START) {
rf95.sleep(); // disable rf95 before update
Serial.printf("Update: %s\n", upload.filename.c_str());
if (!Update.begin(UPDATE_SIZE_UNKNOWN)) { //start with max available size
syslog_log(LOG_ERR, String("Update begin error: ") + Update.errorString());

Loading…
Cancel
Save