Skip to content

Commit

Permalink
20240607.1
Browse files Browse the repository at this point in the history
Additions to the previous major update:
- Add DNS check before flash starting to enhance the stability of the flashing process display.
- Add mode LED blinking at 3Hz during Zigbee flash.
  • Loading branch information
xyzroe committed Jun 6, 2024
1 parent 2550e56 commit 09e34e9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/web.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,8 @@ void handleApi()
CMD_ZB_CHK_HW,
CMD_ZB_LED_TOG,
CMD_ESP_FAC_RES,
CMD_ZB_ERASE_NVRAM
CMD_ZB_ERASE_NVRAM,
CMD_DNS_CHECK
};
String result = wrongArgs;
const char *argCmd = "cmd";
Expand All @@ -505,6 +506,9 @@ void handleApi()
case CMD_ZB_BSL:
zigbeeEnableBSL();
break;
case CMD_DNS_CHECK:
checkDNS();
break;
case CMD_ZB_ERASE_NVRAM:
xTaskCreate(zbEraseNV, "zbEraseNV", 2048, NULL, 5, NULL);
break;
Expand Down
2 changes: 1 addition & 1 deletion src/websrc/html/PAGE_ZIGBEE.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
})
.then(fw => {
const matchedClass = Object.keys(classToFwMap).find(cls => selectedCard.className.includes(cls));

if (matchedClass && fw[classToFwMap[matchedClass]] && fw[classToFwMap[matchedClass]].length > 0) {
const fileLink = fw[classToFwMap[matchedClass]][0].link;
const baudRate = fw[classToFwMap[matchedClass]][0].baud;
Expand Down
6 changes: 5 additions & 1 deletion src/websrc/js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ const commands = {
CMD_ZB_CHK_FW: 10,
CMD_ZB_CHK_HW: 11,
CMD_ZB_LED_TOG: 12,
CMD_ESP_FAC_RES: 13
CMD_ESP_FAC_RES: 13,
CMD_ZB_ERASE_NVRAM: 14,
CMD_DNS_CHECK: 15
}

const api = {
Expand Down Expand Up @@ -1490,6 +1492,7 @@ function modalAddSpiner() {
}

function startZbFlash(link) {
$.get(apiLink + api.actions.API_CMD + "&cmd=" + api.commands.CMD_DNS_CHECK);
$(modalBtns).html("");
$(modalBody).html("");

Expand Down Expand Up @@ -1695,6 +1698,7 @@ function modalConstructor(type, params) {
$(modalBtns).html("");
switch (type) {
case "flashESP":
$.get(apiLink + api.actions.API_CMD + "&cmd=" + api.commands.CMD_DNS_CHECK);
$(headerText).text(i18next.t('md.esp.fu.tt')).css("color", "red");;
let action = 0;
if (params instanceof FormData) {
Expand Down
3 changes: 3 additions & 0 deletions src/zb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ void zbEraseNV(void *pvParameters)
void flashZbUrl(String url)
{
// zbFwCheck();
ledControl.modeLED.mode = LED_BLINK_3Hz;

checkDNS();
delay(1000);

Expand Down Expand Up @@ -262,6 +264,7 @@ void flashZbUrl(String url)
printLogMsg("Failed to flash Zigbee");
sendEvent(tagZB_FW_err, eventLen, String("Failed!"));
}
ledControl.modeLED.mode = LED_OFF;
}

/*void printBufferAsHex(const byte *buffer, size_t length)
Expand Down

0 comments on commit 09e34e9

Please sign in to comment.