Skip to content

Commit

Permalink
20240928
Browse files Browse the repository at this point in the history
### BETA RELEASE, USE ON YOUR OWN RISK

#### Don't support ESP32-­SOLO-­1 boards. (ESP32-S0WD)

Because of switching to original Espressif Arduino framework

#### Updates and Improvements

- Updated PlatformIO to 6.1.15
- Switched to [email protected]
- Switched to mathieucarbou/[email protected]
- Switched to robtillaart/DS18B20@^0.2.3
- Removed sstaub/Ticker, now using built-in from arduino-esp32
- Reworked code to run on Arduino ESP32 3.0.5 based on the ESP-IDF v5.1.4

#### New Features

- Added update notification to HA for ESP and Radio firmwares
- Support for WPA3
- Support for local IPv6 (only on ETH)
- Added firewall mask (now supports more than one allowed IP)
- Added DNS resolving check before trying to update Zigbee or ESP32

#### Optimizations

- Reworked FS size calculation
- Optimized memory usage by MQTT
- Shortened booting time
- Reworked OTA updating files structure and xzg.json file
- Moved hardware config to NV storage (auto import from file and remove after)
- Moved all web files to FS

#### Fixes

- Fixed very long load if no Zigbee firmware answer
- Removed loading of old config files (used before XZG firmware)
- Removed check and restore DNS, showing real current DNS on the main page

#### Scripts and Build

- Reworked gulp and build scripts to build XZG_*.fs.bin file
- Reworked build_html.py - gulp to data folder, build fs file
- Reworked build.py - creates 3 release files (full, ota, fs)

#### Miscellaneous

- Automatic WiFi and MQTT disabling while RCP (Zigbee) is flashing, but sometimes you still need to totally disable MQTT in settings.
xyzroe
xyzroe
committed
1 hour ago
·
  • Loading branch information
xyzroe committed Sep 28, 2024
1 parent ccce3b2 commit 3647c6a
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_fw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ jobs:
- name: Copy file to latest release directory
run: |
cp xzg.json releases/latest/
cp ./bin/XZG_${{ steps.get_tag.outputs.tag }}.ota.bin releases/latest/XZG.ota.bin
cp ./bin/XZG_${{ steps.get_tag.outputs.tag }}.fs.bin releases/latest/XZG.fs.bin
# cp ./bin/XZG_${{ steps.get_tag.outputs.tag }}.ota.bin releases/latest/XZG.ota.bin
# cp ./bin/XZG_${{ steps.get_tag.outputs.tag }}.fs.bin releases/latest/XZG.fs.bin
echo "File copied to latest release directory."
- name: Commit and push files to releases branch
Expand Down
26 changes: 23 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ bool updWeb = false;

int networkOverseerCounter = 0;


// Ticker tmrNetworkOverseer(handleTmrNetworkOverseer, overseerInterval, 0, MILLIS);
Ticker tmrNetworkOverseer;

Expand Down Expand Up @@ -644,6 +643,19 @@ void setupCoordinatorMode()
}
}

void getEspUpdateTask(void *pvParameters)
{
TaskParams *params = static_cast<TaskParams *>(pvParameters);
getEspUpdate(params->url);
vTaskDelete(NULL);
}

void timerCallback(TimerHandle_t xTimer)
{
TaskParams *params = static_cast<TaskParams *>(pvTimerGetTimerID(xTimer));
xTaskCreate(getEspUpdateTask, "getEspUpdateTask", 8192, params, 1, NULL);
}

void checkFileSys()
{
FirmwareInfo fwInfo = fetchLatestEspFw("fs");
Expand All @@ -668,10 +680,18 @@ void checkFileSys()
commitFile.close();
}

if (vars.needFsDownload)
if (vars.needFsDownload && 1 > 2)
{
LOGI("Downloading FS");
getEspUpdate(fwInfo.url);

static String urlString = fwInfo.url;
static TaskParams params = {urlString.c_str()};

TimerHandle_t timer = xTimerCreate("StartTaskTimer", pdMS_TO_TICKS(5000), pdFALSE, &params, timerCallback);
if (timer != NULL)
{
xTimerStart(timer, 0);
}
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,10 @@ void startAP(const bool start);
void stopWifi();
void checkFileSys();

struct TaskParams
{
const char *url;
};


#endif // MAIN_H
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// AUTO GENERATED FILE
#ifndef VERSION
#define VERSION "20240928.1"
#define VERSION "20240928"
#endif
6 changes: 3 additions & 3 deletions src/web.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ static void apiCmdUpdateUrl(String &result)
if (serverWeb.hasArg(argType))
{
// String link = fetchLatestEspFw();
FirmwareInfo fwInfo = fetchLatestEspFw();
FirmwareInfo fwInfo = fetchLatestEspFw(serverWeb.arg(argType));
if (fwInfo.url)
{
getEspUpdate(fwInfo.url);
Expand Down Expand Up @@ -2227,8 +2227,8 @@ FirmwareInfo fetchLatestEspFw(String type)
if (release.containsKey("version"))
{
info.version = release["version"].as<String>();
//info.url = "https://github.com/xyzroe/XZG/releases/download/" + info.version + "/XZG_" + info.version + "." + type + ".bin";
info.url = "https://raw.githubusercontent.com/xyzroe/XZG/refs/heads/releases/latest/XZG." + type + ".bin";
info.url = "https://github.com/xyzroe/XZG/releases/download/" + info.version + "/XZG_" + info.version + "." + type + ".bin";
//info.url = "https://raw.githubusercontent.com/xyzroe/XZG/refs/heads/releases/latest/XZG." + type + ".bin";
LOGD("Latest version: %s | url %s", info.version.c_str(), info.url.c_str());
}
else
Expand Down

0 comments on commit 3647c6a

Please sign in to comment.